You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tool execution hard-limited to 120s due to AI SDK streamText default stepMs timeout #25509
All tool executions (bash, MCP, built-in tools) are hard-limited to 120 seconds, regardless of any timeout configuration. This is caused by the Vercel AI SDK's streamText() default timeout.stepMs value of 120000 (120s), which wraps the entire step including tool execution.
However, this timeout is set on the inner MCP SDK layer. The outer AI SDK streamText timeout (stepMs: 120000) triggers first, making experimental.mcp_timeout completely ineffective for values > 120s.
Call chain
streamText(timeout defaults to { stepMs: 120000 })
└─ tool execution (bash, MCP, all tools)
└─ convertMcpTool() → callTool(timeout: experimental.mcp_timeout)
└─ MCP SDK setTimeout (never reached if stepMs fires first)
Steps to Reproduce
Configure experimental.mcp_timeout: 3600000 in opencode.jsonc
Have an MCP server with a tool that takes >120 seconds (e.g., PDF ingestion with OCR)
Run opencode and invoke the long-running MCP tool
After 120 seconds, the tool is killed with The operation timed out.
Alternatively, with a simple bash test:
opencode run -m <model>"execute a python script that sleeps for 200 seconds"
After 120 seconds: bash tool terminated command after exceeding timeout 120000 ms
Expected Behavior
experimental.mcp_timeout (or a new config option) should control the effective tool execution timeout
Long-running MCP tools (PDF parsing, OCR, etc.) should be able to run beyond 120 seconds
This issue might be a duplicate of existing issues. Please check:
Per-server MCP timeout setting not working; requires experimental.mcp_timeout instead #8701: Per-server MCP timeout setting not working — reports that experimental.mcp_timeout is required to work around ignored per-server timeouts; closely related to this issue's finding that experimental.mcp_timeout itself is also ineffective due to the outer streamText timeout
Activity
github-actions commentedon May 3, 2026
This issue might be a duplicate of existing issues. Please check:
experimental.mcp_timeoutis required to work around ignored per-server timeouts; closely related to this issue's finding thatexperimental.mcp_timeoutitself is also ineffective due to the outerstreamTexttimeout'never'option formcp_timeoutto disable timeout entirely — same underlying frustration with MCP tools being killed prematurelyMcpError: MCP error -32001: Request timed out— users hitting the same symptom of MCP tools timing outIf any of these cover the same root cause you've identified, please consider cross-referencing or closing in favor of the existing issue.
tanbro commentedon May 4, 2026
OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MSandexperimental.mcp.timeoutsolved the problem