From 3deb3ef4e0336ec0ec41e6abfc0bfc22e128743b Mon Sep 17 00:00:00 2001 From: Johannes du Plessis Date: Mon, 15 Jun 2026 10:53:28 -0700 Subject: [PATCH] fix: show subagent current status instead of full tool-call list (#1528) The subagent card listed every nested tool call, ballooning the card as the subagent ran. Show a single status line (current activity + step count) until a richer activity UI lands. Co-authored-by: open-swe[bot] --- .../agents/subagents/SubagentActivity.tsx | 53 ++++++++++--------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/ui/src/components/agents/subagents/SubagentActivity.tsx b/ui/src/components/agents/subagents/SubagentActivity.tsx index 286dcd9c..88e22e54 100644 --- a/ui/src/components/agents/subagents/SubagentActivity.tsx +++ b/ui/src/components/agents/subagents/SubagentActivity.tsx @@ -6,12 +6,16 @@ function humanizeToolName(name: string): string { } /** - * Live nested activity for a single subagent, read straight from the SDK's - * scoped `tools` projection (`useToolCalls(stream, { namespace })`). The - * namespace comes from `stream.subagents` (attached to the `task` chunk by + * Live status for a single subagent, read straight from the SDK's scoped + * `tools` projection (`useToolCalls(stream, { namespace })`). The namespace + * comes from `stream.subagents` (attached to the `task` chunk by * `streamMessagesToUi`), so this subscribes to exactly the subagent that the * parent card represents. * + * Hotfix: rather than listing every nested tool call (which balloons the card), + * this shows a single line with the subagent's current activity plus a running + * step count. A richer activity UI will replace this later. + * * Mounting opens a ref-counted subscription scoped to `namespace`; unmounting * closes it. Only mounted from {@link SubagentCard} when * `useIsInAgentThreadStream()` is true, so the `useStreamContext` read is @@ -21,30 +25,29 @@ export function SubagentActivity({ namespace }: { namespace: Array }) { const stream = useAgentThreadStream() const toolCalls = useToolCalls(stream, { namespace }) - if (toolCalls.length === 0) return null + const current = toolCalls[toolCalls.length - 1] + if (!current) return null + + const stepCount = toolCalls.length return ( -
- {toolCalls.map((toolCall, index) => { - const id = toolCall.id || toolCall.callId || `sub-tool-${index}` - return ( -
- {toolCall.status === "finished" ? ( - - ) : toolCall.status === "error" ? ( - - ) : ( - - )} - - {humanizeToolName(toolCall.name)} - -
- ) - })} +
+ {current.status === "finished" ? ( + + ) : current.status === "error" ? ( + + ) : ( + + )} + + {humanizeToolName(current.name)} + + + {stepCount} {stepCount === 1 ? "step" : "steps"} +
) }