Skip to content

TUI subagent history should render nickname/role instead of raw thread ids #24581

@iqdoctor

Description

@iqdoctor

Summary

Subagent tool-call history can show raw thread IDs instead of the human-readable subagent nickname/role, even though the /agents picker already knows the labels.

Observed behavior

In the transcript history, newly spawned/waited subagents were rendered as UUIDs:

• Spawned 019e641a-860b-7c71-96bb-d4f3a3ba88f1 (gpt-5.5 high)
  └ CODE REVIEW TASK

• Spawned 019e641a-a268-7ba2-a9ef-c9ea813676b0 (gpt-5.5 high)
  └ ARCHITECTURE / DEVIL'S-ADVOCATE REVIEW TASK

• Waiting for 2 agents
  └ 019e641a-860b-7c71-96bb-d4f3a3ba88f1
    019e641a-a268-7ba2-a9ef-c9ea813676b0

But the /agents picker showed the same threads with readable labels:

6. • Hume [code-reviewer]      019e641a-860b-7c71-96bb-d4f3a3ba88f1
7. • Hilbert [architect]       019e641a-a268-7ba2-a9ef-c9ea813676b0

Why this is a problem

The raw UUIDs make multi-agent transcripts hard to read and audit. The user-visible history should use the same label contract as the agent picker when nickname/role metadata is available.

Root-cause hypothesis

The lower-level collab events already carry metadata such as new_agent_nickname, new_agent_role, receiver_agents, and agent_statuses, but the app-server ThreadItem::CollabAgentToolCall.agents_states shape does not preserve nickname/role metadata. The TUI then caches a receiver thread with empty metadata before rendering the tool-call history, so agent_label(...) falls back to the raw thread id.

Suggested fix outline

  • Preserve optional agent_nickname / agent_role on CollabAgentState.
  • Populate it from spawn-end, wait-begin, and wait-end collab events.
  • Let the TUI cache/upgrade receiver metadata from metadata-bearing collab notifications before rendering live and replayed history.
  • Keep UUID as fallback only when no metadata exists.

I have a candidate branch/PR ready for discussion with the implementation details and a focused diff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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