Skip to content

fix(mcp): disable bun fetch idle timeout for remote transports - #43993

Open
viperx1 wants to merge 3 commits into
anomalyco:devfrom
viperx1:mcp-timeout-fix
Open

fix(mcp): disable bun fetch idle timeout for remote transports#43993
viperx1 wants to merge 3 commits into
anomalyco:devfrom
viperx1:mcp-timeout-fix

Conversation

@viperx1

@viperx1 viperx1 commented Aug 21, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #39584

Type of change

  • Bug fix

What does this PR do?

mcp.timeout (e.g. 1200000) is passed through to the MCP SDK correctly, but on the Bun runtime a long MCP call that is silent for >300 s dies earlier with "The operation timed out." because Bun's fetch() enforces a default 300 s socket-idle timeout. The MCP timeout ceiling is never reached.

This adds an inline transport-level fetch that passes Bun's non-standard timeout: false to both StreamableHTTPClientTransport and SSEClientTransport, disabling Bun's idle timeout so the MCP SDK request timeout becomes the authoritative ceiling. This mirrors the same timeout: false already used for the provider fetch in provider.ts and the AI SDK fetch in core/src/aisdk.ts.

How did you verify your code works?

  • Built the Linux TUI binary and confirmed it compiles and successfully reaches timeouts higher than 300 s.
  • The change is additive (a transport fetch wrapper) and reuses an option already used in the provider path.

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Aug 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP timeout capped to 5 minutes.

1 participant