WebFetch tool has no timeout — can hang indefinitely, stalling sessions

Resolved 💬 2 comments Opened Mar 17, 2026 by virafb Closed Apr 14, 2026

Problem

The WebFetch tool has no timeout parameter. When it encounters a slow or unresponsive URL, it blocks indefinitely with no way for the user to abort the operation.

What happened

During a session, a research subagent used WebFetch to fetch documentation from a URL. The fetch hung for approximately 30 minutes. The user attempted to interrupt by sending messages (e.g., /btw) but the blocked operation continued. The entire session was stalled.

Expected behavior

WebFetch should have a configurable timeout (similar to the Bash tool's timeout parameter), with a reasonable default (e.g., 30-60 seconds). When the timeout is reached, the tool should return an error so the agent can try an alternative approach.

Suggested fix

  1. Add a timeout parameter to WebFetch (default: 60 seconds, max: 300 seconds)
  2. Return a clear timeout error that agents can act on
  3. Consider adding a progress indicator so users can see the fetch is still pending

Workaround

Use the context7 MCP server for library documentation instead of WebFetch. For other URLs, warn users before fetching unknown endpoints.

Environment

  • Claude Code CLI
  • Platform: Linux (WSL2)
  • The issue affects both main conversation and subagent contexts

View original on GitHub ↗

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