feat(trace-workbench): show spawned-session links in chat tool blocks

The parent session log has no record of subagent spawns (the workflow
engine spawns them internally; the only durable linkage is the child
header's parentSession field), so the workbench reconstructs call ->
children attribution by creation-time window. Surface that panel in the
chat tool block too, not just the trajectory row.
This commit is contained in:
NI0317
2026-07-18 14:33:45 +08:00
parent b965285f28
commit 5c0d741531
2 changed files with 6 additions and 1 deletions
+3 -1
View File
@@ -988,11 +988,13 @@ function renderChatToolActivity(call) {
const outputHtml = result
? `<div class="activity-section-title">${failed ? 'Error output' : 'Output'}</div><pre>${escapeHtml(resultText)}</pre>`
: ''
const callEvent = state.callPairs.get(call.id)?.call
const spawnHtml = callEvent ? spawnedSessionsHtml(callEvent).trim() : ''
const openBtn = `<button class="activity-open-inspector" type="button" data-inspect-call="${escapeHtml(call.id ?? '')}">在检查器中打开 →</button>`
return `
<details class="chat-activity tool-use ${failed ? 'failed' : ''}" data-call-id="${escapeHtml(call.id ?? '')}">
<summary><span>${failed ? 'Tool failed' : 'Tool use'}</span><strong>${escapeHtml(call.name)}${preview ? `<span class="activity-preview"> · ${escapeHtml(preview)}</span>` : ''}</strong></summary>
<div class="activity-body">${inputHtml}${outputHtml}${openBtn}</div>
<div class="activity-body">${inputHtml}${outputHtml}${spawnHtml}${openBtn}</div>
</details>
`
}
+3
View File
@@ -1290,6 +1290,9 @@ h4 {
border-radius: 12px;
background: #f7fbf7;
overflow: hidden;
/* Inside .activity-body (white-space: pre-wrap) the template's own
newlines must not render. */
white-space: normal;
}
.spawn-list-head {