fix(opencode): pass mcp_timeout as AI SDK streamText stepMs to prevent 120s timeout#25404
fix(opencode): pass mcp_timeout as AI SDK streamText stepMs to prevent 120s timeout#25404claude-code-best wants to merge 1 commit intoanomalyco:devfrom
Conversation
The AI SDK streamText() defaults stepMs to 120s, which covers the entire step including tool execution. This caused MCP tool calls to timeout at 120s even when experimental.mcp_timeout was configured to a much larger value, because the AI SDK step timeout fired before the MCP-level timeout. Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
The AI SDK streamText() defaults stepMs to 120s, which covers the entire step including tool execution. This caused MCP tool calls to timeout at 120s even when experimental.mcp_timeout was configured to a much larger value, because the AI SDK step timeout fired before the MCP-level timeout.
Type of change
What does this PR do?
MCP tool calls timeout at 120s regardless of
experimental.mcp_timeoutconfig.The AI SDK
streamText()has astepMsparam (default 120s) that covers the entire step — LLM call + tool execution. OpenCode correctly passesmcp_timeoutto MCP SDK'scallTool(), but never setsstepMsonstreamText(). So the AI SDK's 120s default fires before the MCP-level timeout is ever reached.Fix: pass
experimental.mcp_timeoutasstepMstostreamText(), so the AI SDK step timeout aligns with the MCP timeout. Whenmcp_timeoutis not configured, behavior is unchanged (AI SDK default applies).How did you verify your code works?
installation > latestnetwork tests, unrelated to this changeScreenshots / recordings
Checklist