Skip to content

feat(tui): live status + labeled spinner for delegation (#3101)#3115

Open
aheritier wants to merge 3 commits into
mainfrom
feat/tui-delegation-spinner-readability
Open

feat(tui): live status + labeled spinner for delegation (#3101)#3115
aheritier wants to merge 3 commits into
mainfrom
feat/tui-delegation-spinner-readability

Conversation

@aheritier

@aheritier aheritier commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Makes a single transfer_task delegation legible at a glance. Two focused, presentation-only changes:

  1. Status-aware delegation card. The transfer_task card hard-coded a green , so an in-flight delegation looked finished while the sub-agent was still running. The leading glyph is now driven by ToolStatus: an animated spinner while Running/Pending, on completion, on error. The icon stays a single fixed-width glyph (no elapsed-time suffix) so the wrapped task-text indent doesn't drift across statuses.
  2. Labeled "parent → child" pending spinner. While the parent waited on a sub-agent, the pending spinner showed an anonymous whimsical word with no hint of who was working. For delegated streams (depth ≥ 2) it now reads root → helper in the child's accent color, via a new types.SpinnerLabeled. An agentStack is tracked in lockstep with streamDepth. The normal top-level turn keeps the playful spinner.

Screenshots

While root waits on helper: the card animates a spinner and the pending line reads root → helper. (The sidebar root ▸ helper breadcrumb is added in #3102 — the demo was recorded on the full stack.)

phase1-labeled-spinner

Tests

  • pkg/tui/components/tool/transfertask — renderer asserts the spinner/✓/✗ glyph per ToolStatus + a fixed-icon-width invariant.
  • pkg/tui/components/message — labeled spinner renders the parent → child text and stays spinner-driven (animated, uncached); a bare spinner is unchanged.
  • pkg/tui/page/chatpendingSpinnerContext depth logic (0/1/2/3).

task build / task lint clean; touched-package tests pass. (Repo-wide, the only failure is the pre-existing, unrelated pkg/teamloader/TestLoadExamples, a DMR model-pull 416 with no pkg/tui dependency.)

Stack

Base of the delegation-readability stack (tracking #3104): #3101#3102#3103. Pure UI/UX; no config/schema changes.

Refs #3101


This is part 2 of 2 in a stack made with GitButler:

docker-agent

This comment was marked as outdated.

@aheritier aheritier marked this pull request as draft June 15, 2026 04:59
@aheritier aheritier added area/tui For features/issues/fixes related to the TUI kind/feat PR adds a new feature (maps to feat: commit prefix) labels Jun 15, 2026
@aheritier aheritier self-assigned this Jun 15, 2026
@aheritier aheritier added the status/in-progress For stuff that's being worked on label Jun 15, 2026
@aheritier aheritier added area/agent For work that has to do with the general agent loop/agentic features of the app and removed status/in-progress For stuff that's being worked on labels Jun 15, 2026
@aheritier aheritier marked this pull request as ready for review June 15, 2026 11:33
docker-agent

This comment was marked as outdated.

@aheritier aheritier force-pushed the feat/tui-delegation-spinner-readability branch from cce5185 to e581cc1 Compare June 15, 2026 12:12
@aheritier

Copy link
Copy Markdown
Contributor Author

/review

The transfer_task card hardcoded ✓, so an in-flight delegation looked
finished while the sub-agent was still running. Drive the leading glyph
from ToolStatus instead: animate the spinner while Running/Pending, show
✓ on completion and ✗ on error.

Keep the icon a single fixed-width glyph (no elapsed-time suffix) so the
wrapped task-text indent stays stable across statuses.

Refs #3101
While the root agent waited on a sub-agent, the pending spinner showed an
anonymous whimsical word with no hint of who was working. Track an
agentStack in lockstep with streamDepth (pushed on StreamStarted, popped
on StreamStopped, reset alongside streamDepth on cancel/submit) and, for
delegated streams only (depth ≥ 2), render the spinner as an animated
glyph plus "parent → child" in the child's accent color via a new
types.SpinnerLabeled. The normal top-level turn keeps the playful spinner.

messages.AddAssistantMessage now takes (sender, label) to carry this
context through to the rendered spinner.

Refs #3101
@aheritier aheritier force-pushed the feat/tui-delegation-spinner-readability branch from a952e37 to 8ed8de7 Compare June 15, 2026 13:18
@docker-agent

Copy link
Copy Markdown

PR Review Failed — The review agent encountered an error and could not complete the review. View logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agent For work that has to do with the general agent loop/agentic features of the app area/tui For features/issues/fixes related to the TUI kind/feat PR adds a new feature (maps to feat: commit prefix)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants