Skip to content

fix(windows): discover Cursor Agent CLI install dir - #4569

Open
oteroantoniogom wants to merge 1 commit into
pingdotgg:mainfrom
oteroantoniogom:fix/windows-cursor-agent-known-cli-dir
Open

fix(windows): discover Cursor Agent CLI install dir#4569
oteroantoniogom wants to merge 1 commit into
pingdotgg:mainfrom
oteroantoniogom:fix/windows-cursor-agent-known-cli-dir

Conversation

@oteroantoniogom

@oteroantoniogom oteroantoniogom commented Jul 26, 2026

Copy link
Copy Markdown

Summary

  • Add %LOCALAPPDATA%\cursor-agent to resolveKnownWindowsCliDirs so Windows desktop can find the official Cursor Agent CLI even when the Electron process has a stale User PATH.
  • Update shell unit tests that assert the known-dir PATH composition.

Why

On Windows, the Cursor Agent installer places agent.cmd / cursor-agent.cmd under %LOCALAPPDATA%\cursor-agent and updates User PATH. T3's Electron process can still miss that PATH entry (common after install without a full relaunch from a parent with a fresh environment). Provider health checks then report Cursor CLI command agent was not found even though the binary exists and agent --version works in a refreshed shell.

T3 already prepends known Windows CLI dirs (npm, node, Volta, pnpm, bun, scoop) via resolveWindowsEnvironment. Including the Cursor Agent install dir follows that pattern and removes the need for users to hardcode an absolute binaryPath.

Reproduced locally: installed CLI present + on User PATH, T3 still failed until providers.cursor.binaryPath was set to the absolute agent.cmd path. After this fallback, discovery should succeed without that workaround.

Official install docs: https://cursor.com/docs/cli/installation

Test plan

  • vp test run packages/shared/src/shell.test.ts (29/29 pass)
  • On Windows desktop: install Cursor CLI, leave default/binary name agent or cursor-agent, ensure User PATH includes %LOCALAPPDATA%\cursor-agent but launch T3 from a process that may have a stale PATH; Cursor provider should become installed / ready without setting an absolute binary path
  • Confirm absolute binaryPath override still works

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • No UI changes

Note

Low Risk
Small additive PATH fallback in shared shell utilities; no auth, security, or data-path changes.

Overview
Adds %LOCALAPPDATA%\cursor-agent to the known Windows CLI install directories in resolveKnownWindowsCliDirs, so resolveWindowsEnvironment prepends that folder to PATH the same way it already does for npm, Node, Volta, pnpm, bun, and scoop.

This is meant to fix Cursor provider health checks when the Electron process has a stale User PATH after installing the official Cursor Agent CLI, so agent / cursor-agent can be resolved without setting an absolute binaryPath.

Unit tests for resolveKnownWindowsCliDirs and resolveWindowsEnvironment PATH composition were updated to include the new directory.

Reviewed by Cursor Bugbot for commit cbf8036. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add Cursor Agent CLI install dir to Windows PATH discovery

Extends resolveKnownWindowsCliDirs in shell.ts to include the cursor-agent directory under LOCALAPPDATA when that environment variable is defined. This brings Cursor Agent in line with other LOCALAPPDATA-based tools already discovered on Windows.

Macroscope summarized cbf8036.

Electron processes can miss a newly updated User PATH, so T3 failed to
find agent/cursor-agent even when the official Windows installer had
placed binaries under %LOCALAPPDATA%\cursor-agent. Include that directory
in the known Windows CLI PATH fallbacks, matching npm/node/volta/pnpm.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 634d787e-0868-4110-ad49-c71a64208c2d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Jul 26, 2026
@macroscopeapp

macroscopeapp Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

This change simply adds 'cursor-agent' to the list of known Windows CLI directories to search, following the existing pattern. It's a minimal, additive change with updated tests and no runtime risk.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant