Open a Task step's subagent trajectory from the chat - #2
Draft
Weili-0234 wants to merge 4 commits into
Draft
Conversation
A Task/Agent tool call rendered as an ordinary tool box: the
subagent's transcript existed on the server but nothing in the chat
led to it.
The server now attaches tool.subagent = {session_id, agent_type,
title} to steps it matched to a sidechain session; the tool card shows
a 'View <type> trajectory' button for those, opening a sheet that
reads the child transcript through the conversation endpoint's
session parameter and re-reads every 2.5s while open, so a
still-running subagent streams in. The sheet reuses the feed's own
rows, read-only: sidechain questions were the subagent's to answer,
so they render as captions rather than live question cards.
Which subagents existed, which were working, and where to read their trajectories was invisible outside the Chat tab's tool cards. The selected task's sidebar row now grows a collapsible Subagents list fed by the session poll (the conversation payload already carries the children): a live status dot each — pulsing while the transcript is growing, a check once it stops, red on error — plus an amber envelope counting the main agent's sends still queued for a busy child. Clicking a row replaces the detail pane with the subagent's trajectory rendered like the main chat (markdown turns, tool cards with arguments and results, the inputs the main agent sent), with a back button; the Task step's button keeps its in-context sheet, now presented from the task pane so it opens from any tab. Queued sends render at the feed's end in amber, so what the subagent has not yet seen reads as pending rather than lost.
The sidebar's blue dot covered thinking, mid-tool, and idly waiting between monitor events alike. The server's activity field tells them apart now: a solid pulsing dot with a 'thinking' / 'running Bash' label while the agent is doing something, a hollow accent ring with 'waiting' when its turn ended and it sits ready for the next event. The header splits its count the same way (working vs ready), and the trajectory chip spells the activity out.
Mail from another agent and background-task notifications land in the user turn, so both wore the human's indigo bubble — a monitor snapshot read as something you typed. The server now labels them (origin agent with the sender and the unwrapped body; origin system with the notification's own summary), and the chat renders each honestly: an incoming attention-green card naming its sender, and a quiet folded event line with the payload behind a click. Applies to the main chat and subagent trajectories alike.
Weili-0234
marked this pull request as draft
August 17, 2026 00:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When Claude Code spawns a subagent (the Task/Agent tool), its trajectory is a separate transcript the chat never linked to. With the matching Loom server change (
task-subagent-linkson the Loom repo), the conversation payload now attachestool.subagent = {session_id, agent_type, title}to steps the server matched to a sidechain session. This PR renders that:ConversationToolgains an optionalsubagentlink (absent field on older servers decodes tonil, so the UI degrades to today's behavior).LoomAPI.conversationgains thesessionquery parameter the server already supports.The sheet is read-only: sidechain questions were the subagent's to answer, so they render as captions, not live question cards.
Testing
swift buildclean.toolUseIdandtoolUseResult.agentIdboth resolve); end-to-end UI pass pending the server deploy.