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 — Primary agent model switches to subagent model after returning to session · Issue #8946 · anomalyco/opencode

Primary agent model switches to subagent model after returning to session #8946

New issue
Copy link
New issue
Copy link
Closed
#8951
Closed
Primary agent model switches to subagent model after returning to session#8946
#8951
Copy link
Assignees
rekram1-node
Labels
bugSomething isn't working

Description

@sethcarlton
sethcarlton
opened on Jan 16, 2026
Issue body actions

Description

After running a subagent with a different model than the primary agent, returning to the main session may cause the primary agent to adopt the subagent’s model.

Plugins

No response

OpenCode version

1.1.23

Steps to reproduce

Setup

  • Primary agent model: openai/gpt-5.2-codex
  • Subagent config example:
---
description: Foo agent
mode: subagent
model: opencode/gemini-3-flash
---

You are a foo agent

Steps to Reproduce

  1. Open a new session.
  2. Send a message as the primary agent (e.g., “Hi how are you”).
  3. Invoke the subagent so it produces output and becomes the last message. For example, using the following /foo command. To reproduce it consistently, you can interrupt the subagent during its work (see screenshot).
---
description: Test md file creation
agent: foo
---

Create a test.md file with the text "bar". If the file exists, update it with "bar".
  1. Navigate to the subagent output view, then navigate back to the primary agent.

Behavior

Expected Behavior

The primary agent should remain on its configured model: openai/gpt-5.2-codex

Actual Behavior

The primary agent incorrectly switches to the subagent model: opencode/gemini-3-flash

Notes / Additional Repro Paths

This issue only presents itself with the subagent appears as the last agent used in the list. I seem to getting mixed results on whether or not the flow is passed back to the primary agent or not. The issue can also occur during the following scenarios:

  • Session Switching: Switching sessions via /session and then returning to the original session.
  • App Restart: Closing OpenCode, reopening the application, and revisiting the session

Screenshot and/or share link

Before navigating to sub agent output
Image

After navigating back to primary agent
Image

Operating System

macOS 15.7.3

Terminal

Ghostty

Activity

  1. sethcarlton
    added
    bugSomething isn't working
    on Jan 16, 2026
  2. github-actions
    assigned
    rekram1-node
    on Jan 16, 2026
  3. github-actions commented on Jan 16, 2026

    @github-actions
    github-actionsBot
    on Jan 16, 2026 – with GitHub Actions
    Contributor
    More actions

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

    • Models in subagents override TUI session model #7430: Models in subagents override TUI session model

    Feel free to ignore if this doesn't address your specific case.

  4. rekram1-node
    closed this as completedin #8951on Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

Labels

bugSomething isn't working

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.