fix(model-fallback): apply transformModelForProvider in getNextFallback#2113
Open
east-shine wants to merge 2 commits intocode-yeongyu:devfrom
Open
fix(model-fallback): apply transformModelForProvider in getNextFallback#2113east-shine wants to merge 2 commits intocode-yeongyu:devfrom
east-shine wants to merge 2 commits intocode-yeongyu:devfrom
Conversation
The getNextFallback function returned raw model names from the hardcoded fallback chain without transforming them for the target provider. For example, github-copilot requires dot notation (claude-sonnet-4.6) but the fallback chain stores hyphen notation (claude-sonnet-4-6). The background-agent retry handler already calls transformModelForProvider correctly, but the sync chat.message hook in model-fallback was missing it — a copy-paste omission. Add transformModelForProvider call in getNextFallback and a test verifying github-copilot model name transformation.
Contributor
|
All contributors have signed the CLA. Thank you! ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
No issues found across 2 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Surgical bug fix ensuring model ID format consistency across providers, with comprehensive test coverage for the transformation logic.
google provider에서 gemini-3-pro → gemini-3-pro-preview 변환이 getNextFallback를 통해 정상 적용되는지 검증하는 테스트 추가. 기존 github-copilot 테스트와 동일한 패턴으로 작성.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getNextFallback()in the model-fallback hook returns raw model names from the hardcoded fallback chain without callingtransformModelForProvider(). This causes fallback to fail silently for providers that require different model name formats:github-copilot: expects dot notation (claude-sonnet-4.6), but the chain stores hyphens (claude-sonnet-4-6)google: expects-previewsuffix (gemini-3-pro-preview), but the chain stores plain names (gemini-3-pro)Root Cause
The
background-agentretry handler (src/features/background-agent/fallback-retry-handler.ts:94) correctly callstransformModelForProvider()before returning the fallback model. However, the syncchat.messagehook inmodel-fallback/hook.tswas missing this call — a copy-paste omission.Before (broken):
After (fixed):
Affected Providers
github-copilotclaude-sonnet-4-6claude-sonnet-4.6github-copilotgemini-3-progemini-3-pro-preview-previewsuffixgooglegemini-3-progemini-3-pro-preview-previewsuffixgooglegemini-3-flashgemini-3-flash-preview-previewsuffixanthropicclaude-opus-4-6claude-opus-4-6Changes
src/hooks/model-fallback/hook.ts: ImporttransformModelForProviderand apply it ingetNextFallback()return valuesrc/hooks/model-fallback/hook.test.ts: Add tests verifying model name transformation for bothgithub-copilot(claude-sonnet-4-6→claude-sonnet-4.6) andgoogle(gemini-3-pro→gemini-3-pro-preview) providers through the fallback chainScope
This fix targets only the hardcoded agent fallback chain (
model-fallbackhook). Theruntime-fallbackhook (auto-retry.ts) uses user-configuredfallback_modelswhere users specify provider-correct names directly, so no change is needed there.Testing
tsc --noEmit)