fix(cliproxy): strip thinking suffix in detectFailedTier matching

Model names with thinking suffixes like "model(high)" now match stderr
that contains the base model name without the suffix.
This commit is contained in:
Tam Nhu Tran
2026-02-12 07:40:15 +07:00
parent 1ebd9f43d6
commit efd3f21e29
+3 -1
View File
@@ -116,7 +116,9 @@ export function detectFailedTier(
tiers: { opus: CompositeTierConfig; sonnet: CompositeTierConfig; haiku: CompositeTierConfig }
): 'opus' | 'sonnet' | 'haiku' | null {
for (const tier of ['opus', 'sonnet', 'haiku'] as const) {
if (stderr.includes(tiers[tier].model)) return tier;
// Strip thinking suffix (e.g., "model(high)" → "model") for matching
const model = tiers[tier].model.replace(/\([^)]+\)$/, '');
if (stderr.includes(model)) return tier;
}
return null;
}