[BUG] Non-streaming retry receives event-stream response (HTTP/2 stream mixup, Intel Mac)

Status Open
Reported on v2.1.236
Maintainer reply None cached
Activity 1 comment · opened Aug 20, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Environment

  • Claude Code: 2.1.236 and 2.1.237
  • Node.js: 22.17.0 (nvm, x86_64)
  • macOS: 15.7.4 (Intel)
  • Cloudflare POP: ICN

Symptom
Intermittent, session-sticky. Once triggered, persists until process restart.
Same version on Apple Silicon Mac on same network: no issue.

Error
API returned an empty or malformed response (HTTP 200)

  • 1st attempt (streaming): 0 stream events, no request-id
  • 2nd attempt (non-streaming retry): HTTP 200, content-type event-stream,

64685 bytes — streaming response returned for non-streaming request

Ruled out
Proxy, VPN, SSL inspection, firewall, macOS network filter,
MDM, DNS, /etc/hosts, ~/.claude state, auth re-login, reboot,
different network (hotspot), Node.js reinstall, different directory

<img width="635" height="294" alt="Image" src="https://github.com/user-attachments/assets/31e55828-88d5-4606-a313-91337febdeb8" />

What Should Happen?

Streaming requests should receive SSE event streams with a valid
Anthropic request-id. When a streaming request fails and Claude Code
retries as a non-streaming request (stream: false), the retry response
should be a JSON object (content-type: application/json), not an
event-stream. Each HTTP/2 stream should be fully independent — a failed
streaming request's response must never leak into a subsequent
non-streaming retry on the same connection.

Error Messages/Logs

API Error: API returned an empty or malformed response (HTTP 200) — check for a proxy or gateway intercepting the request. Response: content-type event-stream, body is an event stream (the non-streaming request was answered with a stream), 2795 bytes, request-id req_011CeDCC5p1UT6L6ifTfnBAU, server cloudflare, intermediary headers anthropic-* cf-cache-status cf-ray. This was the non-streaming retry of streaming request (no Anthropic request-id), which failed with: other; 0 stream events received.

Steps to Reproduce

  1. Environment: macOS 15.7.4, Intel x86_64, Node.js 22.17.0 (nvm),

Claude Code 2.1.237

  1. Launch claude in any directory (no specific project config required)
  2. Send any prompt
  3. Intermittently, the streaming request fails with 0 SSE events and

no Anthropic request-id

  1. Claude Code automatically retries as a non-streaming request
  2. The retry receives HTTP 200 with content-type: event-stream

(64685 bytes) instead of expected application/json

  1. Error displayed:

"API returned an empty or malformed response (HTTP 200) —
check for a proxy or gateway intercepting the request"

  1. Once triggered, every subsequent request in the same session fails

with the same error

  1. Restarting the claude process temporarily resolves until

the next occurrence

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.237

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗