Skip to content

fix(tui): show background subagent failures in V2 #35063

Closed

Description

@kitlangton

@kitlangton

Problem

In the V2 TUI, a backgrounded subagent failure is not reliably shown as a visible parent-session transcript update.

Current flow:

  • packages/core/src/tool/subagent.ts waits for the child job via runtime.job.wait(...).
  • On failure, it calls injectCompletion(...) with state: "error", which publishes a synthetic parent-session message through runtime.session.synthetic(...).
  • session.synthetic publishes session.next.synthetic and resumes the parent session.
  • packages/tui/src/context/data.tsx stores the synthetic message.
  • packages/tui/src/routes/session/rows.ts only appends/renders synthetic rows when event.data.description?.trim() is present.
  • The subagent completion injection sets text, but does not set description, so the explicit failure notice is hidden from the visible transcript.

The notification plugin may still produce attention for child-session errors, and the resumed parent model may later generate visible text, but the direct "background subagent failed" notice is not guaranteed to appear in the TUI.

Expected

When a backgrounded subagent fails, the parent session TUI should visibly update with a clear failure/completion notice, without relying on a subsequent model turn.

Possible Fix

Either:

  • include a non-empty description when SubagentTool.injectCompletion(...) emits the synthetic completion/failure message, or
  • adjust the TUI synthetic-row filtering/rendering so these subagent completion messages are intentionally visible.

Notes

This is V2-specific. V1 has related background task injection behavior, but this issue is for the current V2 TUI path.

Activity

  1. kitlangton commented on Jul 29, 2026

    @kitlangton
    ContributorAuthor

    Fixed by #36530 (5414697bd1). Background subagent synthetic messages now include description, so completion and failure notices pass the TUI row visibility filter.

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

    2.0bugSomething isn't workingtui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions