fix(frontend): filter task tool calls when rendering SubtaskCard (#1242)

Only tool calls with name === "task" should be rendered as SubtaskCard.
Previously all tool_calls were mapped to IDs, causing SubtaskCard to
render for non-task tool calls whose IDs were never registered in the
subtask context, resulting in a TypeError on task.status.

Signed-off-by: Gao Mingfei <g199209@gmail.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
This commit is contained in:
Gao Mingfei
2026-03-24 09:44:36 +08:00
committed by GitHub
parent b40b05f623
commit 0431a67b68

View File

@@ -168,9 +168,9 @@ export function MessageList({
{t.subtasks.executing(tasks.size)}
</div>,
);
const taskIds = message.tool_calls?.map(
(toolCall) => toolCall.id,
);
const taskIds = message.tool_calls
?.filter((toolCall) => toolCall.name === "task")
.map((toolCall) => toolCall.id);
for (const taskId of taskIds ?? []) {
results.push(
<SubtaskCard