From 91665303516fa9cb293fb64d190361f040231ee7 Mon Sep 17 00:00:00 2001 From: marko-kraemer Date: Tue, 7 Oct 2025 10:32:23 +0200 Subject: [PATCH] rem 30min stream timeout fe --- frontend/src/lib/api.ts | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index 5af326d7..ba215e75 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -9,8 +9,6 @@ const API_URL = process.env.NEXT_PUBLIC_BACKEND_URL || ''; const nonRunningAgentRuns = new Set(); // Map to keep track of active EventSource streams const activeStreams = new Map(); -// Map to keep track of safety timeouts -const safetyTimeouts = new Map(); /** * Helper function to safely cleanup EventSource connections @@ -31,13 +29,6 @@ const cleanupEventSource = (agentRunId: string, reason?: string): void => { // Remove from active streams activeStreams.delete(agentRunId); } - - // Clear any associated safety timeout - const timeout = safetyTimeouts.get(agentRunId); - if (timeout) { - clearTimeout(timeout); - safetyTimeouts.delete(agentRunId); - } }; /** @@ -1066,17 +1057,6 @@ export const streamAgent = ( activeStreams.set(agentRunId, eventSource); - // Safety timeout to prevent indefinite connections (30 minutes) - const safetyTimeout = setTimeout(() => { - console.warn(`[STREAM] Safety timeout reached for ${agentRunId}, cleaning up`); - cleanupEventSource(agentRunId, 'safety timeout'); - callbacks.onError('Connection timeout - stream has been running too long'); - callbacks.onClose(); - }, 30 * 60 * 1000); // 30 minutes - - // Store the timeout ID for cleanup - safetyTimeouts.set(agentRunId, safetyTimeout as unknown as number); - eventSource.onopen = () => { console.log(`[STREAM] EventSource opened for ${agentRunId}`); };