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(maker-remote-ssh): close-撞-arm 清理路径的 unforward 补 5s 看门狗

yan6c618f601ba7
diff --git a/packages/maker-remote-ssh/src/RemoteHost.ts b/packages/maker-remote-ssh/src/RemoteHost.ts
index ab4e99714b..a48a833199 100644
--- a/packages/maker-remote-ssh/src/RemoteHost.ts
+++ b/packages/maker-remote-ssh/src/RemoteHost.ts
@@ -695,10 +695,19 @@ export class RemoteHost {
id: this.id,
port: bound,
});
+ // 与 forwardHandle.close() 相同的 5s 看门狗: 半开连接上 unforwardIn
+ // 回调可能丢失, 这里挂住会把 ensureRemoteForward 的调用方
+ // (Settings 关闭 proxy / 更新 host) 一起拖死 (worker 核验补充)。
await new Promise<void>((resolve) => {
+ const timer = setTimeout(() => resolve(), 5_000);
+ timer.unref?.();
try {
- client.unforwardIn('127.0.0.1', bound, () => resolve());
+ client.unforwardIn('127.0.0.1', bound, () => {
+ clearTimeout(timer);
+ resolve();
+ });
} catch {
+ clearTimeout(timer);
resolve();
}
});