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(remote-agent): validate cancellation callback before dispatch

DavidShenc8792398f6c9
diff --git a/apps/desktop/src/main/remote-agent/host/tunnel.ts b/apps/desktop/src/main/remote-agent/host/tunnel.ts
index 18d614d8e8..910ba28ef0 100644
--- a/apps/desktop/src/main/remote-agent/host/tunnel.ts
+++ b/apps/desktop/src/main/remote-agent/host/tunnel.ts
@@ -163,7 +163,8 @@ export async function createRunTunnel(handlers: TunnelHandlers): Promise<RunTunn
if (execMessage?.kind === 'cancel') {
// SDK 总超时/单次取消只发通知,不关闭 transport。复用原反向请求的取消信号,
// 不新增跨端字段,也不关闭共享连接或重放工具操作。
- pendingExecCalls.get(callKey!)?.();
+ const cancelPendingCall = pendingExecCalls.get(callKey!);
+ if (typeof cancelPendingCall === 'function') cancelPendingCall();
res.writeHead(202).end();
return;
}