fix(gateway): prefer configured provider for model aliases#19904
Open
Interstellar-code wants to merge 1 commit into
Open
fix(gateway): prefer configured provider for model aliases#19904Interstellar-code wants to merge 1 commit into
Interstellar-code wants to merge 1 commit into
Conversation
Gateway /model commands can run with legacy config shape where model is a string and provider/base_url live at the root. Reuse the CLI fallback semantics so ambiguous aliases resolve against the configured provider instead of the OpenRouter default. Constraint: BlueBubbles/gateway reports can use raw config loading rather than load_cli_config's normalized model dict. Rejected: changing core alias resolution | switch_model already tries the current provider first when it receives the correct provider. Confidence: high Scope-risk: narrow Directive: Keep gateway raw-config model/provider parsing aligned with CLI legacy fallback behavior. Tested: python3 -m py_compile gateway/run.py tests/gateway/test_model_command_custom_providers.py; venv python -m pytest tests/gateway/test_model_command_custom_providers.py -q -n 4 Not-tested: scripts/run_tests.sh targeted run could not start because the shared venv lacks pip while the wrapper tried to install pytest-split.
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
/modelread legacy root-levelprovider/base_urlwhenmodelis a string/model sonnetwith string model + root Anthropic provider configFixes #19858
Validation
python3 -m py_compile gateway/run.py tests/gateway/test_model_command_custom_providers.py$HOME/.hermes/hermes-agent/venv/bin/python -m pytest tests/gateway/test_model_command_custom_providers.py -q -n 4→ 2 passedNote
scripts/run_tests.sh tests/gateway/test_model_command_custom_providers.py -qcould not start locally because the shared venv lackspipwhile the wrapper attempted to installpytest-split.