openclaw - ✅(Solved) Fix [Bug]: MCP tool calls timeout prematurely (hardcoded 60s limit) [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#61786Fetched 2026-04-08 02:54:35
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
2
Author
Participants
Timeline (top)
labeled ×2cross-referenced ×1referenced ×1

MCP tool calls timeout prematurely after 60 seconds due to hardcoded SDK limits in OpenClaw, preventing long-running tasks from completing.

Error Message

Observe that the client returns a timeout error at exactly the 60s mark, even though the backend process is still running. The request is terminated by OpenClaw after approximately 60 seconds, even if the MCP server (OpenSpace) is still processing the task. This leads to a timeout error on the client side. Debugging confirmed that this is due to the hardcoded DEFAULT_REQUEST_TIMEOUT_MSEC in the @modelcontextprotocol/sdk used by OpenClaw, which is not being overridden during the callTool execution.

Root Cause

MCP tool calls timeout prematurely after 60 seconds due to hardcoded SDK limits in OpenClaw, preventing long-running tasks from completing.

PR fix notes

PR #62249: fix(mcp): increase tool call timeout from 60s to 5 minutes

Description (problem / solution / changelog)

Summary

  • MCP SDK defaults to 60-second request timeout for callTool which is too short for long-running tools (code execution, web scraping, complex analysis)
  • Increase the default to 5 minutes (300,000ms) and enable resetTimeoutOnProgress: true so tools that send progress notifications can run indefinitely
  • Single-file change in src/agents/pi-bundle-mcp-runtime.ts

Test plan

  • Existing MCP bundle tests pass
  • MCP tools that take >60s complete successfully instead of timing out
  • Tools that send progress notifications reset the timeout on each update

Fixes #61786

🤖 Generated with Claude Code

Changed files

  • src/agents/pi-bundle-mcp-runtime.ts (modified, +16/-5)
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

MCP tool calls timeout prematurely after 60 seconds due to hardcoded SDK limits in OpenClaw, preventing long-running tasks from completing.

Steps to reproduce

Install openclaw standalone.

Connect an MCP server (e.g., OpenSpace) with a tool that takes more than 60 seconds to execute. https://github.com/HKUDS/OpenSpace

Trigger the tool through openclaw.

Observe that the client returns a timeout error at exactly the 60s mark, even though the backend process is still running.

Expected behavior

The MCP tool call should wait for the backend process to complete, especially for complex or long-running tasks. It should honor a reasonable timeout period (e.g., 5-10 minutes) instead of disconnecting prematurely.

Actual behavior

The request is terminated by OpenClaw after approximately 60 seconds, even if the MCP server (OpenSpace) is still processing the task. This leads to a timeout error on the client side. Debugging confirmed that this is due to the hardcoded DEFAULT_REQUEST_TIMEOUT_MSEC in the @modelcontextprotocol/sdk used by OpenClaw, which is not being overridden during the callTool execution.

OpenClaw version

2026.4.2

Operating system

wsl ubantu 22.04

Install method

npm global

Model

openrouter/google/gemini-3-1-flash-lite-preview

Provider / routing chain

OpenClaw (standalone) -> MCP (OpenSpace) ->openrouter/google/gemini-3-1-flash-lite-preview

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

  • Increase the DEFAULT_REQUEST_TIMEOUT_MSEC value in the @modelcontextprotocol/sdk used by OpenClaw to a higher value, such as 5-10 minutes, to allow long-running tasks to complete without premature timeouts.

Guidance

  • Identify the location of the DEFAULT_REQUEST_TIMEOUT_MSEC constant in the @modelcontextprotocol/sdk code and consider overriding its value for the callTool execution.
  • Verify that increasing the timeout value does not introduce other issues, such as resource leaks or performance degradation.
  • Test the updated configuration with a long-running task to ensure it completes successfully without timing out.
  • Consider implementing a dynamic timeout mechanism that adjusts based on task complexity or estimated execution time.

Example

  • No explicit code example is provided, but the fix would involve modifying the DEFAULT_REQUEST_TIMEOUT_MSEC value, potentially through a configuration override or code patch.

Notes

  • The exact method for overriding the DEFAULT_REQUEST_TIMEOUT_MSEC value is not specified and may require further investigation into the OpenClaw and @modelcontextprotocol/sdk documentation.
  • Increasing the timeout value may have implications for system resource utilization and should be carefully evaluated.

Recommendation

  • Apply workaround: Increase the DEFAULT_REQUEST_TIMEOUT_MSEC value to a higher value, such as 5-10 minutes, to allow long-running tasks to complete without premature timeouts, as this is a more immediate solution to the problem at hand.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The MCP tool call should wait for the backend process to complete, especially for complex or long-running tasks. It should honor a reasonable timeout period (e.g., 5-10 minutes) instead of disconnecting prematurely.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING