fix(cli): persist provider on global model switch - #69818
Merged
teknium1 merged 1 commit intoJul 23, 2026
Merged
Conversation
helix4u
marked this pull request as ready for review
July 23, 2026 03:57
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.
What does this PR do?
Ensures classic CLI
/model ... --globalswitches always persist the resolved provider together with the selected model.The two classic CLI persistence paths used
result.provider_changed, which compares the target provider with the current in-memory runtime provider, as a gate for writingmodel.provider. If the session already used the target provider whileconfig.yamlstill contained a stale provider, Hermes persisted the new model but left the stale provider on disk. The next launch then loaded a mismatched model/provider tuple.Successful global switches now persist
result.target_providerunconditionally, matching the existing gateway persistence behavior. Runtime transition behavior can still useprovider_changed; durable configuration cannot.Related Issue
Related to #60903. That PR is conflicting and includes broader endpoint-helper and provider-alias changes. Current main already synchronizes
base_urlandapi_mode; this PR isolates the remaining provider-persistence defect.Type of Change
Changes Made
model.providerfor persisted picker-based model switches.model.providerfor persisted typed/modelswitches.provider_changedisFalse.How to Test
model.provideris stale.result.target_provider.scripts/run_tests.sh -j 4 tests/hermes_cli/test_25106_global_switch_persists_base_url_api_mode.py -q.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — N/A, this restores the existing global-persistence contractcli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs
Focused local validation:
The full pytest suite was not run locally; GitHub CI owns full-suite coverage.