Repository navigation
Conversation
3 tasks
Resolves nested npx version mismatch when MCP server is started via `npx sequant serve` and sequant_run spawns `npx sequant run`. Uses process.argv[0]+argv[1] to invoke the same binary that's running, with fallback to __dirname-relative resolution and npx as last resort. Entire-Checkpoint: 642927b9261b
admarble
force-pushed
the
feature/389-mcp-server-prevent-nested-npx-version-mismatch-in-
branch
from
March 23, 2026 22:28
0d1b0fb to
1854dea
Compare
The existing tests verified that the __dirname-relative path was checked, but never tested the case where it succeeds (argv[1] absent but dist/bin/cli.js exists). This closes the last untested branch in resolveCliBinary().
Add troubleshooting entry for the nested npx version mismatch scenario that this fix addresses, with workarounds for older versions.
admarble
deleted the
feature/389-mcp-server-prevent-nested-npx-version-mismatch-in-
branch
March 23, 2026 22:34
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.
Summary
spawnSync("npx", ["sequant", "run", ...])withresolveCliBinary()that uses the current process's binary pathprocess.argv[0]+process.argv[1]to ensure the same version is invoked__dirname-relativedist/bin/cli.js, thennpxas last resortPre-PR AC Verification
sequant_runuses current process binary instead ofnpx sequantsrc/mcp/tools/run.ts:24-41—resolveCliBinary()server-extended.test.ts— 7 new tests verify binary resolutionTest plan
npm run build— passesnpm run lint— passesnpm test— 1764 tests pass (75 test files)resolveCliBinary()returnsprocess.argv(notnpx) when script existsspawnSyncis called with resolved binary, notnpxCloses #389
🤖 Generated with Claude Code