Skip to content

fix: restore install after leftover Bun shims on Windows - #735

Merged
Drswith merged 1 commit into
mainfrom
cursor/windows-bun-residual-shim-install-2e7e
Sep 8, 2026
Merged

fix: restore install after leftover Bun shims on Windows#735
Drswith merged 1 commit into
mainfrom
cursor/windows-bun-residual-shim-install-2e7e

Conversation

@Drswith

@Drswith Drswith commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Summary

On bun-only Windows machines, the advertised Pi migration (quantex uninstall pi then quantex install pi) dead-ended. Bun leaves {name}.exe and {name}.bunx in its global bin after bun remove -g (oven-sh/bun#11970). Uninstall then reported another copy on PATH, and install fail-closed because a missing npm executable was treated as inconclusive package presence ("npm could not determine whether … is installed").

This change unblocks that path without expanding commands or the published SDK:

  • A missing package-manager executable (spawn ENOENT) is provider-unavailable, not inconclusive presence.
  • Catalog observation skips unavailable providers, so a missing npm does not block a conclusive bun absence.
  • Leftover PATH hits under Bun's global bin are not live ownership when bun is conclusively absent and no exact provider is presence-inconclusive, so install decide selects install.
  • After a successful bun package removal, Quantex removes a proven-unchanged Windows {binary}.exe / {binary}.bunx pair from bun pm bin -g.
  • If a leftover PATH copy still remains, the conflicting-source uninstall message names that .exe / .bunx pair.

Genuine inconclusive probes from an available provider with PATH present stay fail-closed.

Fixes #733.

Linked Artifacts

Validation

  • bun run memory:check
  • bun run lint
  • bun run format:check
  • bun run typecheck
  • bun run test (if behavior changed)
  • bun run openspec:validate

Local results: 2187 passed, 5 skipped; OpenSpec 26/26; project memory check passed.

Test plan for the reported regressions:

  • npm spawn ENOENT → Core observation unavailable, not indeterminate presence
  • leftover /.bun/bin/ PATH + preferred bun absent + npm unavailable → observation absent → decide install
  • leftover PATH + bun absent + npm indeterminate (npm available but probe unresolved) → still fail-closed
  • leftover PATH + bun absent + npm absent → observe absent → decide install
  • PATH copy outside Bun's global bin stays untracked / external-preserved
  • bun uninstall removes an unchanged .exe/.bunx pair and preserves changed or sidecar-less files

Release Intent

  • Release: patch - bug fix

Release Summary

BEGIN_COMMIT_OVERRIDE
fix: restore install after leftover Bun shims on Windows

On Windows machines that only have bun, uninstalling then reinstalling an agent such as Pi could fail because bun left .exe and .bunx shims behind and a missing npm was treated as an unknown install. Quantex now removes those proven leftover shims and continues install when npm is not installed.
END_COMMIT_OVERRIDE

Docs Updated

  • openspec/changes/windows-bun-residual-shim-lifecycle/
  • Follow-up issue or OpenSpec change created instead

Scope Check

  • I did not add a new ad hoc root-level Markdown file.
  • I updated the relevant issue, ADR, spec, runbook, or captured the missing doc work as follow-up.
  • I did not silently expand project scope without recording it explicitly.

Closure Check

  • Working tree was clean after commit.
  • Branch was pushed and this PR is the active delivery artifact.
  • OpenSpec change is not needed, still active until this merge, active across milestone merges by design, queued for agent-driven archive closure after completion, or already archived.
  • Release is not applicable, delegated to release automation, or verified.

Notes

Keep this PR draft until the product CI matrix (Ubuntu, Windows, macOS) is green. Do not tag a release in this PR; release-please should consume the user-facing patch override after merge. OpenSpec archive closure waits until this implementation PR merges and the change is archive-eligible.

JSON, aliases, exit codes, state v2, and receipts are unchanged. --json does not expose engine or route. No YAML, release-core.yml, or protect-main edits. No SDK or command expansion. Issues #734 and #134 were not started.

Open in Web Open in Cursor 

On bun-only Windows, uninstalling then reinstalling an agent such as Pi
could fail because bun left .exe and .bunx shims behind and a missing npm
was treated as an unknown install. Treat a missing package manager as
unavailable, remove proven leftover Bun Windows shims, and let install
continue when only those leftovers remain.
@Drswith
Drswith marked this pull request as ready for review September 8, 2026 15:02
@Drswith
Drswith merged commit 8b1d58e into main Sep 8, 2026
11 checks passed
@Drswith
Drswith deleted the cursor/windows-bun-residual-shim-install-2e7e branch September 8, 2026 15:06
Drswith added a commit that referenced this pull request Sep 8, 2026
Sync accepted agent-uninstall and lifecycle-reconciliation deltas into
living specs after #735, and drop the completed change from the working tree.

Co-authored-by: Cursor Agent <cursoragent@cursor.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.

[Bug]: qtx install pi fails with "could not determine the installed state" on bun-only Windows machines

2 participants