fix(windows): discover Cursor Agent CLI install dir - #4569
fix(windows): discover Cursor Agent CLI install dir#4569oteroantoniogom wants to merge 1 commit into
Conversation
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>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
ApprovabilityVerdict: 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. |
Summary
%LOCALAPPDATA%\cursor-agenttoresolveKnownWindowsCliDirsso Windows desktop can find the official Cursor Agent CLI even when the Electron process has a stale User PATH.Why
On Windows, the Cursor Agent installer places
agent.cmd/cursor-agent.cmdunder%LOCALAPPDATA%\cursor-agentand 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 reportCursor CLI command agent was not foundeven though the binary exists andagent --versionworks 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 absolutebinaryPath.Reproduced locally: installed CLI present + on User PATH, T3 still failed until
providers.cursor.binaryPathwas set to the absoluteagent.cmdpath. 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)agentorcursor-agent, ensure User PATH includes%LOCALAPPDATA%\cursor-agentbut launch T3 from a process that may have a stale PATH; Cursor provider should becomeinstalled/readywithout setting an absolute binary pathbinaryPathoverride still worksChecklist
Note
Low Risk
Small additive PATH fallback in shared shell utilities; no auth, security, or data-path changes.
Overview
Adds
%LOCALAPPDATA%\cursor-agentto the known Windows CLI install directories inresolveKnownWindowsCliDirs, soresolveWindowsEnvironmentprepends 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-agentcan be resolved without setting an absolutebinaryPath.Unit tests for
resolveKnownWindowsCliDirsandresolveWindowsEnvironmentPATH 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
resolveKnownWindowsCliDirsin shell.ts to include thecursor-agentdirectory underLOCALAPPDATAwhen that environment variable is defined. This brings Cursor Agent in line with otherLOCALAPPDATA-based tools already discovered on Windows.Macroscope summarized cbf8036.