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 — Only current selected agent's model persists when resuming a session (other agent(s) revert to default) · Issue #23369 · anomalyco/opencode

Only current selected agent's model persists when resuming a session (other agent(s) revert to default) #23369

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Only current selected agent's model persists when resuming a session (other agent(s) revert to default)#23369
Copy link
Assignees
nexxeln

Description

@malventano
malventano
opened on Apr 19, 2026
Issue body actions

Description

When resuming a session (e.g. opencode -c), the selected agent's model is restored, but the other model(s) revert to the default.

Plugins

none

OpenCode version

1.4.11

Steps to reproduce

  1. Configure opencode to have a default model.
  2. Set plan/build models something other than the default.
  3. Close opencode.
  4. opencode -c or load the session within the TUI
  5. Switch agents and observe the other agent now uses the default instead of the one selected in the prior session.

Screenshot and/or share link

No response

Operating System

Ubuntu

Terminal

tmux

Activity

  1. malventano
    added
    bugSomething isn't working
    on Apr 19, 2026
  2. github-actions
    assigned
    rekram1-node
    on Apr 19, 2026
  3. github-actions
    added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 19, 2026
  4. github-actions commented on Apr 19, 2026

    @github-actions
    github-actionsBot
    on Apr 19, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • [FEATURE]: Interactively selected model resets to agent default when switching between Plan and Build modes (TUI) #21351: Interactively selected model resets to agent default when switching between Plan and Build modes (TUI) — describes the same symptom of per-agent model selection not being preserved when switching between agents/modes
    • Model selection is "lost" on continuation and Agent selection is "lost" on compaction #8349 (closed): Model selection is "lost" on continuation — similar loss of model selection state on session resume

    If your issue is specifically about persistence across opencode -c restarts (rather than live mode-switching), it may be a distinct bug worth tracking separately.

  5. kagura-chen commented on Apr 19, 2026

    @kagura-chen
    kagura-chen
    on Apr 19, 2026
    Contributor
    More actions

    I'd like to work on this.

    Root cause: In packages/app/src/context/local.tsx, the session model state (saved.session[id]) stores a single State object ({ agent, model, variant }) rather than per-agent model selections. When switching agents via agent.set(), the new agent's configured model (item.model) overwrites the previous selection. On session resume, session.restore() only receives the last UserMessage's agent/model pair, so only that agent's model is restored — others revert to defaults.

    Proposed fix: Extend the saved session state to include a per-agent model map (agents?: Record<string, { model?: ModelKey; variant?: string | null }>). When switching agents, save the outgoing agent's model before loading the incoming one. On restore, seed the initial agent entry. Add a migration path from the old flat format.

    Reacted by Allyn Malventano
  6. kagura-chen
    added a commit that references this issue on Apr 19, 2026

    fix(app): persist per-agent model selections across agent switches

    This issue will close once commit e54b762 is merged into the 'dev' branch.
    e54b762
  7. thdxr
    removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  8. thdxr
    assigned
    nexxeln
    and unassigned
    rekram1-node
    on May 3, 2026
  9. github-actions commented on Jul 5, 2026

    @github-actions
    github-actionsBot
    on Jul 5, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  10. github-actions
    closed this as not plannedon Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @nexxeln
    nexxeln

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    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.