Conversation
4 tasks
This was referenced May 13, 2026
Both gateway /model and CLI /model --global now persist the full runtime tuple (model, provider, base_url, api_mode) to config.yaml. Previously: - Gateway: only persisted base_url when truthy (stale values survived) - Gateway: api_mode was never persisted - CLI: neither base_url nor api_mode was persisted via --global This caused stale endpoint/protocol state to survive model switches, leading to wrong routing after restart or new sessions. Fix: unconditionally write all four fields, using empty-string to clear stale values: model_cfg["base_url"] = result.base_url or "" model_cfg["api_mode"] = result.api_mode or "" Closes NousResearch#25107 Closes NousResearch#25106 See also NousResearch#25105 (kimi-for-coding alias — separate normalization issue)
zccyman
force-pushed
the
fix/model-switch-persist-complete
branch
from
May 18, 2026 00:28
f8d8023 to
5a3064e
Compare
This was referenced Jul 8, 2026
Collaborator
|
Thanks for identifying the remaining CLI persistence gap. The CLI premise is still present on current Problems
Suggested changes
This is an automated hermes-sweeper review. |
Collaborator
|
Thanks for identifying this persistence-gap class early — you were 2 months ahead of the fixes that eventually landed. Closing as superseded on current main, in three pieces:
Nothing from this branch remains unlanded, and the gateway hunk targets a path that has since moved (per the earlier sweeper review). Appreciate the report and the diagnosis — the bug class was real and is now fully covered with regression tests on all paths. |
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
Both gateway
/modeland CLI/model --globalnow persist the complete runtime tuple toconfig.yaml:Before
Gateway
/model(gateway/run.py):CLI
/model --global(cli.py, 2 locations):After
Gateway — unconditional with empty-string clearing:
CLI — two additional
save_config_valuecalls:Impact
Fixes the class of bugs where switching models leaves stale endpoint/protocol state:
base_urlsurvives""api_modesurvives""Testing
Files changed
gateway/run.pybase_url+api_modeunconditionallycli.pysave_config_valueforbase_url+api_mode(2 locations)tests/gateway/test_model_switch_config_persistence.pyCloses #25107
Closes #25106
See also #25105 (kimi-for-coding alias normalization — separate issue)