GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [feat] True Async/Background Sub-Agent Delegation · Issue #5887 · anomalyco/opencode

[feat] True Async/Background Sub-Agent Delegation #5887

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
[feat] True Async/Background Sub-Agent Delegation#5887
Copy link
Assignees
thdxr

Description

@ramarivera
ramarivera
opened on Dec 21, 2025
Issue body actions

Problem

Currently, sub-agent delegation in opencode appears to be synchronous or modal. When a primary agent delegates a task to a sub-agent, the interface typically switches context to that sub-agent, blocking the primary flow or requiring manual navigation. There is no native "fire-and-forget" mechanism where a sub-agent runs fully in the background while the main agent continues to be interactive, accepting new commands or performing other work simultaneously.

Proposed Solution

Implement a true asynchronous delegation flow:

  1. Delegation: The Main Agent delegates a task (e.g., "Run the integration tests and fix any timeouts").
  2. Async Execution: The Sub-Agent spins up in a dedicated background session.
  3. Non-Blocking: The Main Agent immediately regains control/interactive state, allowing the user to continue working on other tasks.
  4. Completion Notification: The Main Agent receives a signal, message, or callback when the Sub-Agent completes, allowing it to surface the results or integrate the changes.

Related Issues & Community Interest

This feature aligns with high community interest in concurrency and background workflows:

  • Feature Request: Agent Session Tab Bar Navigation #5826 (Agent Session Tab Bar Navigation): Requests UI to manage "concurrent agent sessions" and an orchestrator pattern, highlighting the need to monitor parallel tasks.
  • Feature Request: Add Background Bash Execution (Like Claude Code’s Ctrl+b) #1970 (Background Bash Execution): Requests async execution for long-running bash tasks (similar to Ctrl+b), which is a foundational requirement for non-blocking sub-agent work.
  • [FEATURE]:Multiple AI models working concurrently with settings adjustable directly in TUI #4790: Requests fully autonomous systems working with multiple agents concurrently.
  • [FEATURE]: File locks / Vim-style locks for OpenCode locks #4278 (File locks): Proposes safety mechanisms (locking) specifically to handle the "multiple agents/tools in parallel" scenario.

Use Case

  • Orchestration: A main "Architect" agent delegates coding tasks to "Developer" sub-agents and a "QA" sub-agent simultaneously.
  • Efficiency: A user asks the agent to "fix the build" (delegated to sub-agent) and immediately asks "explain this other file" (main agent) without waiting for the build fix to finish.

EDIT: Ofc, AI generated issue, but I did do a search of the docs and similar issues before

Reacted by Koushik Sahu, Guilherme Bayer, Steffen, betaboon, Billy Editiano Saputra, Matt, Vlastimil Hudeček, Ji, Alexandre Amado de Castro, zero and 73 more
Reacted by Ted Robertson, Jensen, Ivan Vaigult, Jonathan Leaders, ratulsarna, Erik May, dayson, Daniel Richard Snell, bowber, samuel and 2 more
Reacted by James Meng, Erik May, bowber and Eric Ma

Activity

Next
  1. github-actions
    assigned
    thdxr
    on Dec 21, 2025
  2. github-actions commented on Dec 21, 2025

    @github-actions
    github-actionsBot
    on Dec 21, 2025 – with GitHub Actions
    Contributor
    More actions

    This issue might be related to or build upon existing work in the following areas:

    • [feat] Add "subagent" AI task delegation #1293: The foundational feature request for "subagent" AI task delegation, which this async delegation feature extends
    • Primary agent responds in subagent view; delegated subagent views become inaccessible #4422: Specific issues with subagent view context and delegation problems that would be addressed by proper async delegation architecture

    The issues you've already referenced (#5826, #1970, #4790, #4278) are excellent foundational work for this feature.

    Feel free to ignore if this issue has a specific scope different from those above.

  3. HelloGGX commented on Dec 21, 2025

    @HelloGGX
    HelloGGX
    on Dec 21, 2025
    Contributor
    More actions

    This looks like what Claude Code is doing.

    Reacted by Danila Poyarkov, Jensen, mrh1997, Guilherme Bayer, Steffen, Somshubra Majumdar, Nick Pape, Mike, Aleksandr Baryshnikov, Cateds and 5 more
  4. itse4elhaam commented on Jan 2, 2026

    @itse4elhaam
    itse4elhaam
    on Jan 2, 2026
    More actions

    +1 on this.

    Think this would be a big productivity boost.

    Reacted by Guilherme Bayer, Naufaldi, zero, Luka Finžgar, Cole Murray, gugaio, Shane Bishop, Mimo, alanspires, hollarob and 4 more
  5. kdcokenny commented on Jan 2, 2026

    @kdcokenny
    kdcokenny
    on Jan 2, 2026
    Contributor
    More actions

    +1 on this.

    Think this would be a big productivity boost.

    https://github.com/kdcokenny/opencode-background-agents
    i made this plugin that does this while we wait for an official solution, lmk what you think!

    Reacted by Zeno Jiricek, Mike Kelly, Gautham Chandra, Daniel Maricic, Volod, Cateds, FilJed, Whisillus and Nebojsa Koturovic
    Reacted by Zeno Jiricek, Daniel Maricic and marv
    Reacted by Ted Robertson
  6. airtonix commented on Jan 4, 2026

    @airtonix
    airtonix
    on Jan 4, 2026
    Contributor
    More actions

    If plugins can do this then there's no need to divert core effort on this .

    Reacted by Lopy, Guilherme Bayer, Maarten, Ji, Alexandre Amado de Castro, Muhammed Alkhudiry, Qio, Cole Murray, Spruce Bondera, Mike Kelly and 40 more
  7. mikekelly commented on Jan 17, 2026

    @mikekelly
    mikekelly
    on Jan 17, 2026
    More actions

    If plugins can do this then there's no need to divert core effort on this .

    Totally disagree. Async subagents should be a fundamental affordance of the harness. A lot of additional capability and UX can/will be developed around it.

    Reacted by Gareth Paul Jones (GPJ), Daniel Grigsby, Josh N., Guilherme Bayer, Gregory Leleytner, Ravil Bayramgalin, marv, Alberto Garcia Illera, Volod, Thomas Williamson and 12 more
    Reacted by Bala Bosch and Jonathan Leaders
  8. metka495 commented on Jan 20, 2026

    @metka495
    metka495
    on Jan 20, 2026
    More actions

    I'm also looking for this feature, looking forward to it!!!!

    Reacted by Gregory Leleytner and Shobhit
  9. RunFMe commented on Jan 29, 2026

    @RunFMe
    RunFMe
    on Jan 29, 2026
    More actions

    @kdcokenny hi! what do you think about supporting log-monitoring tasks in your plugin? stuff which requires agent to manually go to sleep like

    • looking after ML training run with wake ups every 5 minutes to check no errors are present or fix the source of errors and restart the trainig
    • look at service logs until it starts properly to go and run some other script

    It seems that all these tasks can be automated by writing special agents for such polling with specific prompts to instruct them to use "sleep" + turned off doom protection. Wdyt? would you accept such PR to your plugin and help develop it?

  10. ifrankwang commented on Feb 1, 2026

    @ifrankwang
    ifrankwang
    on Feb 1, 2026
    More actions

    Hi OpenCode team, I've analyzed the existing architecture and related issues:

    Architecture Alignment:

    • The current TaskTool (packages/opencode/src/tool/task.ts) already supports subagent delegation
    • GlobalBus and Instance Bus provide a native event notification system
    • Session management supports parent-child relationships via ACPSessionManager

    Why this proposal is better than the Oh-My-OpenCode approach:

    1. No new dependencies: Uses existing Bus system instead of introducing new delegate_task/background_output tools
    2. Native UI integration: Sub-agent progress can be displayed directly in the TUI without TMUX
    3. Event-driven design: Aligns with OpenCode's existing architecture patterns

    Implementation approach suggestion (rough idea):

    1. Extend TaskTool with run_in_background parameter
    2. Use Bus.publish() for task completion notifications
    3. Main agent subscribes to events and retrieves results via existing session APIs

    Please consider this feature suggestion, thanks!

    Reacted by Zhan Rongrui, Thomas Williamson and Dan Dowd
    Reacted by Alberto Garcia Illera, Oscar Serna, Dan Dowd, Alexandre Amado de Castro and FilJed
    Reacted by KapK and Dan Dowd
  11. PawelAdamczuk commented on Feb 2, 2026

    @PawelAdamczuk
    PawelAdamczuk
    on Feb 2, 2026
    More actions

    +1 I would love it too

  12. tomjw64 commented on Feb 12, 2026

    @tomjw64
    tomjw64
    on Feb 12, 2026
    More actions

    Opened #13261, which takes an approach very similar to the one suggested by @ifrankwang.

    Reacted by Frank Wang, Kevin Courbet and FilJed
  13. tomjw64 commented on Feb 17, 2026

    @tomjw64
    tomjw64
    on Feb 17, 2026
    More actions

    Created issue #13916 as a precursor to this work, otherwise, there would no ergonomic way to cancel or abort individual background subagents (or individual foreground subagents, for that matter).

  14. 2 remaining items

  15. allarac commented on May 2, 2026

    @allarac
    allarac
    on May 2, 2026
    More actions

    I do not fully understand what is going on with opencode honestly. Paid claude sonnet 4.6 can spawn multiple subagents while local llama-cpp is forcefully insisting on sequential subagent spawning. I am not sure ... does opencode support it or not?

  16. itse4elhaam commented on May 2, 2026

    @itse4elhaam
    itse4elhaam
    on May 2, 2026
    More actions

    I do not fully understand what is going on with opencode honestly. Paid claude sonnet 4.6 can spawn multiple subagents while local llama-cpp is forcefully insisting on sequential subagent spawning. I am not sure ... does opencode support it or not?

    To be honest, I don't appreciate the criticizing tone.

    We should be grateful for open source projects like these.

    You can use oh my openagent as an extension to get this and alot more.

    Reacted by Jamius Siam
  17. allarac commented on May 2, 2026

    @allarac
    allarac
    on May 2, 2026
    More actions

    @itse4elhaam Please stop getting personal when people are asking questions especially since you did not answer the question in any way or form. If english is not your first language and you see things online colored by the lenses of your personal background, then refrain from lecturing others. It's just inappropriate.

    If someone else could comment and answer the question, I'll be happy to see that.

  18. itse4elhaam commented on May 2, 2026

    @itse4elhaam
    itse4elhaam
    on May 2, 2026
    More actions

    @itse4elhaam Please stop getting personal when people are asking questions especially since you did not answer the question in any way or form. If english is not your first language and you see things online colored by the lenses of your personal background, then refrain from lecturing others. It's just inappropriate.

    If someone else could comment and answer the question, I'll be happy to see that.

    You just proved my point through your response.

    Reacted by allarac, Aristorias and Jamius Siam
  19. aristorias commented on May 2, 2026

    @aristorias
    aristorias
    on May 2, 2026
    More actions

    I do not fully understand what is going on with opencode honestly. Paid claude sonnet 4.6 can spawn multiple subagents while local llama-cpp is forcefully insisting on sequential subagent spawning. I am not sure ... does opencode support it or not?

    I’ve noticed it too and was looking for a solution for way too long.
    I’m not certain, but it likely comes down to how models invoke tools. When I tried debugging with Opus, models that support parallel sub-agents wrapped multiple tool calls inside <function_calls></function_calls> making it essentially a single call? Other models issued separate calls in one message (one per line), which then ran sequentially. I’m not sure if this can be changed via chat templates or other tweaks. I don’t use llama-cpp, but I assume it behaves similarly. Hope that helps.

    Reacted by allarac
  20. YoungJurry commented on May 6, 2026

    @YoungJurry
    YoungJurry
    on May 6, 2026
    More actions

    Another strong +1 for this feature from a plugin developer perspective.

    Use Case: Lightweight Async Doc Agent

    Our exact workflow:

    1. Main agent modifies src/modules/auth.ts
    2. Main agent wants to fire-and-forget a "doc-agent" to update README.md and API docs
    3. Main agent must not block — it immediately moves on to modify src/modules/payment.ts
    4. When doc-agent finishes, its output is piped back to main agent as a callback/message

    Why the Current Task Tool Doesn't Fit

    The current task tool is synchronous / blocking. After task() returns, either:

    • The sub-agent has fully completed (slow, main agent wastes time waiting)
    • Or the sub-agent is "detached" but the main agent receives only a session_id and loses the ability to get results back naturally

    Neither allows the main agent to continue its own work while the sub-agent runs.

    Community Workarounds (and Their Limits)

    Several plugins have tried to solve this, but all hit core limitations:

    Plugin Approach Blocker
    Pocket-Universe Implements subagent() + broadcast() messaging with synthetic message injection Depends on PR #9272 (session.before.idle hook) and #7725 (tool scoping for subagents), both currently unmerged
    oh-my-opencode Heavy framework with its own session orchestration Too heavy, includes LSP/AST/MCP — overkill for simple fire-and-forget
    opencode-ensemble Lead agent acts as coordinator only The lead itself does no work — different paradigm

    What Would Help Most

    We don't necessarily need opencode to build a full orchestration framework. What plugin developers need is a minimal core mechanism:

    1. A fire_and_forget flag on task (or spawn tool variant) — returns immediately with session_id
    2. Event-driven callback — when the sub-agent completes, emit a session event that can be intercepted by plugins (or injected as a synthetic message into the parent session)
    3. Sub-agent worktree isolation — so parallel agents don't stomp on each other's file changes

    PR #13261 by @tomjw64 already explores the background subagent direction. If that lands, plugins like Pocket-Universe could become largely stateless wrappers rather than needing fragile core patches.

    Thanks for considering this — it would unlock a whole category of parallel-agent workflows that today require heavy workarounds.

  21. kdcokenny commented on May 6, 2026

    @kdcokenny
    kdcokenny
    on May 6, 2026
    Contributor
    More actions

    Another strong +1 for this feature from a plugin developer perspective.

    Use Case: Lightweight Async Doc Agent

    Our exact workflow:

    1. Main agent modifies src/modules/auth.ts
    2. Main agent wants to fire-and-forget a "doc-agent" to update README.md and API docs
    3. Main agent must not block — it immediately moves on to modify src/modules/payment.ts
    4. When doc-agent finishes, its output is piped back to main agent as a callback/message

    Why the Current Task Tool Doesn't Fit

    The current task tool is synchronous / blocking. After task() returns, either:

    • The sub-agent has fully completed (slow, main agent wastes time waiting)
    • Or the sub-agent is "detached" but the main agent receives only a session_id and loses the ability to get results back naturally

    Neither allows the main agent to continue its own work while the sub-agent runs.

    Community Workarounds (and Their Limits)

    Several plugins have tried to solve this, but all hit core limitations:

    Plugin Approach Blocker
    Pocket-Universe Implements subagent() + broadcast() messaging with synthetic message injection Depends on PR #9272 (session.before.idle hook) and #7725 (tool scoping for subagents), both currently unmerged
    oh-my-opencode Heavy framework with its own session orchestration Too heavy, includes LSP/AST/MCP — overkill for simple fire-and-forget
    opencode-ensemble Lead agent acts as coordinator only The lead itself does no work — different paradigm

    What Would Help Most

    We don't necessarily need opencode to build a full orchestration framework. What plugin developers need is a minimal core mechanism:

    1. A fire_and_forget flag on task (or spawn tool variant) — returns immediately with session_id
    2. Event-driven callback — when the sub-agent completes, emit a session event that can be intercepted by plugins (or injected as a synthetic message into the parent session)
    3. Sub-agent worktree isolation — so parallel agents don't stomp on each other's file changes

    PR #13261 by @tomjw64 already explores the background subagent direction. If that lands, plugins like Pocket-Universe could become largely stateless wrappers rather than needing fragile core patches.

    Thanks for considering this — it would unlock a whole category of parallel-agent workflows that today require heavy workarounds.

    U can use https://github.com/kdcokenny/opencode-background-agents it runs in the background while you wait for this to maybe be implemented upstream

  22. epicwhale commented on May 9, 2026

    @epicwhale
    epicwhale
    on May 9, 2026
    More actions

    Eagerly awaiting this one! Without this, the gap between opencode and claude code is quite wide on subagent orchestration and running background tasks :(

  23. itse4elhaam commented on May 9, 2026

    @itse4elhaam
    itse4elhaam
    on May 9, 2026
    More actions

    Eagerly awaiting this one! Without this, the gap between opencode and claude code is quite wide on subagent orchestration and running background tasks :(

    Yeah would love this natively.

    Have you tried oh my openagent extension though?

    It's pretty smooth

  24. YoungJurry commented on May 9, 2026

    @YoungJurry
    YoungJurry
    on May 9, 2026
    More actions

    Eagerly awaiting this one! Without this, the gap between opencode and claude code is quite wide on subagent orchestration and running background tasks :(

    Yeah would love this natively.

    Have you tried oh my openagent extension though?

    It's pretty smooth

    I used omo for a not long period ,and i think some times ,it is not so very well
    you can see my some tests at https://github.com/smithyyang/omo-vs-opencode-benchmark

  25. rekram1-node
    marked [FEATURE]: Non-blocking background timer / async ping #31335 as a duplicate of this issue on Jun 8, 2026
  26. prassanna-ravishankar commented on Jun 21, 2026

    @prassanna-ravishankar
    prassanna-ravishankar
    on Jun 21, 2026
    More actions

    the modal/blocking delegation is the core thing, agreed. the parent shouldnt have to stop and babysit a child to completion.

    one external pattern that gives you this today: repowire (a cross-runtime agent mesh). a peer fires ask or notify to another peer and carries on, the child runs in its own session, and the result comes back as a deferred ack rather than blocking the caller. un-acked asks resurface on the next turn so nothing gets silently dropped.

    honest framing: repowire peers are separate sessions on a daemon, not in-process background subagents, so its not the exact native shape youre asking opencode for. but if youre blocked on fire-and-forget delegation right now its a way to get it, and it works across runtimes too.

  27. trek-e
    added a commit that references this issue on Jul 27, 2026

    fix(#2598): declare OpenCode subagent dispatch synchronous, not backg…

    a385347
  28. github-actions commented on Aug 20, 2026

    @github-actions
    github-actionsBot
    on Aug 20, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  29. github-actions
    closed this as not plannedon Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @thdxr
    thdxr

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.