Add files via upload

This commit is contained in:
公明
2026-06-26 23:10:11 +08:00
committed by GitHub
parent 7eeffb1933
commit e537236bf3
2 changed files with 15 additions and 8 deletions
+1 -1
View File
@@ -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',
+14 -7
View File
@@ -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