Add files via upload

This commit is contained in:
公明
2026-06-24 17:15:34 +08:00
committed by GitHub
parent 810d689132
commit b6a6009629
3 changed files with 71 additions and 9 deletions
+32 -9
View File
@@ -3110,15 +3110,26 @@ async function cancelMCPToolExecutionSubmit(executionId, userNote, options = {})
if (!executionId) {
return;
}
let conversationId = '';
if (typeof monitorState !== 'undefined' && Array.isArray(monitorState.executions)) {
const exec = monitorState.executions.find(e => e && e.id === executionId);
if (exec) {
conversationId = (exec.conversationId || '').trim();
}
}
try {
const res = await apiFetch(`/api/monitor/execution/${encodeURIComponent(executionId)}/cancel`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ note: userNote || '' }),
});
const body = await res.json().catch(() => ({}));
if (!res.ok) {
throw new Error(body.error || body.message || res.statusText);
if (conversationId && typeof requestCancelWithContinue === 'function') {
await requestCancelWithContinue(conversationId, userNote || '');
} else {
const res = await apiFetch(`/api/monitor/execution/${encodeURIComponent(executionId)}/cancel`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ note: userNote || '' }),
});
const body = await res.json().catch(() => ({}));
if (!res.ok) {
throw new Error(body.error || body.message || res.statusText);
}
}
const okMsg = typeof window.t === 'function' ? window.t('mcpDetailModal.abortSuccess') : '已发送终止请求';
alert(okMsg);
@@ -3136,7 +3147,7 @@ async function cancelMCPToolExecutionSubmit(executionId, userNote, options = {})
}
/**
* 取消单次 MCP 工具执行监控页终止弹出说明框后提交仅取消该次 tools/call不停止整条对话/迭代任务
* 取消单次 MCP 工具执行监控页终止 conversationId 时复用对话页中断并继续弹窗与 API
* @param {string} executionId
* @param {{ refreshDetail?: boolean }} [options]
*/
@@ -3144,6 +3155,18 @@ async function cancelMCPToolExecution(executionId, options = {}) {
if (!executionId) {
return;
}
let conversationId = '';
if (typeof monitorState !== 'undefined' && Array.isArray(monitorState.executions)) {
const exec = monitorState.executions.find(e => e && e.id === executionId);
if (exec) {
conversationId = (exec.conversationId || '').trim();
}
}
if (conversationId && typeof openUserInterruptModal === 'function') {
openUserInterruptModal(null, conversationId);
window.__monitorInterruptContext = { executionId: executionId, options: options || {} };
return;
}
openMcpToolAbortModal(executionId, options);
}