fix: handle undefined websocket in context

This commit is contained in:
Aarnav Tale
2025-01-17 08:34:19 +00:00
parent c9603ba38a
commit e01fd8d50c
+4
View File
@@ -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;
}