Skip to content

feat(compat): canonical codegraph shim launcher and installer for Windows - #341

Merged
ardelperal merged 4 commits into
mainfrom
feat/canonical-codegraph-shim-v2
Nov 28, 2026
Merged

ardelperal merged 4 commits into
mainfrom
feat/canonical-codegraph-shim-v2

Conversation

@ardelperal

Copy link
Copy Markdown
Owner

Adds scripts/compat/: a Go launcher that exposes the fork's installed @aroman22/codegraph-vba package as the canonical codegraph command, for tools that expect it (gentle-ai, MCP entries), and install-codegraph-shim.ps1 to build and install it.

  • Argv is passed structured (node npm-shim.js args...), never through cmd /c.
  • npm root -g is tried first, bounded to 2s, then the fixed paths. A stale old install under the user profile never wins over the current global install when npm answers.
  • CODEGRAPH_NPM_SHIM must be absolute and is used symlink-resolved.
  • The installer builds to a temp file and replaces the exe, and reports when a running MCP server holds it. The user PATH is appended through the registry as REG_EXPAND_SZ. Removal is documented.
  • 7 Go unit tests cover the lookup order, the override and the npm timeout. The PowerShell PATH merge was checked against a scratch registry key.

Native review approved. Non-blocking follow-ups: a stderr note when the npm lookup times out, a Job Object so a force-killed launcher does not orphan node, an absolute-path check for CODEGRAPH_SHIM_DIR, exit 9009 on Unix, and an orphaned npm grandchild on timeout.

- npm root -g stops after 2s and falls through to the fixed paths, so a
  stalled npm can no longer hang the MCP server
- CODEGRAPH_NPM_SHIM must be absolute and is used symlink-resolved
- the installer builds to a temp file and replaces codegraph.exe,
  reporting a running MCP server that holds the file
- the user PATH is appended through the registry as REG_EXPAND_SZ,
  keeping existing %VAR% entries verbatim; removal is documented
- Go unit tests for the lookup order, override and npm timeout
@ardelperal
ardelperal merged commit 14e0bed into main Nov 28, 2026
5 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.

1 participant