fix(tui): retain model and agent selection when switching sessions#14682
Open
AJIredale wants to merge 1 commit intoanomalyco:devfrom
Open
fix(tui): retain model and agent selection when switching sessions#14682AJIredale wants to merge 1 commit intoanomalyco:devfrom
AJIredale wants to merge 1 commit intoanomalyco:devfrom
Conversation
When switching between sessions, the selected model and agent were reset to defaults because there was no per-session memory. This adds a session map to the existing model.json state file so that when you leave a session the current model and agent are saved against that session ID, and restored when you return to it. New sessions with no saved state fall back to the existing default behaviour unchanged. Fixes anomalyco#4930
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
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.
Issue for this PR
Closes #4930
Type of change
What does this PR do?
When switching between sessions, the selected model and agent were always reset to defaults. There was no per-session memory, so if you had
gpt-4oselected in one session and switched to another, you'd have to re-select it every time you came back.The fix adds a
sessionmap to the existingmodel.jsonstate file (the same file that already stores recent models, favorites, and variants). When you navigate away from a session, the current model and agent are saved under that session's ID. When you navigate back to it, they're restored.Sessions with no saved state fall back to the existing default behaviour, so there's no change for new sessions.
How did you verify your code works?
Manually tested by switching between sessions with different models and agents selected -- each session correctly restores its last used model and agent on return.
Screenshots / recordings
N/A -- this is a state persistence fix with no visual UI changes.
Checklist