Skip to content

TaskOutput dumps background subagent transcripts into the foreground TUI #104

Description

@7ongOrz

Environment

  • zcode-app-cli: 3.10.1-17
  • Runtime: 0.16.5
  • zcode-cli commit: eab7fb1
  • OS: Linux

Steps to reproduce

  1. Start two or more Agent tools with run_in_background: true.
  2. Have the coordinator agent wait for them using TaskOutput(block: true).
  3. Observe the foreground transcript after TaskOutput completes.
  4. Expand the TaskOutput block with Ctrl+O to make the problem more visible.

Expected behavior

Detailed background-agent transcripts, including their Bash and WebSearch tool activity, should remain in /tasks.

The foreground conversation should receive only a compact task status or final result notification.

Actual behavior

TaskOutput is rendered as an unknown generic tool.

Its result may contain an extensive background-agent transcript, which is then displayed directly in the foreground conversation as a preview and can be fully expanded with Ctrl+O. This makes the responses and tool activity from multiple subagents appear to be mixed into the main transcript.

In one real session, two TaskOutput calls returned approximately 15,702 and 18,924 characters respectively, including subagent transcripts and tool activity.

The subagents were stored as separate child sessions in the database, and their persisted tool-call IDs did not overlap. Therefore, this does not appear to be session transcript corruption or an actual merging of child sessions. It appears to be a foreground rendering or filtering issue.

Likely cause

TaskOutput is not registered in the canonical tool registry and does not have a dedicated renderer.

When a restored tool part contains result-display metadata, the TUI constructs:

{ output: part.output, display: part.resultDisplay }

The generic result renderer prioritizes output, causing the complete TaskOutput payload to be rendered instead of the compact display metadata.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions