Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(desktop): 折叠后台 wake 任务到 busy 态,禁用态跳过预测

Shinkue0c9afc14444
diff --git a/apps/desktop/src/renderer/components/new-chat/ChatInput.tsx b/apps/desktop/src/renderer/components/new-chat/ChatInput.tsx
index d54c9dab69..f96e5285c8 100644
--- a/apps/desktop/src/renderer/components/new-chat/ChatInput.tsx
+++ b/apps/desktop/src/renderer/components/new-chat/ChatInput.tsx
@@ -1184,6 +1184,9 @@ export function ChatInput({
// undefined = 所有权尚未解析 → 允许预测(remoteHostId 门禁会拦截 SSH 远程)
// string = 远程会话 → 被下面 !deviceLinkDeviceId 拦截
if (wasRunning && !showStopButton && recommendationEnabled && sessionId && !deviceLinkDeviceId && !remoteHostId) {
+ // 当 composer 被禁用时(如 reviewer 任务完成后 read-only),不应触发
+ // 预测:用户无法 Tab 填入或发送,发起 provider 调用是浪费。
+ if (disabledRef.current) return;
// 后台 wake 型任务(local_agent / local_workflow)仍在运行时,主 turn 报告
// 用户点击 Stop 或 turn 以错误/中止结束时,不应触发预测。
// turnStoppedByUser 是 session 级 store 字段(stopSession 置位、新 turn 复位),
diff --git a/apps/desktop/src/renderer/hooks/useCCAgentChat.ts b/apps/desktop/src/renderer/hooks/useCCAgentChat.ts
index 2eec040ee7..2e258de57b 100644
--- a/apps/desktop/src/renderer/hooks/useCCAgentChat.ts
+++ b/apps/desktop/src/renderer/hooks/useCCAgentChat.ts
@@ -753,6 +753,7 @@ export function useCCAgentChat(
// 窗口(断连/重连),taskUpdates 不在 reconcile 对账覆盖内,终态 drop 后无自愈
// 路径。与 makerChatStore.hasBackgroundAgentWork 的远程豁免同口径。
(lightState.pendingTaskWake && sessionId && !isRemoteSessionSticky(sessionId) && !makerChatStore.getSnapshot(sessionId)?.remoteHostId) ||
+ (sessionId != null && makerChatStore.hasBackgroundAgentWork(sessionId)) ||
(pendingQueueLength > 0 && !lightState.queuePaused);
const setQueueExpanded = useCallback(