Repository navigation
fix(scripts): pass MCP callTool timeouts as request options - #2387
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
@modelcontextprotocol/client 2.3.1 declares callTool(params, options).
Three verifiers still used the v1 shape callTool(params, undefined,
{ timeout }), so the third argument was dropped and those calls ran
under the SDK's 60 s default instead of the 150-180 s they request.
Pass the options second.
6c8a43a to
926ba76
Compare
baron
left a comment
There was a problem hiding this comment.
Source verdict: APPROVE for 926ba7647d4e96cb24a1f0db02cc560838054e8b.
Five verifier calls now pass timeout options to the pinned SDK 2.3.1 owning callTool(params, options) boundary. They do not increase production timeouts or add another wrapper. The remaining three-argument calls belong to REA provider clients with a distinct signature, not the SDK; they are not mechanically rewritten.
Pinned validation: syntax checks on all three scripts, typecheck/lint, and an actual delayed in-memory SDK witness showing third-position timeout is ignored while second-position timeout rejects. Current-head hosted real JavaScript recovery and required Static/Test coverage/CI checks are green. Current-main object integration is clean.
Real Ghidra verification is author-reported, not independently rerun or claimed attested here. This narrow SDK options-placement correction changes no Ghidra producer/engine semantics. No provider installation, GUI operation or caller target execution was performed.
Review & Verification SummaryVerdict: LGTM (Approved) 🚀 1. Root Cause & Solution
2. Verification
|
Problem
@modelcontextprotocol/clientis pinned to 2.3.1, which declarescallTool(params, options). Three verifiers still use the v1 shapecallTool(params, undefined, { timeout }). The SDK drops the third argument, so those calls run under its 60 s default (DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4) instead of the timeout they request:scripts/verify-real-ghidra-mips.mjsscripts/verify-real-ghidra-mips.mjsscripts/verify-real-ghidra-mips.mjsscripts/verify-real-ghidra-mips-relocatable.mjsscripts/verify/javascript/recovery.mjsThey pass today because their fixtures are small. On a slow or cold host, any call over 60 s fails even though the script asked for more. That's how I ran into it: a Ghidra analysis of a firmware
libctakes about 71 s.Fix
Pass the options as the second argument. No other call site in
scripts/,src/ortests/uses the SDKClientwith three arguments; the remaining three-argumentcallToolcalls belong to REA's own provider clients, whose signature is(operation, params, options).Verification
Runtime demonstration (throwaway script against
scripts/rea.mjs mcp,binary_session):{ timeout: 1 }third{ timeout: 1 }secondSdkError: Request timed outAffected verifiers on this branch, all exit 0:
npm run verify:javascript:recovery, with the official Wakaru 1.14.0 binary (SHA-256 checked) and esbuild 0.25.10 / webpack 5.101.3 installed as in CI.npm run verify:ghidra:mips(Ghidra 12.1.4).npm run verify:ghidra:mips-relocatable(Ghidra 12.1.4).Formatting and lint:
oxfmt --checkandoxlinton the changed files.No persistent regression test: the affected calls are inline closures inside
.mjsverifier scripts, outside type checking. A behavioral test would need those wrappers exported and driven against a deliberately slow MCP server, which is a refactor beyond this fix. The runtime comparison above exercises the SDK behavior directly.