fix(cliproxy): normalize provider-aware Claude model IDs

This commit is contained in:
Tam Nhu Tran committed 2026-02-21 02:14:09 +07:00
1 parent 6a9abd2a48
commit 6429781e8f
13 files changed
+408 -32

No files matched your search

+4 -2
View File
@@ -24,6 +24,7 @@ import { stripClaudeCodeEnv } from '../../utils/shell-executor';
import { CodexReasoningProxy } from '../codex-reasoning-proxy';
import { ToolSanitizationProxy } from '../tool-sanitization-proxy';
import { HttpsTunnelProxy } from '../https-tunnel-proxy';
import { normalizeModelIdForProvider } from '../model-id-normalizer';
export interface RemoteProxyConfig {
host: string;
@@ -271,10 +272,11 @@ export function applyFallback(
} as const;
const result = { ...env };
const originalModel = result[tierEnvMap[failedTier]];
result[tierEnvMap[failedTier]] = fallback.model;
const normalizedFallbackModel = normalizeModelIdForProvider(fallback.model, fallback.provider);
result[tierEnvMap[failedTier]] = normalizedFallbackModel;
// If failed tier is default tier, also update ANTHROPIC_MODEL
if (result.ANTHROPIC_MODEL === originalModel) {
result.ANTHROPIC_MODEL = fallback.model;
result.ANTHROPIC_MODEL = normalizedFallbackModel;
}
return result;
}