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): SSH 远程会话也豁免 pendingTaskWake 的 isAgentBusy 判定

Shinku797f53b8bcce
diff --git a/apps/desktop/src/renderer/hooks/useCCAgentChat.ts b/apps/desktop/src/renderer/hooks/useCCAgentChat.ts
index b4faafc4ac..f3584d8923 100644
--- a/apps/desktop/src/renderer/hooks/useCCAgentChat.ts
+++ b/apps/desktop/src/renderer/hooks/useCCAgentChat.ts
@@ -749,10 +749,10 @@ export function useCCAgentChat(
lightState.isStreaming ||
lightState.agentStatus.isRunning ||
hasPendingSteer ||
- // 远程会话豁免 pendingTaskWake:镜像事件有设计内的丢失窗口(断连/重连),
- // taskUpdates 不在 reconcile 对账覆盖内,终态 drop 后无自愈路径。与
- // makerChatStore.hasBackgroundAgentWork 的远程豁免同口径。
- (lightState.pendingTaskWake && sessionId && !isRemoteSession(sessionId)) ||
+ // 远程会话豁免 pendingTaskWake:device-link 与 SSH 镜像事件有设计内的丢失
+ // 窗口(断连/重连),taskUpdates 不在 reconcile 对账覆盖内,终态 drop 后无自愈
+ // 路径。与 makerChatStore.hasBackgroundAgentWork 的远程豁免同口径。
+ (lightState.pendingTaskWake && sessionId && !isRemoteSession(sessionId) && !makerChatStore.getSnapshot(sessionId)?.remoteHostId) ||
(pendingQueueLength > 0 && !lightState.queuePaused);
const setQueueExpanded = useCallback(
diff --git a/apps/desktop/src/renderer/lib/makerChatStore.ts b/apps/desktop/src/renderer/lib/makerChatStore.ts
index b7a30e4894..ae74d89935 100644
--- a/apps/desktop/src/renderer/lib/makerChatStore.ts
+++ b/apps/desktop/src/renderer/lib/makerChatStore.ts
@@ -4220,7 +4220,7 @@ function hasRunningWakeTask(state: SessionChatState): boolean {
* 折算总入口:该会话是否有「本地」后台 agent 工作(wake 任务在跑 / 唤醒桥接中)。
* getRunningSnapshot / _isSessionBusy / _evictLruIfNeeded 统一走这里。
*
- * 远程(device-link 控制端)会话豁免(review P1):mirror 事件有设计内的丢失
+ * 远程(device-link 控制端 / SSH)会话豁免(review P1):mirror 事件有设计内的丢失
* 窗口(断连/重连),而 taskUpdates 不在 reconcile 对账覆盖内、stall 看门狗只认
* agentStatus.isRunning——终态事件掉在窗口里的话 spinner 会永久转且无自愈路径,
* demote 兜底还会被 busy 守卫自己挡掉。远程侧宁可保持修复前行为(空窗期不转),
@@ -4228,7 +4228,7 @@ function hasRunningWakeTask(state: SessionChatState): boolean {
*/
function hasBackgroundAgentWork(sessionId: string, state: SessionChatState): boolean {
if (!state.pendingTaskWake && !hasRunningWakeTask(state)) return false;
- return !isRemoteSession(sessionId);
+ return !isRemoteSession(sessionId) && !state.remoteHostId;
}
/**