Skip to content

feat: Windows platform support#55

Open
Nomadcxx wants to merge 12 commits intomainfrom
feat/windows-support
Open

feat: Windows platform support#55
Nomadcxx wants to merge 12 commits intomainfrom
feat/windows-support

Conversation

@Nomadcxx
Copy link
Owner

@Nomadcxx Nomadcxx commented Mar 17, 2026

Summary

  • Binary resolution (src/utils/binary.ts): New resolveCursorAgentBinary() module with dependency injection for testability. Resolution priority: CURSOR_AGENT_EXECUTABLE env → Windows known path (%LOCALAPPDATA%\cursor-agent\cursor-agent.cmd) → Unix known paths → PATH fallback
  • Windows spawn compatibility: All Node.js spawn() calls now include shell: process.platform === "win32". Fixed command injection in plugin.ts Node models endpoint (execSyncexecFileSync). killSignal omitted on win32 where POSIX signals aren't supported
  • Multi-instance proxy reuse fix: canonicalizePathForCompare and normalizeWorkspaceForCompare now lowercase on win32 (in addition to darwin) for case-insensitive filesystem path comparison — the actual fix for the multi-instance workspace collision bug on Windows
  • Node fallback tools (src/tools/defaults.ts): nodeFallbackGrep and nodeFallbackGlob for Windows where grep/find aren't available — correct regex escaping, discriminated catch blocks, result caps (100/50), skips node_modules/.git/dist/build
  • Provider detection (src/plugin-toggle.ts): cursor-acp in provider config object now correctly enables the plugin (before plugin array check)

What was fixed from PR #52

PR #52 by @intisy had the right idea but contained several critical bugs that had to be rewritten:

  • package.json "type": "commonjs" — broke all ESM consumers (reverted to "module")
  • isReusableProxyHealthPayload gutted to return true — cross-workspace proxy hijack regression (left intact; root cause was canonicalizePathForCompare not lowercasing on win32)
  • execSync(binary + " models") string concat — command injection vector (fixed to execFileSync)
  • nodeFallbackGrep/nodeFallbackGlob — broken regex escaping, literal \\n strings instead of newlines, empty catch {} blocks (full rewrite)
  • chat.headers hook — does not exist in the OpenCode plugin SDK (removed)

Test Plan

  • 524 unit tests pass, 0 fail (bun test tests/)
  • Build clean: bun run build
  • Verify cursor-agent launches correctly on Windows with the new binary resolution
  • Verify multi-instance proxy reuse works correctly when two instances share a workspace path differing only in case (Windows)
  • Verify grep/glob tools fall back to Node.js implementations on Windows

Co-authored-by: Finn Birich intisy@users.noreply.github.com

Nomadcxx and others added 12 commits March 17, 2026 22:23
Add utility to centralize cross-platform binary resolution logic
with support for Windows PATH lookup.
Co-authored-by: Finn Birich <intisy@users.noreply.github.com>
…leSync fix, binary resolution

Co-authored-by: Finn Birich <intisy@users.noreply.github.com>
…for correct multi-instance proxy reuse

Co-authored-by: Finn Birich <intisy@users.noreply.github.com>
Co-authored-by: Finn Birich <intisy@users.noreply.github.com>
…ble)

Co-authored-by: Finn Birich <intisy@users.noreply.github.com>
- Add provider object detection in isCursorPluginEnabledInConfig()
- Check for cursor-acp in provider block before plugin array fallback
- Add 2 tests for provider-based detection
- Update README with Windows badge, PowerShell install snippet, and platform notes
- Update comparison table to show Windows support
- Add Windows config path note to install documentation
…ish ENOENT in single-file catch

Co-authored-by: Finn Birich <intisy@users.noreply.github.com>
…rovider test

Co-authored-by: Finn Birich <intisy@users.noreply.github.com>
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