[AI-assisted] fix: /model command should clear session overrides#663
Closed
roshanasingh4 wants to merge 1 commit into
Closed
[AI-assisted] fix: /model command should clear session overrides#663roshanasingh4 wants to merge 1 commit into
roshanasingh4 wants to merge 1 commit into
Conversation
Fixes openclaw#646 When /model command updates the default model, session overrides (modelOverride, providerOverride) persisted in session store would continue to take precedence over the new default. This made the /model command appear ineffective. After updating the config, the command now: - Loads the session store - Clears modelOverride and providerOverride from all sessions - Saves the updated session store - Logs how many sessions were cleared This ensures the new default model takes effect immediately for all active sessions. [AI-assisted] - Generated with z.ai GLM-4.7 [Tested: Lightly tested - Logic reviewed, session store APIs are well-tested]
Contributor
Author
roshanasingh4
deleted the
fix/646-model-command-clears-session-overrides
branch
January 10, 2026 15:57
24 tasks
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.
Fixes #646
Problem
When
/modelcommand updates the default model, session overrides (modelOverride,providerOverride) persisted in the session store would continue to take precedence over the new default. This made the/modelcommand appear ineffective.Root Cause
Sessions store
modelOverrideandproviderOverridefields. When resolving which model to use, the code checks session overrides first, then falls back to config defaults. Even after/modelupdates the config default, old session overrides remained.Fix
After updating the config, the
/modelcommand now:modelOverrideandproviderOverridefrom all sessionsThis ensures the new default model takes effect immediately for all active sessions.
[AI-assisted] - Generated with z.ai GLM-4.7
Testing: Lightly tested - Logic reviewed, session store APIs are well-tested. The fix uses try-catch for graceful error handling if session store is unavailable.