Skip to content

Commit be410b9

Browse files
Juan Roldanclaude
andcommitted
fix: increase stream idle timeout from 90s to 5 minutes
The 90s stream-idle timer was firing during legitimate long-running agent turns (browser navigation, complex tool chains). Backend already sends heartbeats every 30s to keep the connection alive, so the idle timer just needs to be generous enough for edge cases where heartbeats are delayed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d7829a1 commit be410b9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/frontend/src/hooks/useAgentSocket.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ type ChunkHandler = (chunk: StreamChunk) => void;
4747

4848
const RECONNECT_MIN_MS = 1000;
4949
const RECONNECT_MAX_MS = 10000;
50-
const STREAM_TIMEOUT_MS = 90000; // 90s without chunks = stale
50+
const STREAM_TIMEOUT_MS = 300000; // 5min without chunks = stale
5151

5252
export function useAgentSocket(
5353
agentId: string | undefined,
@@ -73,7 +73,7 @@ export function useAgentSocket(
7373
// No chunks for 90s — force done
7474
const handler = handlerRef.current;
7575
if (handler) {
76-
handler({ type: 'error', message: 'Stream timeout — no response for 90s' });
76+
handler({ type: 'error', message: 'Stream timeout — no response for 5 minutes' });
7777
handler({ type: 'done', sessionId: '' });
7878
handlerRef.current = null;
7979
}

0 commit comments

Comments
 (0)