Skip to content

Stream background subagent progress into /tasks (output is empty until completion) #292

@persovt2

Description

@persovt2

What feature would you like to see?

Problem

Background subagents launched with Agent(run_in_background=true) show up in
/tasks, but their Output / Preview pane stays empty until the subagent
finishes
— only the final summary appears at the end.

Background bash tasks (Bash(run_in_background=true)) stream their stdout
live in the same UI, so the inconsistency is surprising: there's no way to see
what a long-running background subagent is actually doing while it runs.

Cause

Agent tasks are Promise-based, so BackgroundProcessManager has no live
proc.stdout to capture (registerAgentTask uses a dummy process whose
stdout handlers are no-ops). Only the final result is appended on completion.

Proposed behavior

Tap the child agent's event stream (assistant text deltas + tool-call
boundaries), format it into compact log text, and feed it into the task's
output.log — so /tasks shows live progress for background subagents,
matching how background bash tasks already behave.

  • Foreground subagents unaffected (they stream inline via RPC already).
  • Subscription released on every terminal path (completed/failed/killed/timeout).
  • Tool results are not dumped (only a one-line status) to keep the log compact.

Additional information

I have a working implementation with unit + integration tests and can open a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    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