From 4184a7b6f082f4d7b29c58d2093704ac35714546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AC=E6=98=8E?= <83812544+Ed1s0nZ@users.noreply.github.com> Date: Fri, 26 Jun 2026 10:54:59 +0800 Subject: [PATCH] Add files via upload --- web/static/js/monitor.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/web/static/js/monitor.js b/web/static/js/monitor.js index a1ac621d..d52dd4fd 100644 --- a/web/static/js/monitor.js +++ b/web/static/js/monitor.js @@ -3118,6 +3118,12 @@ function attachToolResultToCall(progressId, toolCallId, data, options) { if (!item && mapping && mapping.timeline) { item = findToolCallItemById(mapping.timeline, toolCallId); } + if (!item && progressId) { + const progressRoot = document.getElementById(String(progressId)); + if (progressRoot) { + item = findToolCallItemById(progressRoot, toolCallId); + } + } if (!item) return false; mergeToolResultIntoCallItem(item, data, options); return true; @@ -3154,7 +3160,7 @@ function coalesceProcessDetailsToolPairs(details) { if (id) callsById.set(id, copy); fifoCalls.push(copy); out.push(copy); - } else if (et === 'tool_result') { + } else if (et === 'tool_result') { let target = null; if (id && callsById.has(id)) { target = callsById.get(id); @@ -3168,6 +3174,12 @@ function coalesceProcessDetailsToolPairs(details) { } } if (target) { + // agentFacing 或较新的 tool_result 覆盖旧合并(历史数据可能含 reduction 前全量正文) + const prev = target.data._mergedResult; + if (prev && data.agentFacing !== true && prev.agentFacing === true) { + out.push(detail); + continue; + } absorbResult(target, detail); continue; }