Visitar URL original
agent: subagent (Task tool) returns prematurely in feature workflow · Issue #63764 · anomalyco/opencode · GitHub
Skip to content

agent: subagent (Task tool) returns prematurely in feature workflow #63764

Closed as not planned

Description

@onur-aslan

Summary

Subagent (Task tool) returns prematurely in feature workflow — main agent receives completion signal before subagent actually finishes, causing "build done" to be reported while implementation is still running.

Environment

  • opencode version: 2.0.32
  • OS: Windows_NT 10.0.19044 (win32 x64)
  • Terminal: Unavailable: terminal environment variables are not set
  • Shell: C:\WINDOWS\system32\cmd.exe
  • Install/channel: latest
  • Active plugins: None found in config

Reproduction

  1. Start a feature workflow using sdd-developer skill (or feature-tdd skill)
  2. Main agent spawns a subagent via Task tool for implementation (e.g., TDD implementation of a task)
  3. Main agent outputs: "agent bitince bildirim alıp devam edeceğim" (will wait for notification when agent finishes)
  4. Immediately after, main agent outputs: "build done" — indicating it believes the subagent completed
  5. But the subagent was still running (implementation not actually finished)

Expected Behavior

Main agent should wait for the subagent to actually complete (return its result) before proceeding to the next step (review, verification, or reporting "build done").

Actual Behavior

Main agent receives a premature completion signal from the Task tool invocation. The subagent continues running in the background but the main agent has already moved on, reporting "build done" and potentially starting the next phase (review/verification) on incomplete work.

Additional Context

  • Frequency: Every time (100% reproducible in feature workflow with sdd-developer)
  • Skills involved: sdd-developer (and likely feature-tdd which has similar subagent orchestration)
  • Workflow: Feature implementation → spawns Implementation Subagent → should wait for result → spawns Review Subagent → etc.
  • Impact: Broken feature implementations, incomplete code, false "done" reports, verification running on half-finished work
  • Suspected cause: Race condition in Task tool completion handling — the tool returns before the subagent process actually terminates
  • Workarounds tried: None — this is a core runtime issue

The user's exact description (Turkish): "agent bitince bildirim alıp devam edeceğim yazıyor sonrasında buişld done yazıyor" — meaning the agent says it will wait for notification when the subagent finishes, then immediately writes "build done".

Activity

  1. opencodejr commented on Nov 13, 2026

    @opencodejr

    Thanks for reporting this. Most of the report looks AI-generated, so I'd like a few details in your own words before we can tell which problem this is:

    1. While the implementation subagent was working, did it start a build, tests or another command in the background, or launch its own subagent? If you open the subagent's session, you should be able to see this.
    2. Did a <subagent ...> message actually appear in the main session before it said "build done"? If so, what did it contain (its state and the text)? A screenshot of the main session around that moment would help a lot.
    3. Which provider and model were the main agent and the subagent using?
    4. Can you send a short prompt or a minimal skill that triggers this, without the full sdd-developer skill?

    This matches a known problem: #48826. A subagent that starts its own background work is reported to the parent as completed with its interim reply while that work is still running, and its real final answer never reaches the parent. #48826 was closed when #63209 was merged, after the 2.2.7 release, so no release includes that change yet.

    Possible duplicates and related issues, ordered by likelihood:

    You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know when you're done.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions