Skip to content

test(mcp): fix three MCP boundary suites on native Windows - #2312

Merged
morluto merged 2 commits into
morluto:mainfrom
pablodiazjorge:test/windows-mcp-boundary
Oct 12, 2026
Merged

morluto merged 2 commits into
morluto:mainfrom
pablodiazjorge:test/windows-mcp-boundary

Conversation

@pablodiazjorge

Copy link
Copy Markdown
Contributor

Summary

Five tests in three MCP boundary suites fail on native Windows because of POSIX assumptions in the tests themselves; the product behaves correctly. No issue is linked: I found them while running the MCP boundary project on Windows for #2148, and the fix touches only these test files, like #2113.

Problem and expected behavior

Smallest trigger, on Windows: npx vitest run tests/boundary/mcp/dylibResolutionMcp.test.ts tests/boundary/mcp/electronMcp.test.ts tests/boundary/mcp/toolErrorSchemaDelivery.test.ts gives 5 failed and 18 passed on 0043d9b13. Expected: each test reaches its assertions and passes, or is skipped where its mechanism does not exist on Windows.

Test Failure on Windows Cause
dylibResolutionMcp › keeps a permission denied while canonicalizing the opened bundle expected undefined to be true chmod(parent, 0o000) does not deny access on Windows
dylibResolutionMcp › reports caller-selected roots that cannot be traced as invalid input EPERM: operation not permitted, symlink 'C:\bin\ls' -> '<tmp>\…\Contents\MacOS\outside' File symlinks need Developer Mode or an elevated token
electronMcp › exposes endpoint-scoped Electron discovery and inspection as Evidence file_path: "C:\\…\\index.html" does not match /\/index\.html$/u REA returns native paths; the patterns expect /
electronMcp › runs active Electron scenarios with selected paths and inferred working directory ENOENT: no such file or directory, symlink '<tmp>\rea-electron-active-mcp-…' -> '<tmp>\C:\…\rea-electron-active-mcp-…-alias' root.split("/") returns the whole path, so the alias path is doubled
toolErrorSchemaDelivery › delivers typed tool failures without violating the advertised success schema over stdio expected '{"error":{"code":"target_unavailable"…' to contain 'C:\…\not-present.bin' The raw path is searched inside JSON.stringify(...), where backslashes are escaped

Change and scope

  • dylibResolutionMcp.test.ts:
    • The chmod-based permission test is skipped on Windows with the condition other chmod tests already use: it.skipIf(process.platform === "win32" || process.getuid?.() === 0).
    • In the caller-selected roots test, only the outside-root case needs the /bin/ls symlink. The three other roots now also run on Windows; the symlink and its case are added where the platform is not Windows.
  • electronMcp.test.ts:
    • The three file_path patterns accept either separator (/[\\/]index\.html$/u, and the same for app.js and worker.js).
    • The alias name uses basename(root), and the alias is a junction on Windows, which needs no symlink privilege. It stays a dir symlink elsewhere.
  • toolErrorSchemaDelivery.test.ts: the diagnostic is searched for the JSON-encoded path, JSON.stringify(missing).slice(1, -1). On POSIX this is the same string as before.

No product code changes. On Linux and macOS every changed line behaves as before: [\\/] matches /, basename returns the last / segment, the symlink type and the outside-root case are unchanged, and JSON encoding leaves a temporary path with no backslashes or quotes as it is.

Contribution scope: not applicable (test-only fix within existing boundaries).

Contract and boundary impact

  • Semantic owner and earliest changed stage: test files only.
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: none; the tests now run on native Windows.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

Evidence and regression coverage

  • Tests added or updated: the three files above. On Windows, one test is skipped (the chmod denial) and the outside-root case of another does not run; everything else now runs there.
  • Base reproduction or other evidence: on 0043d9b13 the command above gives 5 failed, 18 passed on Windows; the errors are in the table.
  • User-visible CLI/MCP output (if applicable): not applicable.
  • Remaining proof gaps: Linux and macOS were not run locally; CI covers them.

Validation performed

Windows 11 26H2 x64, non-elevated, Node 22.22.3, with a locally built Windows native addon in native/windows/build (the JavaScript analysis tests in electronMcp need the Windows native controls).

  • npx vitest run tests/boundary/mcp/dylibResolutionMcp.test.ts tests/boundary/mcp/electronMcp.test.ts tests/boundary/mcp/toolErrorSchemaDelivery.test.ts on 0043d9b13: 5 failed, 18 passed.
  • The same command with this change: 22 passed, 1 skipped.
  • npx vitest run --project mcp-boundary with this change: 98 files passed, 6 skipped; 420 tests passed, 13 skipped, 0 failed.
  • npm run check:fast: passed.
  • npx oxfmt --check on the three files: passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: native Windows for these suites; no provider involved.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none; tests only.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@morluto
morluto merged commit a97b713 into morluto:main Oct 12, 2026
@github-actions github-actions Bot mentioned this pull request Oct 12, 2026
3 tasks done
@morluto morluto added area: tests Test suite and verification area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
@morluto morluto added the area: mcp MCP server, transport, and tool registration label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: mcp MCP server, transport, and tool registration area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior area: tests Test suite and verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants