fix(mcp-adapters): preserve timeout from RunnableConfig in MCP tool calls #9165
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The timeout value from RunnableConfig was being lost when calling MCP tools because ensureConfig() converts it to an AbortSignal and removes the numeric timeout field. This prevented the MCP SDK from receiving explicit timeout values.
Changes:
This ensures MCP tools respect timeouts passed through RunnableConfig, allowing callers to override default timeouts on a per-call basis.
Why deleting timeout is necessary (as it is so far)
If an integration needs the numeric value later (e.g., to pass to an SDK that expects timeout), preserve it out-of-band (e.g., via metadata) and still use signal for actual cancellation.
Fixes #9136