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): hasBackgroundAgentWork 远程会话判定改用粘滞谓词

Shinkub4cea12c08ff
diff --git a/apps/desktop/src/renderer/__tests__/makerChatStoreTaskUpdates.test.ts b/apps/desktop/src/renderer/__tests__/makerChatStoreTaskUpdates.test.ts
index e6a8d8b63f..84e3d11c64 100644
--- a/apps/desktop/src/renderer/__tests__/makerChatStoreTaskUpdates.test.ts
+++ b/apps/desktop/src/renderer/__tests__/makerChatStoreTaskUpdates.test.ts
@@ -73,6 +73,7 @@ vi.mock('@/lib/makerTransport', () => ({
aroundMessagesFor: vi.fn(async () => []),
aroundMessagesByClientIdFor: vi.fn(async () => []),
isRemoteSession: (sessionId: string) => sessionId.startsWith('remote-'),
+ isRemoteSessionSticky: (sessionId: string) => sessionId.startsWith('remote-'),
}));
import { EMPTY_SESSION_STATE, handleStreamEvent, makerChatStore } from '@/lib/makerChatStore';
diff --git a/apps/desktop/src/renderer/lib/makerChatStore.ts b/apps/desktop/src/renderer/lib/makerChatStore.ts
index ae74d89935..3e1b71d063 100644
--- a/apps/desktop/src/renderer/lib/makerChatStore.ts
+++ b/apps/desktop/src/renderer/lib/makerChatStore.ts
@@ -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) && !state.remoteHostId;
+ return !isRemoteSessionSticky(sessionId) && !state.remoteHostId;
}
/**