Skip to content

[FEATURE]: parent agent should observe background subagent's real-time progress and streaming output #27828

@smithyyang

Description

@smithyyang

Feature Description

Allow the parent agent to observe a background subagent's real-time progress and streaming output while it is still running.

Current Behavior

With OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true, a parent agent can launch a background subagent via task(background=true, ...). But once launched, the subagent is a black box — the parent can only poll task_status(task_id="...") which returns the state (running, completed, cancelled) but no intermediate output or progress information.

The only way to interact with a running subagent is task(task_id="...", prompt=...), which resumes/resumes the session but interrupts the agent's current work (it stops what it was doing and responds to the new prompt).

Proposed Feature

Add a mechanism for the parent agent to stream or poll the subagent's real-time output without interrupting it. Options to consider:

  1. Stream endpoint: A way to subscribe to the subagent's tool call outputs and text generations as they happen (similar to tailing logs).
  2. Progress poll: task_status could include a snapshot of the last N tool outputs or the current step description, e.g. task_status(task_id="...", include_progress=true) returning {state: "running", last_output: "Searching the web for X...", tools_called: 3}.
  3. Shared scratchpad: An append-only buffer that the subagent writes to and the parent reads from, without mutual interruption.

Use Case

A parent agent launches multiple background subagents for parallel research tasks and wants to:

  • See which ones are making progress vs. stuck

  • Decide which results are ready early to start consolidating

  • Provide progress feedback to the user without waiting for all subagents to finish

  • I have searched existing issues and confirm this is not a duplicate.

Related

Builds on the background subagent delegation feature (PR #24174 / issue #21384).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions