[Bug] Streaming responses stall after ~0.5–2.7 KB, triggering 180s byte-watchdog timeout

Status Open
Reported on v2.1.240
Maintainer reply None cached
Activity 0 comments · opened Aug 22, 2026

Bug Description
Title: Streams go silent after first ~0.5–2.7 KB and hit the 180 s byte-watchdog; subagents and main thread fail in bursts

Environment

  • Claude Code 2.1.240 (npm global, Node 24.15.0 via nvm), Linux 7.1.8 (CachyOS)
  • Models: claude-opus-5[1m] (main), claude-fable-5 (subagents), claude-sonnet-5[1m] (classifier)
  • Permission mode: auto. No proxy, no ANTHROPIC_BASE_URL.
  • Debug session ID: 9d537df5-da46-410f-9415-094f2f6bb954 (log attached via /bug)

What happens
Streaming responses start normally (first byte in 0.7–2.7 s) but then stop delivering bytes entirely. After only 525 B – 2.7 KB received (message_start plus at most one block), no further data arrives; the client's byte-watchdog fires at 180 s and aborts the stream. Subagents running on those streams exit with exitPath=error, and the main REPL thread falls back to non-streaming mode and shows "API Error: The response stopped arriving".

Timeline from the attached debug log (2026-08-22, UTC)

  • 22:33:33 — API error (attempt 1/11): Connection error on an Explore subagent request; Stale connection — disabling keep-alive for retry.
  • 22:33:47 — 3 streams stall simultaneously (stream_idle_partial … bytesTotal=2394 / 841 / 1464).
  • 22:36:47, 22:36:51, 22:36:57 — [byte-watchdog] firing: idle=180000ms ×3 → Streaming idle timeout (byte-level): no bytes for 180000ms, aborting stream. Explore agent ae8c794ebc209d103 dies after 193 s; main thread falls back to non-streaming.
  • 22:37:00 — second wave: 3 more streams stall.
  • 22:40:00, 22:40:06, 22:40:22 — watchdog ×3 again. Explore agents a7002d75fd08901cc (406 s) and a1cac91ad239b1e6a (401 s) die.
  • 22:42:30 — [engine] turn ended in error.

Totals in 11 minutes: 59 requests, 50 got a first byte, 9 stalled mid-stream, 6 watchdog aborts, 3 subagents lost, 2 main-thread fallbacks.

Frequency / history
Aggregated from local transcripts (isApiErrorMessage: true), errors per day vs. requests:

  • 08-18: 11 / 5,606 (0.2 %, incl. 5× 529 Overloaded)
  • 08-19: 0 / 7,983
  • 08-20: 2 / 2,387
  • 08-21: 50 / 3,604 (1.4 %) — 46× "The response stopped arriving", 4× "Connection lost mid-response"
  • 08-22: 8 / 1,113 before this session (0.7 %), plus the session above

All 08-21 failures were on claude-opus-5, median context 245k tokens; 08-19 ran larger contexts (median 330k, p90 728k) with zero failures, so model and context size do not explain it.

What I ruled out locally

  • No network drops in journalctl (only Docker veth events), no Wi‑Fi reconnects.
  • curl to api.anthropic.com: DNS 1 ms, connect 3 ms, TLS 13 ms.
  • Only settings change on 08-21 was adding permissions.defaultMode: auto; failures predate it.
  • Stalls hit several independent sessions/projects in the same minute (e.g. 08-21 19:14 local across three repos).

Expected: the stream keeps delivering tokens or returns an error promptly instead of going silent for 3 minutes.

Ask: can you check server-side logs for these request windows? The x-client-request-ids are in the attached log ([API REQUEST] lines around the timestamps above).

Environment Info

  • Platform: linux
  • Terminal: konsole
  • Version: 2.1.240
  • Feedback ID: 108fc0c2-6249-4ac8-aee8-d323849e2d02

Errors

[]

View original on GitHub ↗