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 — [FEATURE]: add a built-in wait_for_subagents tool · Issue #58402 · anomalyco/opencode

[FEATURE]: add a built-in wait_for_subagents tool #58402

New issue
Copy link
New issue
Copy link
Open
Open
[FEATURE]: add a built-in wait_for_subagents tool#58402
Copy link

Description

@Evan-Du-037
Evan-Du-037
opened on Oct 23, 2026
Issue body actions

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

I'd like to bring my wait_for_subagents plugin into OpenCode as a built-in tool. This follows up on the discussion in #47105 and the waiting problem reported in #41172, which was closed as stale.

I've had agents start a background subagent, do some work themselves, then start repeating the delegated work because the result hadn't arrived yet. The missing step is a way for the parent to say: "I'm done with my part; wait for these subagents before I continue."

The tool would take session IDs from native background subagent calls and an optional timeout. The parent could keep working after launching the subagents and call wait_for_subagents when it needs their results. The call would wait until the selected completion notifications are queued or already in context, or until the timeout expires. A timeout would report what's still pending without cancelling the children.

Results would still arrive through OpenCode's native notifications. The tool wouldn't inject another copy of the results or start a second parent response.

Since OpenCode already provides background subagents, I think waiting for them should be available out of the box too. The plugin was tested on 2.0.26 and 2.0.27; I'd recheck it against current dev as part of the implementation.

Would you be open to adding this? I'm happy to put together the PR once the approach is approved.

Activity

  1. opencode-agent commented on Oct 23, 2026

    @opencode-agent
    opencode-agentBot
    on Oct 23, 2026 – with OpenCode Agent
    Contributor
    More actions

    Thanks for the detailed proposal, @Evan-Du-037! To restate it: you'd like a built-in wait_for_subagents tool. A parent agent could keep working after starting background subagents, then wait for specific ones by session ID, with an optional timeout. Results would still arrive through the normal completion notifications, and a timeout wouldn't cancel the children. Maintainers will consider whether to add this and how it should work. Please wait for their feedback before opening a PR.

    In the meantime, your plugin is a working option for anyone who needs this now: https://github.com/Evan-Du-037/opencode-wait-for-subagents

    Related issues:

    • [FEATURE]: add task-parallel tool to fan out independent subtasks concurrently #47105: proposed task-parallel tool that starts several subtasks at once; it describes the same "the model forgets to wait and duplicates work" problem
    • [FEATURE]: OpenCode v2 waiting for subagents, the subagent model #41172: earlier report of the parent not waiting for subagents (closed as stale)
    • [BUG] V2: subagent with pending background work (shell commands or subagents, background: true) marked completed early — results never collected #48826: subagents with pending background work being marked complete early (fix proposed in fix(core): wait for background jobs before reporting subagent result #57418)
    • Proposal: background subagents, monitors, cron, worktree isolation #49842: broader proposal for background subagents and monitors
  2. everest-an commented on Oct 23, 2026

    @everest-an
    everest-an
    on Oct 23, 2026
    More actions

    +1 — this covers the "parent keeps working, then waits" half of the problem.

    The related task-parallel request in #47105 covers the other half: fan out 2–5 independent subtasks at once, wait for all of them, and return one combined summary. That implementation PR (#47107) was auto-closed by the stale-PR bot, and its branch predates the packages/core/src/tool/plugin/ restructure, so it needs a port rather than a rebase.

    If maintainers are open to both, I am happy to port task-parallel to the current architecture and open a fresh PR referencing #47105. Either way, a built-in wait_for_subagents is a clear win for the duplicate-work failure mode.

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

    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.