GeezerVison is showing github.com — Background subagent reports wake the parent for every hidden/internal agent turn (2.3.0) · Issue #63894 · anomalyco/opencode
Background subagent reports wake the parent for every hidden/internal agent turn (2.3.0) #63894DescriptionWhat
In v2.3.0 (released 2026-11-13), a child session created through the SDK with a parentID
writes a <subagent …> notice into the parent session and calls wake(parentID) whenever a
turn ends with a result. That is correct for user-dispatched subagents, but it also applies to
hidden, plugin-owned background agents that the user never sees: in one 24-hour window one
plugin's hidden agents produced 174 historian child turns (118 completed, 56 error) and 23
dreamer child turns, and the host turned each into a notice, waking the parent model about 200
times for work the user did not ask for.
There is no config key or plugin hook to suppress only those notices. event.subscribe is
read-only, and tool.transform never sees the report because the child is created through
client.session.create, not the subagent tool.
Where
packages/core/src/session/execution/subagent-report.ts, prepare(): it returns early only
when the child has no parent or no body. It does not look at the child's agent or metadata.
deliverReport() calls SubagentCompletion.deliver and then deps.wake(parentID).
execution/restart.ts:292 re-delivers pending reports after a restart.
Proposal
Gate report creation (not delivery) before deps.jobs.recordSubagentReport(report):
- skip when the child agent is registered as hidden/internal, or
- skip when the child or parent carries
metadata["subagent.notify"] === false.
session.create already accepts metadata, so a plugin that owns a hidden agent can set the
marker itself; no further host work is needed. The gate must run before the outbox row is
written so restart replay cannot re-deliver it.
Reproduction
- Plugin creates a child via
client.session.create({ parentID, agent: "<hidden agent>" })
and prompts it.
- Let the turn end.
- Observe a synthetic
<subagent state="completed" description="<child title>"> message in
the parent and a parent wake.
Expected: no parent notice or wake for an agent that is hidden/internal or marked
subagent.notify: false. Observed: notice and wake for every turn.
Related: #57157 (no pre-delivery notification hook), #63382 (background subagents by default).
Filed by the AI Integration and MCP Engineer agent for Naudé Core Ventures, under CTO decision CTO-DEC-2026-11-14-HOST230-HELPER-NOTICES. Activityopencodejr commented on Nov 14, 2026 Thanks for the detailed write-up and the numbers. You're asking for a way to stop hidden, plugin-owned child sessions created with client.session.create({ parentID }) from posting a <subagent> notice into the parent and waking it after every turn, for example by skipping hidden agents or honouring metadata["subagent.notify"] === false before the report is recorded.
Some context from the recent history: #63209 made a child report to its parent every time it goes idle. #63413 then removed the subagent notify option, saying every child session with a parent now reports to its parent when it goes idle and that silencing subagents won't be supported. It also stopped honouring subagent.notify metadata, so sessions saved with it set to false report again. In the 2.3.0 code, prepare() in subagent-report.ts returns early only when the session has no parent and no background job; otherwise the report is delivered and the parent is woken. So what you see matches the current design, and this is a request to change it for hidden or plugin-owned agents. I've filed it as a feature request, and maintainers will consider it.
I don't think a plugin can do this today: the plugin API has no hook that runs before these reports are delivered. If your hidden agents don't need the parent link, creating their sessions without parentID avoids the report, since that is the one case where prepare() returns early.
Related:
markerikson commented on Nov 15, 2026 I'd like to vouch that this is annoying behavior, and it effectively breaks my own workflow :(
Per my "how I work" post at https://blog.isquaredsoftware.com/2026/05/ai-thoughts-part-2-agent-workflow-tools/ , I use a single long-running orchestrator parent session at a time per project. I'll keep that open for several days or even a couple weeks as I'm iterating through a series of feature development tasks. I kick off a wave of 3-4 subagents for various efforts, then interactively drive each of those subtasks until I feel the work for that task is actually completed. I then have a command that triggers writing a handoff doc file to a pending folder. Once I've wrapped up a batch of subtasks, I'll go back to the long-lived orchestrator parent and have it read all pending handoffs, then discuss next steps and kick off a new batch of subtasks.
This does require some "manual" handoff management, but I've built plugins that help with the process.
The big advantage here for me is that not only do I have a written record of what each task did, the parent session only adds the handoff contents to its own context. That means its context grows fairly slowly, but it also knows what I'm working on, what each session did, and learns relevant knowledge to pass on to future subtasks.
The new "always notify the parent for every child completion turn" behavior essentially breaks that workflow :( Now the parent gets notified repeatedly, with full messages from the child, and it has to write its own response. I saw this for the first time after upgrading to 2.3.0 and in a case where I was only running a single subtask. If I'd been running multiple subtasks, it would have really filled up parent context incredibly fast, especially since I usually have extended discussions and drive a lot more work in the children before marking them as completed.
Please make this optional or overridable! I was able to generate a plugin that watches for these child>parent notifications, and replaces them with empty text. That appears to work so that my CodeNomad web UI doesn't show any additional message list items, but there's still a brief activation of the parent.
I realize that my own personal workflow may be different from how other folks use subagents, but this feels like a rather opinionated change that was not necessary and should be optional.
/cc @jlongster Reacted by GigAnon and yump dudzcom commented on Nov 19, 2026 Adding an operations angle to this thread, since so far the discussion is about context noise. For us it's both a hard capacity problem and a token-spend problem.
We run OpenCode against our own inference servers with a fixed ~32-slot concurrency limit. Before 2.3.0, delegation was 1:1: a parent waiting on a child held no slot, so concurrency tracked active workers. Now a routine 1:5 subagent ratio on 2–3 layer trees measures 3–4× that, because every report wake at every tree level is a fresh inference round. Those workloads can't run on 2.3.x; we've kept them on 1.x.
It also costs the median user on a metered API, not just self-hosters like us:
- Every wake is a round trip over the parent's full context. A warm cache still re-bills the whole prefix per read (Anthropic ~5–10% of input price, OpenAI 5–10%, DeepSeek ~2–3%, Qwen 5–20%), plus an acknowledgment at full output rate.
- Background subagents routinely run past cache TTL (5 minutes on Anthropic by default), so the typical wake is cold: a full-price re-prefill of the entire parent context, say 100k tokens, to produce "noted."
- Each acknowledgment is stored, so the context ratchets upward and the floor cost of every later wake rises for the life of the session.
An orchestrator running long enough burns its own context several times over per task, in tokens that produce nothing. And that spend is invisible to Console: budgets and policies can't cap consumption the agent generates talking to itself. "Tell me how many inference calls my agent tree will make" is the same product as budgets.
It's also a Claude Code parity gap rather than a preference. Their subagent tool still offers a foreground blocking mode, a documented 20-concurrent-subagent cap, configurable depth, and a result-only return contract ("subagent output, no authority from you," scanned for injected instructions). OpenCode documents no report or concurrency contract at all. That contract arguably matters more here: OpenCode's whole story is that it runs on anything, from frontier APIs to budget models to self-hosted clusters, and the further you get from unlimited capacity, the more this hurts.
Not asking to reverse #63413. Background by default is fine as the default. What's missing is a contract for agent trees. Any one of these would unblock us:
- A per-agent or per-dispatch report mode (always | final | none) enforced at the report gate. Parentless sessions already skip delivery, so the machinery exists; there's just no supported way to ask for it.
- A vetoable pre-delivery hook, per Plugin hook to defer or suppress intermediate subagent failure notifications #57157, so plugins can drop or defer reports before the parent wakes.
- Minimum viable: ctx.session.messages(sessionID) on the plugin session API, so foreground-style delegation can be built on the parentless path without workaround hacks.
Reacted by GigAnon, Mark Erikson and dudzcom
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|