From f64b7653ac4c3cf3506245264ab2043c228fc7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AC=E6=98=8E?= <83812544+Ed1s0nZ@users.noreply.github.com> Date: Thu, 2 Apr 2026 00:40:12 +0800 Subject: [PATCH] Add files via upload --- web/static/i18n/en-US.json | 1 + web/static/i18n/zh-CN.json | 1 + web/static/js/chat.js | 4 ++++ web/static/js/monitor.js | 38 ++++++++++++++++++++++++++++++++++++-- 4 files changed, 42 insertions(+), 2 deletions(-) diff --git a/web/static/i18n/en-US.json b/web/static/i18n/en-US.json index a6ce1f09..d53ba93b 100644 --- a/web/static/i18n/en-US.json +++ b/web/static/i18n/en-US.json @@ -169,6 +169,7 @@ "taskCancelled": "Task cancelled", "unknownTool": "Unknown tool", "einoAgentReplyTitle": "Sub-agent reply", + "einoRecoveryTitle": "🔄 Invalid tool JSON · run {{n}}/{{max}} (hint appended)", "noDescription": "No description", "noResponseData": "No response data", "loading": "Loading...", diff --git a/web/static/i18n/zh-CN.json b/web/static/i18n/zh-CN.json index 2f1b584c..137cf1f2 100644 --- a/web/static/i18n/zh-CN.json +++ b/web/static/i18n/zh-CN.json @@ -169,6 +169,7 @@ "taskCancelled": "任务已取消", "unknownTool": "未知工具", "einoAgentReplyTitle": "子代理回复", + "einoRecoveryTitle": "🔄 工具参数无效 · 第 {{n}}/{{max}} 轮(已追加提示)", "noDescription": "暂无描述", "noResponseData": "暂无响应数据", "loading": "加载中...", diff --git a/web/static/js/chat.js b/web/static/js/chat.js index ebe0836b..aa284032 100644 --- a/web/static/js/chat.js +++ b/web/static/js/chat.js @@ -1763,6 +1763,10 @@ function renderProcessDetails(messageId, processDetails) { itemTitle = agPx + execLine; } else if (eventType === 'eino_agent_reply') { itemTitle = agPx + '💬 ' + (typeof window.t === 'function' ? window.t('chat.einoAgentReplyTitle') : '子代理回复'); + } else if (eventType === 'eino_recovery') { + const ri = data.runIndex != null ? data.runIndex : (data.einoRetry != null ? data.einoRetry + 1 : 1); + const mx = data.maxRuns != null ? data.maxRuns : 3; + itemTitle = (typeof window.t === 'function' ? window.t('chat.einoRecoveryTitle', { n: ri, max: mx }) : ('🔄 第 ' + ri + '/' + mx + ' 轮(已追加提示)')); } else if (eventType === 'knowledge_retrieval') { itemTitle = '📚 ' + (typeof window.t === 'function' ? window.t('chat.knowledgeRetrieval') : '知识检索'); } else if (eventType === 'error') { diff --git a/web/static/js/monitor.js b/web/static/js/monitor.js index 8f2b81eb..576c12a9 100644 --- a/web/static/js/monitor.js +++ b/web/static/js/monitor.js @@ -889,7 +889,22 @@ function handleStreamEvent(event, progressElement, progressId, data: event.data }); break; - + + case 'eino_recovery': { + const d = event.data || {}; + const runIdx = d.runIndex != null ? d.runIndex : (d.einoRetry != null ? d.einoRetry + 1 : 1); + const maxRuns = d.maxRuns != null ? d.maxRuns : 3; + const title = typeof window.t === 'function' + ? window.t('chat.einoRecoveryTitle', { n: runIdx, max: maxRuns }) + : ('🔄 工具参数无效 · 第 ' + runIdx + '/' + maxRuns + ' 轮(已追加提示)'); + addTimelineItem(timeline, 'eino_recovery', { + title: title, + message: event.message || '', + data: event.data + }); + break; + } + case 'tool_call': const toolInfo = event.data || {}; const toolName = toolInfo.toolName || (typeof window.t === 'function' ? window.t('chat.unknownTool') : '未知工具'); @@ -1463,6 +1478,15 @@ function addTimelineItem(timeline, type, options) { if (type === 'progress' && options.message) { item.dataset.progressMessage = options.message; } + if (type === 'eino_recovery' && options.data) { + const d = options.data; + if (d.runIndex != null) { + item.dataset.recoveryRunIndex = String(d.runIndex); + } + if (d.maxRuns != null) { + item.dataset.recoveryMaxRuns = String(d.maxRuns); + } + } if (type === 'tool_calls_detected' && options.data && options.data.count != null) { item.dataset.toolCallsCount = String(options.data.count); } @@ -1561,6 +1585,12 @@ function addTimelineItem(timeline, type, options) { `; + } else if (type === 'eino_recovery' && options.message) { + content += ` +