feat: toggle to keep model/agent when switching sessions#24508
feat: toggle to keep model/agent when switching sessions#24508alfredocristofano wants to merge 2 commits into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Based on the search results, I found several related PRs that address similar functionality around model/agent persistence across session switches: Potentially Related PRs:
These PRs suggest there have been multiple efforts to handle model/agent state management during session switches. You may want to review #17190 and #23681 in particular to ensure there's no overlapping implementation or to understand how the previous attempts addressed this issue. |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #4930
Type of change
What does this PR do?
Right now, every time you switch sessions with
Ctrl+X l, the TUI yanks your model and agent back to whatever the last message in that session used. If you were deliberately using a different setup, tough luck — you have to reconfigure it manually.This PR adds a
sync_prompt_context_on_session_switchKV preference (defaulttruefor backwards compatibility) that controls this behavior. When toggled off via the command palette, your current model and agent selection sticks with you across session switches instead of being overwritten.How did you verify your code works?
local.agentandlocal.modelfromlastUserMessage()Checklist