Skip to content

fix: resolve cursor environment execution issues on Windows and improve cross-platform PATH handling#409

Open
codebysana wants to merge 1 commit into
LF-Decentralized-Trust-labs:mainfrom
codebysana:fix/cursor-env-windows-execution
Open

fix: resolve cursor environment execution issues on Windows and improve cross-platform PATH handling#409
codebysana wants to merge 1 commit into
LF-Decentralized-Trust-labs:mainfrom
codebysana:fix/cursor-env-windows-execution

Conversation

@codebysana

Copy link
Copy Markdown
Contributor

Summary

This PR fixes failures in the Cursor adapter environment tests on Windows by improving how the fake agent command is executed and ensuring proper cross-platform command resolution.

It also resolves inconsistencies in environment variable handling for PATH vs Path, which was causing command execution to fail in some environments.

After these changes, all related adapter environment tests are now passing successfully on both Windows and non-Windows systems.

Changes

1. Fix fake agent command execution on Windows

Updated writeFakeAgentCommand to properly support Windows execution using a .cmd shim.

  • On Windows:
    • Creates agent.cmd
    • Delegates execution to agent.js using Node
  • On Unix-like systems:
    • Uses a direct executable script (agent)
    • Ensures correct permissions via chmod

This ensures consistent behavior across platforms when spawning the fake agent.

2. Improve cross-platform PATH resolution

Updated server-utils.ts to correctly resolve executable paths across environments:

  • Supports both PATH and Path environment variables
  • Adds fallback to process.env values for reliability
  • Prevents command resolution failures on Windows systems where casing differs

3. Stabilize test execution environment

These changes ensure:

  • No ENOENT or spawn failures during test runs
  • Agent commands resolve correctly in Windows temp environments
  • Adapter environment diagnostics run consistently across platforms

Testing

All tests now pass successfully:

pnpm test cursor-local-adapter-environment

Verified on:

  • Windows (PowerShell)
  • Cross-platform CI-like environments

Result

  • Cursor adapter environment tests stabilized
  • Cross-platform command execution fixed
  • Windows compatibility improved for agent bootstrap flow

…ve PATH handling

Signed-off-by: codebysana <sana.younas0530@gmail.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