-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
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 agentSteps to Reproduce
- Open a new session.
- Send a message as the primary agent (e.g., “Hi how are you”).
- Invoke the subagent so it produces output and becomes the last message. For example, using the following
/foocommand. 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".- 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
/sessionand 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

After navigating back to primary agent

Operating System
macOS 15.7.3
Terminal
Ghostty
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working