fix(persistence): persist provider in model_config on model switch (#79536) - #79811
fix(persistence): persist provider in model_config on model switch (#79536)#79811RelaxJonh wants to merge 1 commit into
Conversation
…ousResearch#79536) When a session falls back to a model on a different provider and the user switches to it with /model, update_session_model() previously wrote only the model name to the sessions table — the provider was lost. On the next session resume, the runtime recombined the persisted model with the primary provider from config.yaml, producing a guaranteed 404 on every turn. Fix: add an optional `provider` keyword argument to update_session_model(). When given, the provider and model are also written into the model_config JSON blob via json_set(), so session resume can recombine the correct provider + model pair. Call sites in gateway/slash_commands.py and tui_gateway/server.py now pass the resolved provider (result.target_provider and model_config["provider"] respectively). Fixes NousResearch#79536
9f69538 to
5bac2f7
Compare
|
Thanks — reviewed against current One note for the record that applies to both PRs: the Closing as duplicate — thanks for the fix and for confirming the read-side loop. |
Problem
When a session falls back to a model on a different provider and the user switches to it with (or the Desktop model selector), writes only the model name to the table — the provider is lost. On the next session resume, the runtime recombines the persisted model with the primary provider from , producing a guaranteed on every turn.
Root Cause
sets but never writes or keys into the JSON blob. The session-resume code has no way to recover the correct provider/model pair.
Fix
Add an optional keyword argument to . When given, the provider and model are persisted into via , so session resume recombines the correct pair.
Files Changed
Backward Compatibility
Fixes #79536