Make remote tool-call timeout configurable, lift 60s SDK default#36
Merged
Conversation
eshwar-sundar-glean
requested review from
garvit-scio,
mohit-gupta-glean and
swarup-padhi-glean
as code owners
July 3, 2026 07:07
Every downstream tool call went through callRemoteTool ->
client.callTool({ name, arguments }) with no options, so the MCP SDK
applied its hardcoded DEFAULT_REQUEST_TIMEOUT_MSEC (60s). Any tool that
took longer than 60s failed with RequestTimeout.
Pass an explicit per-call timeout, configurable via
GLEAN_REMOTE_TOOL_TIMEOUT_MS (positive integer, default 300000ms /
5 min, mirroring HITL_TIMEOUT_MS). Falls back to the default on
unset/invalid/non-positive values.
- src/remote-client.ts: add exported remoteToolTimeoutMs(); thread the
timeout into callTool's request options.
- README.md: document the new env var.
- tests: cover the helper and callRemoteTool's timeout passthrough;
update find-skills assertions for the new three-arg callTool signature.
eshwar-sundar-glean
force-pushed
the
fix-remote-tool-timeout
branch
from
July 3, 2026 07:15
f1fce93 to
51573da
Compare
swarup-padhi-glean
approved these changes
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Customer escalation - Chat failure
Every downstream tool call went through
callRemoteTool→client.callTool({ name, arguments })with no options, so the MCP SDK applied its hardcodedDEFAULT_REQUEST_TIMEOUT_MSEC(60s). Any tool that took longer than 60s — invoked viarun_tool,find_skills, or the remote passthrough — failed withRequestTimeout.Fix
Pass an explicit per-call
timeouttocallTool, configurable via a new env varGLEAN_REMOTE_TOOL_TIMEOUT_MS:300000(5 min), mirroringHITL_TIMEOUT_MS.resetTimeoutOnProgress), so its name means exactly what it says. Easy to extend later for progress-streaming tools if needed.Changes
src/remote-client.ts— add exportedremoteToolTimeoutMs(); thread the timeout intocallTool's request options (resultSchemapassed asundefinedto keep the SDK default).README.md— document the new env var in the config table.tests/remote-client.test.ts— coverremoteToolTimeoutMs()(default, override, non-numeric, zero/negative) andcallRemoteTool(timeout passthrough + contentless-result normalization).tests/find-skills.test.ts— update assertions for the new three-argcallToolsignature.Plugin manifests auto-bumped to
0.2.38by the pre-commit hook.Verification
tsc --noEmitcleanGLEAN_REMOTE_TOOL_TIMEOUT_MSis present in the rebuiltplugins/glean/dist/index.jsUsage
Set in the host's MCP
envblock or shell, e.g.GLEAN_REMOTE_TOOL_TIMEOUT_MS=600000for a 10-minute ceiling.