Skip to content

[FEATURE]: Always-background subagents (2.3.0): please keep a way to run a subagent call as a blocking call #64096

Backlog

Description

@GigAnon

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Always-background subagents (2.3.0): please keep a way to run a subagent call as a blocking call

Summary

Since 2.3.0 every subagent call returns at once with a sessionID, the child runs in the background, and the parent is woken with a <subagent> message each time the child goes idle. The background input is gone and there is no config key, agent option or flag to get the previous blocking behaviour back.

On a hosted, highly parallel setup this is a reasonable default. On a small local setup (one model, one parallel execution slot, a limited prompt cache) it makes the parent <-> child hand-over expensive, and the only way to avoid the cost is a prompt instruction that models follow unreliably. We ask for an opt-in way to run a subagent call as a blocking call, decided by configuration and not by the model.

Version and change

Why this matters on a limited local setup

Setup: local llama.cpp server, one parallel slot, a prompt cache that holds roughly one large session, a 27B model at about 15-19 tok/s, agents with 60-150k-token contexts (an orchestrator that dispatches implementer / reviewer subagents, one after the other).

With a blocking call the sequence is simple: the parent's tool call is open, the child is the only user of the model, the parent resumes once, with the result.

With always-background calls the sequence becomes parent turn -> child starts -> parent (woken or still running) -> child resumes -> parent woken again. With one slot, each switch between the two sessions evicts the other one's cached prompt. A cache miss on a 100k-token context costs minutes of prompt processing before the first token (we have seen up to about 10 minutes on our hardware). Two or three extra switches per task are enough to dominate the wall time of the whole run, and a switch can happen for no useful reason (see below).

Waiting by prompt is only a soft constraint

The tool description tells the model to keep working on non-overlapping work, or to tell the user what it launched and end its response, and not to sleep, poll or check on the child. We can add "after dispatching, do nothing until the report arrives" to our agent prompts, but:

  • Models are often poor at obeying "do nothing". A model does not count its own reasoning as doing anything, so it keeps thinking, calls a tool "just to check", or answers the question with what it already has. agents: subagent "work in background" pattern leads to hallucinated answers when no independent work exists #63785 reports exactly this on a hosted model: the parent answers immediately, with invented files and code, instead of waiting for the subagent it just launched.
  • There is no blocking wait primitive to point the model to. As far as we can see, subagent.ts in dev defines a single tool, and the only way to wait is to end the turn. An agent that does not end its turn has only polling (a sleep in the shell, a follow-up call with the sessionID) and troubleshooting left, and both consume the one slot the child needs. After a few turns of waiting a parent may decide that the child "may be stuck" and start investigating, which starves the child and makes the guess come true. (Not yet measured on 2.3.0 in our setup; the same pattern, a parent calling the model while a child was running, killed a live run on an earlier version.)
  • Ending the turn is not free either: the next parent turn starts when the child reports, and it reports on each idle, not only when it is done (a child's report also says when its own background work is still running).

Waking the parent costs tokens and context, not only time

#63894 (open) shows the other half: every child idle writes a <subagent> message into the parent and starts a parent turn. A commenter running a long orchestrator session reports that repeated notifications with full messages inflate the parent's context and force extra responses, and asks for the behaviour to be optional or overridable. For a local model the consequences are predictable: tokens spent on "still running" chatter, context saturation with useless content, an earlier compaction, and more risk of the hallucinated answers described in #63785.

"Wait until the subagent has finished" is a trivial condition for the harness to check. It should not depend on a model reading a status message and deciding to do nothing.

Request

Any one of these would solve it for us (in order of preference):

  1. A way to run a subagent call as a blocking call: an optional input on the tool (the former background input, default unchanged), or an agent-level / config-level setting (for example in opencode.json, per agent or global), so that the operator decides and not the model.
  2. A blocking wait that the harness implements (the parent's tool call stays open until the child is idle, no model tokens while waiting), with no required model-chosen timeout.
  3. At least: a setting that lets the parent receive one report when the child is finished, and not one per idle.

We do not ask to remove background subagents, only that the default can be overridden by configuration.

Environment

  • OpenCode 2.3.0, local llama.cpp provider, one parallel slot, limited prompt cache.
  • Agents are orchestrated unattended for hours; the parent holds a large context and dispatches subagents sequentially.
image

Activity

  1. opencodejr commented on Nov 15, 2026

    @opencodejr
    Contributor

    Thanks for the detailed write-up, @GigAnon. The numbers on prompt-cache eviction with a single llama.cpp slot are useful.

    I think this is a duplicate of #64073, which asks to bring back a choice between foreground (blocking) and background subagent execution after #63382 made subagents background-only and removed the tool's background option. In the current code, the subagent tool tells the model that subagents always run in the background, that the call returns immediately with a sessionID, and that a <subagent> message arrives each time the child goes idle. That matches what you describe, so this is a request to change the design, not a bug.

    Possible duplicates and related issues, ordered by likelihood:

    I'm closing this issue now as a duplicate of #64073. Please add your details there, especially the two points that issue doesn't cover yet: the operator, not the model, should decide (a config or per-agent setting), and the single-slot local setup where every switch between parent and child evicts the prompt cache. If you think this isn't a duplicate, reply here and the issue will reopen.

  2. added
    area/core
    type/feature
    version/v2
    on Nov 15, 2026
  3. GigAnon commented on Nov 15, 2026

    @GigAnon
    Author

    Most likely a duplicate of #64073 (created 2h ago, opened simultaneously).
    I wish to reiterate the point of @wangzheruoyun that, while we both put this under 'features', really, it is a breaking change. Expect many more tickets being opened in the following days for the exact same reason.

  4. wangzheruoyun commented on Nov 15, 2026

    @wangzheruoyun

    Most likely a duplicate of #64073 (created 2h ago, opened simultaneously). I wish to reiterate the point of @wangzheruoyun that, while we both put this under 'features', really, it is a breaking change. Expect many more tickets being opened in the following days for the exact same reason.

    Now because of this terrible improvement, I can't figure out what the main proxy is actually doing at all. It just keeps doing meaningless checks over and over again before writing a tiny summary, or it just simply repeats everything

  5. gugglegum commented on Nov 16, 2026

    @gugglegum

    Why did you do this? What problem were you trying to solve? Everything was working fine before! Now I’ll have to downgrade to version 2.2.7. I use OpenCode with a self-hosted, quantized Qwen3.8-Flash IQ3_S model, running on Strata. My AI server’s capabilities don’t allow for more than one slot. If I try to use two slots, the speed drops by a factor of 2.4 for a single thread, and by a factor of 1.8 when using two threads (combined). In practical terms, there’s no point in allowing two slots—two requests will actually be completed faster if processed sequentially, one after the other. That’s why I stick to one slot; my server can only handle one request at a time. If I launch a sub-agent in the background, it ends up waiting for the main process to finish, while the main process, in turn, waits for the sub-agent to complete.

  6. GigAnon commented on Nov 16, 2026

    @GigAnon
    Author
    image It was predictable, now seen on the field - after a few rounds of waiting, the main agent will ABSOLUTELY start going astray and run troubleshooting. Also seen on the field: agents not following the 'soft steering' directives, and deciding that "loading a skill" wasn't actually anything. Cue 10 mins of 3 (or 4) sessions trashing one another on a 2-sessions setup (and 'only 10 mins' was sheer luck - there was no cache eviction or compaction).
  7. opencodejr commented on Nov 16, 2026

    @opencodejr
    Contributor

    Thanks for following up with what you saw in practice, @GigAnon. A parent that starts troubleshooting after a few rounds of waiting, and its sessions then competing for a two-session setup, is exactly the cost your original write-up predicted.

    In 2.3.0 the only thing that keeps the parent waiting is the subagent tool's description, which tells the model not to sleep, poll or check on the child. As your screenshot shows, models don't always follow that. This is the gap that #64073 asks to close by bringing back blocking subagent calls, so this issue stays a duplicate of it, as you also said.

    To help maintainers weigh it, please post this screenshot and the field report on #64073, together with the two points only your issue raised:

    • the operator, not the model, should decide (a config or per-agent setting);
    • with one slot, each switch between parent and child evicts the prompt cache.

    The flood of notices is tracked separately in #63894.

    I can't promise an outcome or a timeline. This issue will be closed again as a duplicate of #64073.

  8. wangzheruoyun commented on Nov 16, 2026

    @wangzheruoyun

    image It was predictable, now seen on the field - after a few rounds of waiting, the main agent will ABSOLUTELY start going astray and run troubleshooting. Also seen on the field: agents not following the 'soft steering' directives, 和 deciding that "loading a skill" wasn't actually anything. Cue 10 mins of 3 (or 4) sessions trashing one another on a 2-sessions setup (and 'only 10 mins' was sheer luck - there was no cache eviction or compaction).

    Hey bro, I just came across this amazing combo: the official Claude Code + https://github.com/ypyik0669/claude-web. It solves the hassle of setting up an account and has tons of great features too!

  9. GigAnon commented on Nov 16, 2026

    @GigAnon
    Author

    Hey bro, I just came across this amazing combo: the official Claude Code + https://github.com/ypyik0669/claude-web. It solves the hassle of setting up an account and has tons of great features too!

    If this breaks definitively, I would probably go the other way to Pi or equivalent. I've just finished setting up OpenChamber for remote access, I'll wait some more before throwing my whole setup away...

  10. opencodejr commented on Nov 17, 2026

    @opencodejr
    Contributor

    Thanks again, @GigAnon. Your field report on the parent going astray while it waits is useful. We waited to see whether anything new suggested this issue is different from #64073. It doesn't: both ask for a blocking or foreground way to run subagents that doesn't depend on the model choosing to wait. So I'm closing this one as a duplicate of #64073.

    Please add your screenshot and the single-slot prompt-cache details to #64073 if you haven't yet. The point that the operator, not the model, should decide is worth repeating there too. The flood of <subagent> notices in the parent is tracked in #63894. If something comes up that neither issue covers, please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/corepending closetriagingtype/featureversion/v2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions