Skip to content

fix(agent-plugin): restore the non-Windows branch of the .mcp.json MCP launcher - #167

Merged
adityankale190895 merged 2 commits into
DiffCI:mainfrom
FredApps:fix/agent-plugin-mcp-launcher
Nov 18, 2026
Merged

adityankale190895 merged 2 commits into
DiffCI:mainfrom
FredApps:fix/agent-plugin-mcp-launcher

Conversation

@FredApps

@FredApps FredApps commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #166

What changed

integrations/agent-plugin/.mcp.json launches the DiffCI MCP server with node -e "<script>". Since the 0.3.11 version bump (1bb4bb7) its script has been a ternary with no : branch, so Node rejects it with SyntaxError: Unexpected token ';' and the server never starts for the Codex plugin (.codex-plugin/plugin.json → ./.mcp.json) or Claude Code. This PR puts back : spawn('npx', npxArgs, { stdio: 'inherit' }), so the script is again identical to the one in mcp.json.

Regression test

tests/agent-plugin-launchers.test.ts (added to release-files.json):

  • compiles the node -e script from both mcp.json and .mcp.json with vm.Script;
  • asserts the two launchers are the same script, so a version bump can't let them drift again;
  • compiles the Muse launcher too.

Before the fix, the .mcp.json compile test and the "same script" test fail. After it, all four pass.

Validation

  • npx tsx --test tests/agent-plugin-launchers.test.ts: 4/4 pass (2 failed before the fix).
  • npm run agent:check and npm run audit:boundary pass.
  • I ran the fixed launcher by hand with an MCP initialize request on stdin. It answered {"serverInfo":{"name":"diffci-mcp","version":"0.3.54"}}.

Not covered

The Windows cmd.exe branch is unchanged and not exercised here.

Follow-up (also fixed here): diffci init writes the same launcher (mcpServerEntry in packages/diffci-cli/src/client/agent-setup.ts), with the same missing non-Windows branch. With only the plugin files fixed, the CLI test init must launch MCP exactly like the portable plugin fails; CI runs only typecheck and build for diffci-cli, so it was not visible. mcpServerEntry now has the same branch, and a new root test in tests/agent-plugin-launchers.test.ts checks that init's launcher compiles and equals the plugin's (it fails without the fix). The CLI's cli-agent.test.ts MCP test passes again; its two other failures are the known main ones (#193, #196).

…P launcher

The 0.3.11 version bump dropped ": spawn('npx', ...)" from the node -e
script, leaving a ternary with no else branch, so the Codex and Claude
Code launcher was a SyntaxError on every platform.

Fixes DiffCI#166

Signed-off-by: FredApps <[email protected]>

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cross-review at 0eba80f.

Checked:

  • The restored : spawn('npx', npxArgs, { stdio: 'inherit' }) branch makes .mcp.json the same script as mcp.json again.
  • tests/agent-plugin-launchers.test.ts fails without the fix (the .mcp.json compile test and the same-script test) and passes with it.
  • The branch is up to date with main, and CI is green.

Fixed: nothing needed.

Open: the Windows cmd.exe branch still isn't exercised, as the PR says.

mcpServerEntry builds the launcher init writes into the agents' MCP configuration, and it had the same broken ternary as the plugin's .mcp.json. With only the plugin fixed, cli-agent.test.ts ('init must launch MCP exactly like the portable plugin') fails; CI does not run the CLI test suite, so it did not show. A root test now checks that init's launcher compiles and matches the plugin's; it fails without this change.

Signed-off-by: FredApps <[email protected]>
@FredApps
FredApps marked this pull request as ready for review November 18, 2026 01:14
@adityankale190895
adityankale190895 merged commit a52ae2c into DiffCI:main Nov 18, 2026
13 checks passed
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.

Agent plugin: the .mcp.json MCP launcher is a syntax error, so the DiffCI MCP server never starts

2 participants