[Bug] Anthropic API Error: Connection closed mid-response after content blocks streamed

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

Bug Description
Reproducible, version-independent bug: "API Error: Connection closed mid-response" fires whenever a mid-stream ECONNRESET arrives after the client has already yielded ≥1 non-thinking content block for the turn — confirmed by decompiling the installed binary (2.1.221): the retry path (tengu_streaming_stale_connection_retry) is explicitly skipped once real content has streamed, regardless of version. 28 occurrences in one ~1h session today (2026-08-04, ~20:15–21:20 UTC), full request IDs and timestamps in attached report. Debug log evidence: x-client-request-id=db600bcf-7e73-4bca-9e83-d375c26e3234 (20:56:21 UTC) — ECONNRESET after 2 blocks yielded, finalized as partial 18s later. Matches independent binary analysis in anthropics/claude-code#69415 (also #70217, #69336). status.claude.com incident 20:48–21:04 UTC only partially overlaps — failures continued after "recovered" mark. Full report: ~/Downloads/CLAUDE_CODE_CONNECTION_BUG_REPORT.md.

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.221
  • Feedback ID: 7db7f9ec-157f-4571-aba0-5ebf1fa466aa

Errors

[]

View original on GitHub ↗