From efd3f21e29dd17c287f4e569670d80c9d0f85d5a Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Thu, 12 Feb 2026 07:40:15 +0700 Subject: [PATCH] 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. --- src/cliproxy/executor/retry-handler.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cliproxy/executor/retry-handler.ts b/src/cliproxy/executor/retry-handler.ts index 724e98b0..a0e4cfcc 100644 --- a/src/cliproxy/executor/retry-handler.ts +++ b/src/cliproxy/executor/retry-handler.ts @@ -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; }