Skills: clean up remote node cache on disconnect

This commit is contained in:
Vignesh Natarajan
2026-02-14 18:02:14 -08:00
parent 6f6954fb34
commit dabfcbe941
3 changed files with 42 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ import type { ResolvedGatewayAuth } from "../auth.js";
import type { GatewayRequestContext, GatewayRequestHandlers } from "../server-methods/types.js";
import type { GatewayWsClient } from "./ws-types.js";
import { resolveCanvasHostUrl } from "../../infra/canvas-host-url.js";
import { removeRemoteNodeInfo } from "../../infra/skills-remote.js";
import { listSystemPresence, upsertPresence } from "../../infra/system-presence.js";
import { truncateUtf16Safe } from "../../utils.js";
import { isWebchatClient } from "../../utils/message-channel.js";
@@ -243,6 +244,7 @@ export function attachGatewayWsConnectionHandler(params: {
const context = buildRequestContext();
const nodeId = context.nodeRegistry.unregister(connId);
if (nodeId) {
removeRemoteNodeInfo(nodeId);
context.nodeUnsubscribeAll(nodeId);
}
}