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

+7 -1
View File
@@ -6,6 +6,7 @@
*/
import { CLIProxyProvider } from './types';
import { normalizeModelIdForProvider } from './model-id-normalizer';
/**
* Thinking support configuration for a model.
@@ -322,7 +323,12 @@ export function findModel(provider: CLIProxyProvider, modelId: string): ModelEnt
const catalog = MODEL_CATALOG[provider];
if (!catalog || !modelId) return undefined;
const normalizedId = modelId.trim().toLowerCase();
return catalog.models.find((m) => m.id.toLowerCase() === normalizedId);
const providerNormalizedId = normalizeModelIdForProvider(normalizedId, provider)
.trim()
.toLowerCase();
const lookupCandidates = new Set([normalizedId, providerNormalizedId]);
return catalog.models.find((m) => lookupCandidates.has(m.id.toLowerCase()));
}
/**