Skip to content

Background subagent notification silently reverts manually-selected model to config default #38770

Description

@jessie-amaranthine

Description

When "OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true" is set and I manually select a non-default model in the picker, the model silently reverts to the agent's configured default (per "opencode.json") the moment the first background subagent notification is injected into the session.

The system prompt does not refresh after the revert; the agent continues reporting the old model as its identity because it has no way to detect the switch. Per session data from Tokscale (a CLI token-tracking dashboard), I was charged on both models sequentially -- the user-selected model handles messages before the notification; the config default handles messages after.

This does NOT happen with foreground subagent dispatch (multiple parallel task calls without background: true). It only triggers observably when background notifications are injected and I've manually selected a non-default model. When I stay on the config default model, any revert would be unobservable because the fallback target matches the active model.

Plugins

None

OpenCode version

OpenCode v1.18.4

Steps to reproduce

  1. Set "OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true" in environment variables
  2. In opencode.json, set a primary agent's model to Model A (e.g., opencode-go/deepseek-v4-pro)
  3. Open a fresh session, manually select a different Model B (e.g., opencode-go/minimax-m3)
  4. Send a message that causes the agent to dispatch subagents with "background: true"
  5. Observe: the model switches from Model B back to Model A as soon as the first background notification arrives
  6. The agent's system prompt still reports Model B (exported Markdown conversation + Tokscale confirms the responding model is actually Model A)

Screenshot and/or share link

No response

Operating System

Windows 10

Terminal

OpenChamber v1.16.3

Metadata

Metadata

Assignees

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