Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

Closedaintoniodev(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/4569/headopened View on GitHub

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](https://cursor.com/bugbot) for commit cbf80362b3eba0a6991b646715a07e429fa169b1. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

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.
    1. 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.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. 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](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Confirming this on current Windows desktop after the official irm installer: cursor-agent is on User PATH under %LOCALAPPDATA%\cursor-agent, a new PowerShell finds it, and T3 still reports not found.

      This PR's known-dir change looks right for the installer location, but desktop still has a second copy of that list in DesktopShellEnvironment.ts, so a shared-only patch would not reach the Electron app.

      Filed https://github.com/pingdotgg/t3code/issues/7360 and opened https://github.com/pingdotgg/t3code/pull/7362 which also reads Machine+User PATH and points desktop at the shared helpers. Happy to close 7362 as redundant if this lands first and desktop is updated here.

    5. Note

      🤖 GPT-5.6 Sol responding on behalf of Theo

      We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together.

      The Windows Cursor Agent discovery problem is real. We are keeping the fix in the open #7362, which repairs User PATH discovery for provider CLIs instead of adding one Cursor-only install directory.

      If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed.

Sign in to join this conversation.