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:
- Domain check — has 10s timeout
- HTTP fetch via axios — has 60s socket inactivity timeout
- HTML to Markdown via Turndown
- 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 behindCLAUDE_ENABLE_STREAM_WATCHDOG=1env 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
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗