fix(agents): render subagent dispatch rows regardless of SDK tool name#38
Merged
Conversation
The Agent SDK's CLI-parity built-in subagents (shipped in #36) can emit the dispatch tool as either `Task` or `Agent`. The inline chat renderer hard-coded `tool-Task`, so `tool-Agent` dispatches fell through to the generic fallback that shows only the bare tool name with no description, while the Tasks sidebar rendered correctly because it reads input by shape. Result: the top row looked empty ("Agent" with no subtitle) even though the subagent was running and nested child tools rendered fine. - Add `isSubagentDispatchType()` helper; use it at the primary and orphan-group dispatch sites so `AgentTaskTool` handles both names. - Harden the catch-all fallback to show `<ToolName> <summary>` via a shared `summarizeToolInput()` (extracted from tasks-widget so the two surfaces stay in sync). - Bump `@anthropic-ai/claude-agent-sdk` 0.2.118 → 0.2.119 and the bundled CLI binary 2.1.118 → 2.1.119 (released in lockstep). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
part.type === "tool-Task", but the CLI-parity built-in subagents shipped in feat(agents): ship CLI-parity built-in subagents to embedded SDK #36 can emit the dispatch tool astool-Agent— so those runs fell through to a catch-all that shows only the bare tool name.isSubagentDispatchType()covers bothtool-Taskandtool-Agent) at all three call sites inassistant-message-item.tsx, soAgentTaskToolconsistently produces "Running Subagent —<description>" with nested child tools.<ToolName> <summary>via a sharedsummarizeToolInput()helper — extracted fromtasks-widget.tsxso the two surfaces stay in sync forever.@anthropic-ai/claude-agent-sdk0.2.118 → 0.2.119and the bundled CLI binary2.1.118 → 2.1.119(released in lockstep).Test plan
bun install && bun run claude:download— pulls SDK 0.2.119 and binary 2.1.119.bun run dev— launch the Electron app.<description>" both while running and after completion, not just "Agent".<ToolName> <summary>instead of a bare name.🤖 Generated with Claude Code