GeezerVison is showing github.com — fix(app): keep selected model across new sessions by anduimagui · Pull Request #17190 · anomalyco/opencode
Conversation
anduimagui
commented
Mar 12, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Issue for this PR
Closes #4930
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
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.ts
bun typecheck
Screenshots / recordings
Not included. This changes state persistence behavior rather than visible UI.
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.