Skip to content

TUI: make a single delegation unambiguous (transfer_task) #3101

@aheritier

Description

@aheritier

Part of #3104

While root waits on a delegated sub-agent, the user can't tell who is working or that the delegation is still in progress. The waiting spinner is anonymous and the transfer_task card always shows a green ✓.

Proposed changes

  1. Status-aware transfer_task card. In pkg/tui/components/tool/transfertask/transfertask.go, pick the icon from msg.ToolStatus (pending/running → spinner or ToolPendingIcon; completed → ToolCompletedIcon ✓; error → ToolErrorIcon) instead of the hardcoded ✓. The Renderer already receives the message and a spinner.Spinner, so a running delegation can animate. Mirror the status branching already used in pkg/tui/components/toolcommon/common.go.
  2. Name the waiting state. Replace the anonymous pending spinner with a labeled one for delegations, e.g. ⟳ root → <child> (delegating…). Add a label-carrying spinner constructor in pkg/tui/types/types.go, render it in pkg/tui/components/message/message.go (case types.MessageTypeSpinner), and populate it from handleStreamStarted / setPendingResponse (pkg/tui/page/chat/runtime_events.go, chat.go) using the current/previous agent names and streamDepth.

Acceptance criteria

  • An in-progress transfer_task shows a non-✓ (animated/pending) indicator; completed shows ✓; error shows the error icon.
  • The waiting spinner names the child agent (ideally parent → child).
  • The labeled spinner stays animated/uncached (messageModel.isSpinnerDriven() still returns true for it).

Validation

  • task build && task test && task lint green.
  • New render test for the transfertask renderer per ToolStatus.
  • New message test that the labeled spinner renders the parent→child text and remains spinner-driven.

Metadata

Metadata

Assignees

Labels

area/tuiFor features/issues/fixes related to the TUIkind/featPR adds a new feature (maps to feat: commit prefix)
No fields configured for Enhancement.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions