WebFetch hangs indefinitely despite server responding in <1s

Resolved 💬 2 comments Opened Mar 14, 2026 by danyelkoca Closed Apr 12, 2026

Repro

WebFetch(https://finance.yahoo.com/news/petzbe-social-media-app-pets-204500825.html)

Tool hangs at "Fetching…" indefinitely. Have to Escape to cancel.

Investigation

Tested the same URL from the same machine to check if the server is the bottleneck.

curl (5 consecutive requests):

Status: 429, Size: 23B, Time: 0.320s
Status: 429, Size: 23B, Time: 0.045s
Status: 429, Size: 23B, Time: 0.064s
Status: 429, Size: 23B, Time: 0.042s
Status: 429, Size: 23B, Time: 0.060s

Node.js https.get (same Accept header):

Status: 404, 1004 bytes, completed in 1141ms

Domain check API:

GET api.anthropic.com/api/web/domain_info?domain=finance.yahoo.com
200 OK — {"domain":"finance.yahoo.com","can_fetch":true} — 261ms

Server responds in under 1 second every time. The hang is inside Claude Code.

Source code analysis (cli.js)

Read the WebFetch implementation. The pipeline:

  1. Domain check — has 10s timeout
  2. HTTP fetch via axios — has 60s socket inactivity timeout
  3. HTML to Markdown via Turndown
  4. AI summarization — calls messages.create({stream:true}) to process content with a small model. Has no timeout. A stream watchdog exists but is disabled by default (gated behind CLAUDE_ENABLE_STREAM_WATCHDOG=1 env var).

There is no total pipeline timeout. Only user Escape/Ctrl+C can cancel.

Related

  • #11650
  • #12113
  • #8980

Environment

  • macOS Darwin 24.3.0
  • Node v22.15.1
  • Claude Opus 4.6

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗