fix(cliproxy): handle edge cases in thinking validation

- model-catalog: add null guard and trim for modelId lookup
- thinking-validator: add 100 char length limit, accept "8192.0" format
- cliproxy-executor: error on empty --thinking= value
- use-thinking-config: handle HTML error pages, return cleanup fn
This commit is contained in:
kaitranntt committed 2026-01-21 17:52:16 -05:00
1 parent 299d96c011
commit ca490a9f4e
4 files changed
+42 -4

No files matched your search

+2 -2
View File
@@ -188,8 +188,8 @@ export function getProviderCatalog(provider: CLIProxyProvider): ProviderCatalog
*/
export function findModel(provider: CLIProxyProvider, modelId: string): ModelEntry | undefined {
const catalog = MODEL_CATALOG[provider];
if (!catalog) return undefined;
const normalizedId = modelId.toLowerCase();
if (!catalog || !modelId) return undefined;
const normalizedId = modelId.trim().toLowerCase();
return catalog.models.find((m) => m.id.toLowerCase() === normalizedId);
}