Skip to content

fix(gateway): prefer configured provider for model aliases#19904

Open
Interstellar-code wants to merge 1 commit into
NousResearch:mainfrom
Interstellar-code:fix/gateway-model-alias-provider
Open

fix(gateway): prefer configured provider for model aliases#19904
Interstellar-code wants to merge 1 commit into
NousResearch:mainfrom
Interstellar-code:fix/gateway-model-alias-provider

Conversation

@Interstellar-code

Copy link
Copy Markdown
Contributor

Summary

  • make gateway /model read legacy root-level provider/base_url when model is a string
  • align gateway provider fallback with the interactive CLI so ambiguous aliases resolve against the configured provider
  • add regression coverage for /model sonnet with string model + root Anthropic provider config

Fixes #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 passed

Note

  • scripts/run_tests.sh tests/gateway/test_model_command_custom_providers.py -q could not start locally because the shared venv lacks pip while the wrapper attempted to install pytest-split.

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.
@alt-glitch alt-glitch added comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists type/bug Something isn't working labels May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model switcher ignores current provider — ambiguous name resolves to OpenRouter instead of active provider

2 participants