fix: grouped tool calls lose all their labels when one call has no label (#33932)

With Tool Call Labels on, several tool calls in a row are shown as one collapsible group, and its header listed the calls' labels only when every call had one. If the model left out the label for even one call, the header dropped all of them and showed the generic "Explored" summary instead, both while the calls were running and after they finished. The header now shows the labels that exist and the tool name for a call without one, the same as each call already shows when the group is expanded.

Fixes #33925
This commit is contained in:
Classic298 authored and GitHub committed 2026-11-08 21:22:36 +09:00
1 parent 6d3123b5b4
commit dedf9e65cf
1 file changed
+5 -3
@@ -193,14 +193,16 @@
? token.attributes?.display_label
: token.attributes?.running_label
);
$: toolNames = tokens
.filter((token) => token.attributes?.type === 'tool_calls')
.map((token) => token.attributes?.name ?? 'tool');
$: groupLabel =
!hasRejected &&
!hasError &&
pendingToolTokens.length === 0 &&
codeInterpreterCount === 0 &&
toolLabels.length &&
toolLabels.every(Boolean)
? toolLabels.join(', ')
toolLabels.some(Boolean)
? toolLabels.map((label, index) => label || toolNames[index]).join(', ')
: '';
</script>