Add urgent upgrade warning when CLI is many versions behind#163
Conversation
When the installed CLI is a full major version or 5+ minor versions behind the latest release, escalate the periodic update banner from "A new release is available" to "You are running a very old version and should upgrade as soon as possible".
Three changes on top of the urgent-upgrade-warning banner: 1. IsVeryOldVersion now requires a 2+ major gap (not any major gap). This avoids telling every up-to-date v0.x user "you are running a very old version" the moment v1.0.0 ships. The 5-minor rule inside the same major is unchanged. 2. MaybeShowMessage skips when stdout is not a terminal. Pipes, redirects, and CI logs no longer get banner text mixed into machine-readable output (e.g. `kernel browsers list -o json | jq`). 3. printUpgradeMessage now writes to stderr instead of stdout, so the banner stays out of stdout in any edge case the TTY check misses. Tests updated: dropped the single-major-bump escalation case and added coverage for the v0.x → v1.0 cusp plus a true 2-major gap. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Firetiger deploy monitoring skipped This PR didn't match the auto-monitor filter configured on your GitHub connection:
Reason: PR modifies CLI update warning logic, not kernel API endpoints or Temporal workflows as specified in the filter. To monitor this PR anyway, reply with |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5841202. Configure here.

Summary
The CLI already shows a friendly "a new release is available" banner once a day via
update.MaybeShowMessage. This adds a louder variant for users who are very far behind modeled on the Pulumi-style "you are running a very old version and should upgrade as soon as possible" prompt.A version is considered "very old" when either:
When that condition fires, the banner switches from
pterm.Infotopterm.Warningand uses urgent copy. Otherwise behavior is unchanged.Test plan
go test ./pkg/update/...passes (addedTestIsVeryOldVersioncovering same-version, one/four/five minor behind, major bump, patch-only, v-prefix, non-semver).go build ./...succeeds.Note
Low Risk
Low risk: changes are limited to update-notification messaging and when the banner is shown (TTY-only), with no impact on core command execution beyond suppressing output in piped/redirected scenarios.
Overview
Adds a new
IsVeryOldVersionsemver check (2+ major versions behind, or 5+ minors behind within the same major) and uses it to escalate the update banner frompterm.Infoto a more urgentpterm.Warningmessage.Upgrade messaging is now consistently written to stderr, and
MaybeShowMessageskips printing the banner when stdout is not a TTY (e.g., piped/redirected). A dedicatedTestIsVeryOldVersionsuite covers the new version-threshold logic and error cases.Reviewed by Cursor Bugbot for commit 26c8729. Bugbot is set up for automated code reviews on this repo. Configure here.