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: retry Orca Lead close when returning home

Praise47a1eee1e2ad
diff --git a/apps/desktop/src/main/maker-ipc/sessionAgentSwitchHandler.ts b/apps/desktop/src/main/maker-ipc/sessionAgentSwitchHandler.ts
index 76e111226c..4133dd10d4 100644
--- a/apps/desktop/src/main/maker-ipc/sessionAgentSwitchHandler.ts
+++ b/apps/desktop/src/main/maker-ipc/sessionAgentSwitchHandler.ts
@@ -851,7 +851,14 @@ export async function performSessionAgentSwitch(
return deps.withCloseSuppressed(sessionId, async () => {
throwIfAgentSwitchAborted(signal);
if (live) {
- await deps.closeSession(sessionId);
+ try {
+ await deps.closeSession(sessionId);
+ } catch (error) {
+ if (!orcaLeadReturnHome) throw error;
+ // The remote close may have failed after its local handle was already torn down.
+ // Retry once to finish local cleanup; a second failure still blocks the route switch.
+ await deps.closeSession(sessionId);
+ }
}
// 停用轴:提交点重裁决(PR #744 review 第十五轮)—— parked 数据加载、handoff