diff --git a/static/src/app/computed.ts b/static/src/app/computed.ts index bef9e19b..485128f5 100644 --- a/static/src/app/computed.ts +++ b/static/src/app/computed.ts @@ -215,7 +215,9 @@ export const computed = { return !!this.policyUiBlocks.block_virtual_monitor; }, displayLockEngaged() { - return !!this.compressionInProgress || !!this.compressing || !!this.currentWorkspaceHasRunningTask; + // 对话级并行后:运行中的任务不再硬锁输入栏——当前对话需要保持可输入以排队/停止, + // 其他对话需要保持可输入以并行运行。仅压缩期间保持锁定。 + return !!this.compressionInProgress || !!this.compressing; }, currentWorkspaceHasRunningTask() { // 对话级隔离后:仅当「当前对话」有运行中任务时才拦截发送; diff --git a/static/src/app/methods/message/send.ts b/static/src/app/methods/message/send.ts index 914e3418..86a4d90f 100644 --- a/static/src/app/methods/message/send.ts +++ b/static/src/app/methods/message/send.ts @@ -22,14 +22,6 @@ export const sendMethods = { const hasMedia = (Array.isArray(this.selectedImages) && this.selectedImages.length > 0) || (Array.isArray(this.selectedVideos) && this.selectedVideos.length > 0); - if (this.currentWorkspaceHasRunningTask) { - this.uiPushToast({ - title: '当前对话正在运行', - message: '请等待当前对话任务完成后再发送新消息;同工作区的其他对话可正常并行。', - type: 'warning' - }); - return; - } // 主对话空闲但 composerBusy=true:composerBusy 只因后台子智能体在跑而保持。 // 传统模式:waitingForSubAgent=true(taskInProgress=true 。多智能体模式:has_running_multi_agent=true。 // 此时新文本消息应直接发送,触发主智能体下一轮工作,而不是被进队列等任务结束。 @@ -91,6 +83,16 @@ export const sendMethods = { } this.stopTask(); } else { + // 对账安全网:REST 对账显示当前对话仍在运行、但本地流式状态尚未恢复(如刚刷新页面)时, + // 阻止直接发起新任务(后端同对话互斥会 409)。排队/停止走上方 composerBusy 分支,不受此守卫影响。 + if (this.currentWorkspaceHasRunningTask) { + this.uiPushToast({ + title: '当前对话正在运行', + message: '请等待当前对话任务完成后再发送新消息;同工作区的其他对话可正常并行。', + type: 'warning' + }); + return; + } this.sendMessage(); } },