anomalyco / anomalyco/opencode

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

Open
#38,770 3 comments 0 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Jul 24, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.