Skip to content

Upgrade to OpenCode 2.3.0 and follow always-background subagents - #58

Merged
DEAN-Cherry merged 3 commits into
devfrom
iolaus/opencode-2.3
Nov 13, 2026
Merged

DEAN-Cherry merged 3 commits into
devfrom
iolaus/opencode-2.3

Conversation

@DEAN-Cherry

Copy link
Copy Markdown
Contributor

Why

OpenCode 2.3.0 changed the native subagent tool: it has no background input and never returns the child's answer inline. Every call returns running at once, the parent goes idle, and the child's report wakes it later. session.wait therefore only means "no active execution", not "done". Three things in Iolaus assumed otherwise:

  • A Flow node that delegated settled with its interim reply, while its subagents were still working.
  • Cancelling a run interrupted the node's session but left its subagents running (the host does not cascade).
  • The Hephaestus goal loop continued a session that was only waiting on a subagent, and counted the report turn as an idle turn.

The prompts also still taught the removed background: true argument and a foreground mode.

What changed

  • src/dag/quiesce.ts (new): settle, busy and stop over a session and the subagent sessions below it, read through session.list({parentID}) and time.busy/time.idle. Background shells are deliberately not followed, since one that never exits would never settle.
  • Runner: a node settles with the reply it gives after its subagents reported; cancel stops each generation of subagents before the node.
  • Observer: a recorded call settles from its child session, and a settled child that runs again reopens its node as a new attempt.
  • Goal loop: does not continue a session that waits on subagents (iolaus.goal.waiting); the delegating turn's tool calls count for the report turn.
  • Prompts: 38 files under src/omo/** plus src/prompts/native-bindings.ts describe the 2.3.0 tool. reference/active-manifest.json hashes follow.
  • Dependencies: @opencode/plugin and @opencode/schema 2.3.0, effect 4.1.0, OpenTUI >=0.8.4. Tool is imported from @opencode/plugin/effect, so Tool.Error is the host's class instead of a bundled copy.
  • Minimum host is now 2.3.0.

Verification

  • bun run typecheck clean, bun test 387 pass, bun run check:package PASS, bun run check:reference PASS (800 files).
  • Live QA on the stock v2.3.0 binary, evidence under .iolaus/evidence/opencode-2.3/:
Script Result
qa-roles PASS, 46 checks
qa-live PASS, 30 checks
qa-flow-steering PASS, 35 checks
qa-flow-session-fixes PASS, 21 checks
qa-borrows PASS, 12 checks
qa-subagent-batches PASS, 10 checks
qa-dag-recover PASS, 4 checks
qa-owner-rescue PASS, 3 checks
qa-tui PASS

qa-roles gained three cases for the new behaviour: a delegating Flow node settles with its post-report reply, cancelling a run stops the subagent its node left running, and the goal loop waits for a report before continuing.

QA script changes worth a look

These adapt the scripts to 2.3.0 rather than to the plugin change:

  • The mock reads custom_tool_call_output, which is how 2.3.0 returns a GPT model's patch result. Without it the mock looped on the same call.
  • /api/location/reload now answers before the replacement location has activated its plugins, so qa-flow-steering waits for the Flow RPC to come back.
  • qa-tui pins session.verbosity: "medium"; the new default folds tool rows into + N tool.
  • qa-live raises its runaway-loop cap from 120 to 200 requests (Flow notices add turns) and identifies the ultrawork prompt by its <ultrawork-mode> wrapper. The old ULTRAWORK wording check was already stale on dev.

Not covered

  • qa-tui-responsive, qa-tui-routing, qa-prompt-lanes and qa-global-config were not run on 2.3.0.
  • One qa-live run failed in mcps-librarian on a 500 from mcp.grep.app; the rerun passed. That scenario depends on the live remote service.

The 2.3.0 subagent tool has no background input and returns at once; the
parent idles and is woken by the child's report. session.wait therefore no
longer means a session is done.

- src/dag/quiesce.ts: settle/busy/stop over a session and the subagent
  sessions below it (session.list by parentID, time.busy/time.idle).
- runner: a node settles with the reply it gives after its subagents
  reported; cancel stops the subagents before the node.
- observe: a recorded call settles from its child session and reopens when
  a settled child runs again.
- goal loop: does not continue a session that waits on subagents; the
  delegating turn's tool calls count for the report turn.
- Tool comes from @opencode/plugin/effect, so Tool.Error is the host's class.
- @opencode/plugin and @opencode/schema 2.3.0, effect 4.1.0, OpenTUI >=0.8.4.
No background argument and no foreground mode: every call returns its
sessionID at once and the child reports when it goes idle. Lineage hashes
in reference/active-manifest.json follow the 36 changed files.
- Read custom_tool_call_output (how 2.3.0 returns a GPT model's patch).
- Scenarios follow always-background subagents: answers arrive as reports.
- Wait for the Flow RPC after /location/reload.
- TUI QA pins session.verbosity medium; low folds tool rows.
- qa-roles adds: a delegating Flow node settles with its post-report reply,
  cancel stops a node's subagents, the goal loop waits for a report.
- Evidence under .iolaus/evidence/opencode-2.3/.
@DEAN-Cherry
DEAN-Cherry merged commit 6db6105 into dev Nov 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant