fix: strip provider prefix from model name for direct API providers#6224
Open
MumuTW wants to merge 3 commits into
Open
fix: strip provider prefix from model name for direct API providers#6224MumuTW wants to merge 3 commits into
MumuTW wants to merge 3 commits into
Conversation
When model.default is set to "zai/glm-5.1" in config.yaml, the "zai/" prefix was passed directly to the Z.AI API, causing HTTP 400 errors. Only OpenRouter natively accepts the "provider/model" format; all other direct providers (Z.AI, Google, Kimi, MiniMax, DeepSeek, etc.) require bare model IDs. - Strip prefix in run_agent.py after client initialization (affects all API calls from the main agent loop) - Strip prefix in auxiliary_client.py for the API-key provider path - Add comprehensive tests for both code paths Fixes NousResearch#6211
Keep only the single meaningful test case that exercises the actual code path changed in auxiliary_client.py.
This was referenced Apr 8, 2026
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
auth.py:2238(which only covers thehermes modelCLI flow) by also protecting the runtime API call pathconfig.yamlwith prefixed model namesChanges
run_agent.py: Stripprovider/prefix after client initialization when not using OpenRouteragent/auxiliary_client.py: Same for the API-key provider resolution pathTest plan
Fixes #6211