Repository navigation
Upgrade to OpenCode 2.3.0 and follow always-background subagents - #58
Merged
Merged
Conversation
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/.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
OpenCode 2.3.0 changed the native
subagenttool: it has nobackgroundinput and never returns the child's answer inline. Every call returnsrunningat once, the parent goes idle, and the child's report wakes it later.session.waittherefore only means "no active execution", not "done". Three things in Iolaus assumed otherwise:The prompts also still taught the removed
background: trueargument and a foreground mode.What changed
src/dag/quiesce.ts(new):settle,busyandstopover a session and the subagent sessions below it, read throughsession.list({parentID})andtime.busy/time.idle. Background shells are deliberately not followed, since one that never exits would never settle.cancelstops each generation of subagents before the node.iolaus.goal.waiting); the delegating turn's tool calls count for the report turn.src/omo/**plussrc/prompts/native-bindings.tsdescribe the 2.3.0 tool.reference/active-manifest.jsonhashes follow.@opencode/pluginand@opencode/schema2.3.0,effect4.1.0, OpenTUI>=0.8.4.Toolis imported from@opencode/plugin/effect, soTool.Erroris the host's class instead of a bundled copy.Verification
bun run typecheckclean,bun test387 pass,bun run check:packagePASS,bun run check:referencePASS (800 files)..iolaus/evidence/opencode-2.3/:qa-rolesqa-liveqa-flow-steeringqa-flow-session-fixesqa-borrowsqa-subagent-batchesqa-dag-recoverqa-owner-rescueqa-tuiqa-rolesgained 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:
custom_tool_call_output, which is how 2.3.0 returns a GPT model'spatchresult. Without it the mock looped on the same call./api/location/reloadnow answers before the replacement location has activated its plugins, soqa-flow-steeringwaits for the Flow RPC to come back.qa-tuipinssession.verbosity: "medium"; the new default folds tool rows into+ N tool.qa-liveraises its runaway-loop cap from 120 to 200 requests (Flow notices add turns) and identifies the ultrawork prompt by its<ultrawork-mode>wrapper. The oldULTRAWORKwording check was already stale ondev.Not covered
qa-tui-responsive,qa-tui-routing,qa-prompt-lanesandqa-global-configwere not run on 2.3.0.qa-liverun failed inmcps-librarianon a 500 frommcp.grep.app; the rerun passed. That scenario depends on the live remote service.