GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: toggle to keep model/agent when switching sessions by alfredocristofano · Pull Request #24508 · anomalyco/opencode

Conversation

@alfredocristofano

@alfredocristofano alfredocristofano commented Apr 26, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #4930

Type of change

  • New feature

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_switch KV preference (default true for 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?

  • Typecheck passes cleanly across all packages
  • The toggle shows up in the Session command palette as "Keep model/agent when switching sessions" / "Restore model/agent per session"
  • When disabled, switching sessions no longer resets local.agent and local.model from lastUserMessage()

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR
  • I have read the CONTRIBUTING.md guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
alfredocristofano added 2 commits April 26, 2026 17:49
@alfredocristofano
fix: make scrollbar visible in Monokai theme
ff3b905
@alfredocristofano
feat: add toggle to keep model/agent when switching sessions
ef5edd0
@github-actions

github-actions Bot commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

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:

  1. fix(app): keep selected model across new sessions #17190 - fix(app): keep selected model across new sessions

    • This is closely related as it also addresses keeping the model selection across session changes, though it may have been implemented differently or addressed a specific issue.
  2. fix(tui): prevent model picker reset after first message in new session #23681 - fix(tui): prevent model picker reset after first message in new session

    • Related to preventing unwanted resets of model selection during session operations.
  3. fix(app): persist per-agent model selections across agent switches #23420 - fix(app): persist per-agent model selections across agent switches

    • Addresses persistence of model selections, though specifically for agent switches rather than session switches.
  4. fix(acp): sync model and variant when activating session modes #18663 - fix(acp): sync model and variant when activating session modes

    • Related to syncing model state during session mode changes.
  5. fix(acp): session/set_mode now activates agent's configured model #18621 - fix(acp): session/set_mode now activates agent's configured model

    • Touches on model activation during session operations.

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@alfredocristofano alfredocristofano mentioned this pull request Apr 26, 2026
Feature Request: Retain current model and agent selection when switching sessions #4930
Closed
@github-actions github-actions Bot mentioned this pull request May 8, 2026
fix(tui): respect current model config when continuing a session #26355
Closed
3 of 6 tasks
@github-actions github-actions Bot mentioned this pull request May 18, 2026
feat(app): persist model selection per agent #28111
Closed
3 of 6 tasks
@github-actions

github-actions Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

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:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot closed this May 26, 2026
@github-actions github-actions Bot added the automated-pr-cleanup label May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

automated-pr-cleanup

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Feature Request: Retain current model and agent selection when switching sessions

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@alfredocristofano
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.