Skip to content

Disable CLI auto-upgrade, retain version warning#256

Closed
sigmachirality wants to merge 1 commit intomainfrom
cursor/cli-auto-upgrade-disable-3f94
Closed

Disable CLI auto-upgrade, retain version warning#256
sigmachirality wants to merge 1 commit intomainfrom
cursor/cli-auto-upgrade-disable-3f94

Conversation

@sigmachirality
Copy link
Member

Summary

Removes the automatic upgrade logic from the CLI that would silently run sf upgrade on patch version changes. This addresses the MODULE_NOT_FOUND crash reported in the Brev CLI context, where the auto-upgrade path could fail depending on the user's environment.

Changes

  • Removed the auto-upgrade code path in checkVersion() that ran execSync("sf upgrade") for patch updates and re-executed the user's original command
  • Removed the execSync import (no longer needed)
  • Removed the SF_CLI_DISABLE_AUTO_UPGRADE env var check (no longer relevant since auto-upgrade no longer exists)
  • Retained the yellow warning box that prompts users to run sf upgrade manually — now shown for all outdated versions (patch, minor, major), not just non-patch updates

Behavior

Before: Patch updates triggered an automatic sf upgrade + command re-run. Non-patch updates showed a warning box.

After: All outdated versions show a warning box prompting the user to manually run sf upgrade. No automatic upgrades occur.

Slack Thread

Open in Web Open in Cursor 

Remove the automatic upgrade logic that ran 'sf upgrade' for patch
updates, which could fail with MODULE_NOT_FOUND errors in certain
environments. The CLI now only shows a warning box prompting users
to run 'sf upgrade' manually when a newer version is available.

Also removes the SF_CLI_DISABLE_AUTO_UPGRADE env var check since
auto-upgrade no longer exists.

Co-authored-by: Daniel Tao <danieltaox@gmail.com>
@semanticdiff-com
Copy link

semanticdiff-com bot commented Mar 17, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  src/checkVersion.ts  8% smaller

@sigmachirality
Copy link
Member Author

Closing in favor of #246

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.

2 participants