fix: repair Task tool (subagent) rendering (#465)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-01-04 21:46:52 -08:00
committed by GitHub
parent e424c6ce0c
commit 633d52ead9
5 changed files with 411 additions and 13 deletions

View File

@@ -79,15 +79,18 @@ export const ToolCallMessage = memo(
const rawName = line.name ?? "?";
const argsText = line.argsText ?? "...";
// Task tool - handled by SubagentGroupDisplay, don't render here
// Exception: Cancelled/rejected Task tools should be rendered inline
// since they won't appear in SubagentGroupDisplay
// Task tool rendering decision:
// - Cancelled/rejected: render as error tool call (won't appear in SubagentGroupDisplay)
// - Finished with success: render as normal tool call (for backfilled tools without subagent data)
// - In progress: don't render here (SubagentGroupDisplay handles running subagents,
// and liveItems handles pending approvals via InlineGenericApproval)
if (isTaskTool(rawName)) {
const isCancelledOrRejected =
line.phase === "finished" && line.resultOk === false;
if (!isCancelledOrRejected) {
const isFinished = line.phase === "finished";
if (!isFinished) {
// Not finished - SubagentGroupDisplay or approval UI handles this
return null;
}
// Finished Task tools render here (both success and error)
}
// Apply tool name remapping