Streaming Watchdog Bug Chain

Description

A three-bug compound failure that caused the majority of observed stream hangs: (1) watchdog initializes AFTER the dangerous do-while phase and is disabled by default behind an undocumented env var CLAUDE_ENABLE_STREAM_WATCHDOG; (2) releaseStreamResources() aborts stream and streamResponse which are undefined during the initial connection phase — a no-op; (3) non-streaming fallback with fallback_cause="watchdog" telemetry only triggers during the for-await SSE phase, never the do-while phase where 100% of observed hangs occur. Had been shipping 5+ months unguarded.

Key claims

Relations

Sources

src-20260419-be936b1b7d4c