diff --git a/app/utils/ws-agent.ts b/app/utils/ws-agent.ts index cea469e..178b723 100644 --- a/app/utils/ws-agent.ts +++ b/app/utils/ws-agent.ts @@ -86,6 +86,10 @@ export async function initAgentCache(defaultTTL: number, filepath: string) { let agentSocket: WebSocket | undefined; export function initAgentSocket(context: LoaderFunctionArgs['context']) { + if (!context.ws) { + return; + }; + const client = context.ws.clients.values().next().value; agentSocket = client; }