Conversation
|
Hey @LeonSGP43 — the duplicate-detector bot linked this PR alongside #29198, which I opened for the same issue. Wanted to share the architectural difference in case it's useful for rescoping. #29198 fixes only the This PR is broader: it adds If #29198 lands first, this PR could rescope to just the gateway + oneshot callers (the parts #29198 doesn't cover) — that'd keep the broader architectural improvement landable while reducing conflict surface. The |
|
Update on my earlier comment: I closed #29198 in favor of this PR. After tracing the actual call flow on current main:
So once this PR's Validation against current main (May 20):
With the 3 cleanly-applicable hunks + this PR's tests applied to current main, the full alias-resolution test surface passes:
55 tests pass. If you have bandwidth to rebase, the only material work is reconciling the |
|
I hit this same bug in a real config where the default provider is Observed failure before the fix: hermes chat -q 'Reply exactly OK' -m opus47 -Q --toolsets safeThe raw alias was sent to the default Codex provider instead of being resolved to the alias' custom provider/model, producing a provider/model mismatch. With an explicit custom provider, the provider was correct but the raw alias could still reach the upstream if not expanded early enough. I checked this PR because it appears to cover the exact runtime/startup alias path. The targeted tests pass locally for me on the PR branch: This matches the behavior I needed: |
|
Thanks for isolating the runtime alias gap. The premise remains valid on current main: explicit-provider oneshot skips direct-alias lookup at Problems
Suggested changes
Automated hermes-sweeper review. |
Related to open #30716 and #62534: this branch covers broader CLI/oneshot/gateway runtime setup, while those target narrower CLI choke points. Current maintainer review identifies an unaddressed TUI startup path, so this needs consolidation rather than duplicate closure. |
Summary
Fixes #18954.
Direct
model_aliases:entries were resolved in the/modelswitch flow, but normal runtime startup could still pass the alias itself as the API model. That broke custom-provider aliases such asopus -> claude-opus-4-6, especially when the provider was already explicit or came from config/env.This PR adds a small direct-alias lookup helper and applies it before runtime provider construction in:
hermes chat -m ...runtime setup, including explicit--providerThe change keeps the existing
/modelbehavior intact and preserves direct-aliasbase_urlrouting for custom endpoints.Verification
scripts/run_tests.sh tests/cli/test_cli_provider_resolution.py::test_runtime_resolution_resolves_direct_model_alias tests/gateway/test_session_model_override_routing.py::test_gateway_runtime_resolves_direct_model_alias tests/hermes_cli/test_oneshot_model_aliases.py::test_oneshot_resolves_direct_model_alias_with_explicit_provider3 passed, 3 warningsscripts/run_tests.sh tests/hermes_cli/test_ollama_cloud_auth.py tests/gateway/test_session_model_override_routing.py tests/hermes_cli/test_oneshot_model_aliases.py35 passed, 4 warningsscripts/run_tests.sh tests/cli/test_cli_provider_resolution.py20 passed, 4 warnings