anomalyco / anomalyco/opencode

Background subagent completion flips active TUI model without viewing child session

Open
#47,526 1 comment 0 reactions 1 assignee View on GitHub

@kommander is already working on this.

Since Sep 5, 2026.

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

Description

Background subagent completion changes the active TUI model without opening the child session.

Repro:

  1. Open a TUI parent session on opencode/muse-spark-1.3-contributor-free, variant xhigh.
  2. Launch a background general subagent on opencode/mimo-v2.5-free.
  3. Do not open the child session view.
  4. Wait for the background completion notice, then check the TUI footer before opening anything.

Expected:
Parent stays on muse-spark-1.3-contributor-free.

Actual:
Active TUI model flips to mimo-v2.5-free.

Stored rows after the flip:

  • parent ses_10a529466ffekP3eyrKuFbDs4t: build, {"id":"muse-spark-1.3-contributor-free","providerID":"opencode","variant":"xhigh"}
  • child ses_f8d6a7bcfffefDiTWqKnKiNMIU: general, {"id":"mimo-v2.5-free","providerID":"opencode","variant":"default"}

So the persisted parent session keeps the right model; the live TUI selection follows the finished background child.

Related:

  • #8946 / #8951 fixed the navigate-back variant by keeping model/variant updates inside the primary-agent guard.
  • This is the background-completion variant: no child navigation happened before the flip.

Environment:

  • opencode 1.18.25 TUI
  • Latest release at report time: v1.18.29
  • Linux, local config with explicit agent.build and subagent models.

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.