fix(retry): guard claude-code fallback to anthropic provider only
Prevent _tryClaudeCodeFallback from firing for non-Anthropic providers that may produce similar error text, avoiding unintended provider drift. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ea456d4cdb
commit
3ea46099d0
1 changed files with 4 additions and 0 deletions
|
|
@ -477,6 +477,10 @@ export class RetryHandler {
|
|||
const currentModel = this._deps.getModel();
|
||||
if (!currentModel) return false;
|
||||
|
||||
// Only attempt claude-code fallback when the current provider is anthropic.
|
||||
// Other providers may produce similar error text but should not be rerouted.
|
||||
if (currentModel.provider !== "anthropic") return false;
|
||||
|
||||
// Find the same model ID under the claude-code provider
|
||||
const ccModel = this._deps.modelRegistry.find("claude-code", currentModel.id);
|
||||
if (!ccModel) return false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue