From e537236bf3b8f84787d967e09758f0e461854c5e 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 23:10:11 +0800 Subject: [PATCH] Add files via upload --- web/static/js/chat.js | 2 +- web/static/js/monitor.js | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/web/static/js/chat.js b/web/static/js/chat.js index ec4ac190..ceaa3535 100644 --- a/web/static/js/chat.js +++ b/web/static/js/chat.js @@ -3119,7 +3119,7 @@ async function cancelMCPToolExecutionSubmit(executionId, userNote, options = {}) } try { if (conversationId && typeof requestCancelWithContinue === 'function') { - await requestCancelWithContinue(conversationId, userNote || ''); + await requestCancelWithContinue(conversationId, userNote || '', { executionId }); } else { const res = await apiFetch(`/api/monitor/execution/${encodeURIComponent(executionId)}/cancel`, { method: 'POST', diff --git a/web/static/js/monitor.js b/web/static/js/monitor.js index 8c71c6ca..0d87a60c 100644 --- a/web/static/js/monitor.js +++ b/web/static/js/monitor.js @@ -970,17 +970,22 @@ async function requestCancel(conversationId) { } /** 与 MCP 监控一致:仅终止当前进行中的工具调用,工具返回后本轮推理继续(可选 reason 合并进工具结果) */ -async function requestCancelWithContinue(conversationId, reason) { +async function requestCancelWithContinue(conversationId, reason, options = {}) { + const executionId = options && options.executionId ? String(options.executionId).trim() : ''; + const body = { + conversationId, + reason: reason || '', + continueAfter: true, + }; + if (executionId) { + body.executionId = executionId; + } const response = await apiFetch('/api/agent-loop/cancel', { method: 'POST', headers: { 'Content-Type': 'application/json', }, - body: JSON.stringify({ - conversationId, - reason: reason || '', - continueAfter: true, - }), + body: JSON.stringify(body), }); const result = await response.json().catch(() => ({})); if (!response.ok) { @@ -1021,7 +1026,9 @@ async function submitUserInterruptContinue() { stopBtn.disabled = true; stopBtn.textContent = typeof window.t === 'function' ? window.t('tasks.interruptSubmitting') : '提交中...'; } - await requestCancelWithContinue(conversationId, reason); + await requestCancelWithContinue(conversationId, reason, { + executionId: monitorCtx && monitorCtx.executionId ? monitorCtx.executionId : '', + }); if (monitorCtx && monitorCtx.executionId && typeof refreshMonitorPanel === 'function') { const page = (typeof monitorState !== 'undefined' && monitorState.pagination && monitorState.pagination.page) ? monitorState.pagination.page