fix(app): keep selected model across new sessions#17190
Open
anduimagui wants to merge 2 commits intoanomalyco:devfrom
Open
fix(app): keep selected model across new sessions#17190anduimagui wants to merge 2 commits intoanomalyco:devfrom
anduimagui wants to merge 2 commits intoanomalyco:devfrom
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Found a potentially related PR: #14682: fix(tui): retain model and agent selection when switching sessions This PR appears related as it addresses retaining model and agent selection, but it's specifically for the TUI (text user interface), while PR #17190 is for the desktop app. Worth checking if there's any shared logic or if they're addressing the same underlying issue from different interfaces. |
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?
Desktop currently restores model and agent state for existing sessions, but starting a new session in the same project can still reset the selected model back to the agent default. That means a manual model choice is not sticky across later new sessions.
This change stores the app's selected model in workspace-scoped persistence and updates the new-session reset path to only restore agent defaults when there is no current model selection to keep. Existing session restore behavior stays the same, while new sessions in the same project keep the selected model.
Related context: #12582 fixed CLI fallback to recent models, but it did not change the desktop app's new-session behavior.
How did you verify your code works?
I added a unit test covering the new-session reset path so it does not overwrite an existing selected model.
I verified locally with:
bun test --preload ./happydom.ts ./src/pages/session/session-model-helpers.test.tsbun typecheckScreenshots / recordings
Not included. This changes state persistence behavior rather than visible UI.
Checklist