Skip to content

Commit 2aecd31

Browse files
KonghaYaoclaude
andcommitted
Fix MCP tool timeout: pass mcp_timeout as AI SDK streamText stepMs
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]>
1 parent becf57e commit 2aecd31

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • packages/opencode/src/session

packages/opencode/src/session/llm.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ const live: Layer.Layer<
334334
: undefined
335335

336336
return streamText({
337+
timeout: cfg.experimental?.mcp_timeout
338+
? { stepMs: cfg.experimental.mcp_timeout }
339+
: undefined,
337340
onError(error) {
338341
l.error("stream error", {
339342
error,

0 commit comments

Comments
 (0)