mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-20 02:17:05 +00:00
fix(cliproxy): normalize provider-aware Claude model IDs
This commit is contained in:
1 parent
6a9abd2a48
commit
6429781e8f
13 files changed
+408
-32
No files matched your search
@@ -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()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user