Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: close existing WebSocket before reconnecting to prevent connection amplification

Daniel09aa6ba2ec8c
diff --git a/app/src/layout/Model.ts b/app/src/layout/Model.ts
index aef5e23d85..426aad75c0 100644
--- a/app/src/layout/Model.ts
+++ b/app/src/layout/Model.ts
@@ -81,6 +81,10 @@ export class Model {
kernelError();
}
};
+ if (this.ws) {
+ this.ws.onclose = null;
+ this.ws.close();
+ }
this.ws = ws;
}