fix(kiro): add open-weight model mappings to mapModelToKiro#440
fix(kiro): add open-weight model mappings to mapModelToKiro#440andromedarabbit wants to merge 1 commit intorouter-for-me:mainfrom
Conversation
DeepSeek, MiniMax, Qwen3 Coder, and GPT models were defined in GetKiroModels() but missing from mapModelToKiro(), causing them to silently fall back to claude-sonnet-4.5 instead of routing to the correct backend model. Adds static mappings for all open-weight models (kiro-, native, and agentic variants) and smart fallback patterns for unknown variants of each model family. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue where open-weight models were incorrectly defaulting to a Claude model due to missing explicit routing configurations. By introducing comprehensive mappings and intelligent fallback mechanisms, it ensures that DeepSeek, MiniMax, Qwen3 Coder, and GPT models are accurately directed to their intended backends. This enhancement significantly improves the reliability of model selection and prevents misrouting, all while maintaining backward compatibility and providing extensive test validation. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly addresses a bug where open-weight models were not being mapped correctly in mapModelToKiro, causing them to fall back to the wrong model. The changes add the necessary mappings and fallback logic for DeepSeek, MiniMax, Qwen, and GPT models. The addition of comprehensive test cases is also a great improvement.
My review identifies some redundant entries in both the model map and the corresponding test cases. Removing these duplicates will improve code clarity and maintainability. Otherwise, the changes look solid.
Summary
Fixes #429
Open-weight models (DeepSeek, MiniMax, Qwen3 Coder, GPT) were defined in
GetKiroModels()but missing frommapModelToKiro(), causing them to silently fall back toclaude-sonnet-4.5instead of routing to the correct backend model.Root Cause
mapModelToKiro()inkiro_executor.gohas a hardcodedmodelMapthat only contained Claude models andauto. When a user selected e.g.kiro-deepseek-3-2, the model name:claude-sonnet-4.5(wrong model sent to API)The model definitions were added in commits
09cd3cffand37a09ecbtomodel_definitions.go, but the corresponding routing inmapModelToKiro()was never updated.Changes
internal/runtime/executor/kiro_executor.gomapModelToKiro():kiro-, native hyphen, native dot formats + agentic variants)kiro-, native hyphen, native dot formats + agentic variants)kiro-, native formats + agentic variants)kiro-, native formats)deepseek,minimax,qwen, andgptmodel families (after existing Claude fallbacks)internal/runtime/executor/kiro_executor_test.goTestMapModelToKiro_OpenWeightModels— 24 test cases covering all model IDs and prefix formatsTestMapModelToKiro_FallbackPatterns— 11 test cases for smart fallback logicTestMapModelToKiro_ExistingClaudeModels— 5 regression tests for existing Claude routingTesting
All 40 new test cases pass. Full executor test suite passes with no regressions.
Risk Assessment