Skip to content

fix: upgrade notification silently skipped in multiple scenarios#389

Merged
anandgupta42 merged 4 commits intomainfrom
fix/upgrade-notification-silent-skip
Mar 23, 2026
Merged

fix: upgrade notification silently skipped in multiple scenarios#389
anandgupta42 merged 4 commits intomainfrom
fix/upgrade-notification-silent-skip

Conversation

@anandgupta42
Copy link
Contributor

What does this PR do?

Fixes the upgrade notification being silently suppressed — users on older versions (e.g., 0.5.2) never saw the upgrade indicator or toast notification when a newer version (e.g., 0.5.7) was available.

Root causes fixed:

  • autoupdate: false / OPENCODE_DISABLE_AUTOUPDATE → returned with no notification at all
  • Install method "unknown" → returned with no notification
  • Auto-upgrade failure → .catch(() => {}) swallowed the error silently
  • yarn install method → detected but not in Installation.upgrade() switch, threw silently
  • No semver guard against downgrading canary/preview users
  • ALTIMATE_CLI_DISABLE_AUTOUPDATE env var was documented but not wired up in flag.ts

Before (v0.5.2, no indicator):
upgrade-no-indicator

After (indicator shown):
upgrade-indicator-shown

Type of change

  • Bug fix (non-breaking change that fixes an issue)

Issue for this PR

Closes #388

How did you verify your code works?

  • 82 unit tests passing (34 new decision logic tests + 48 existing upgrade indicator tests)
  • Typecheck passing
  • Manual verification: installed v0.5.2, captured screenshot showing no indicator (bug), then ran fixed dev build showing indicator working
  • Multi-model code review (Claude + GPT 5.2 Codex + Gemini 3.1 Pro + Kimi K2.5 + GLM-5): found and fixed additional bug (ALTIMATE_CLI_DISABLE_AUTOUPDATE env var not wired up)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes

Finding Attribution

Issue Origin Type
Silent skip on autoupdate: false Claude Unique
Silent skip on method === "unknown" Claude Unique
Auto-upgrade failure swallowed silently Claude Unique
Semver downgrade prevention Claude Unique
Yarn method handling Claude Unique
ALTIMATE_CLI_DISABLE_AUTOUPDATE env var not functional GPT 5.2 Codex, Gemini 3.1 Pro Consensus
Test logic duplication concern GPT, Gemini, Kimi, GLM-5 Consensus (accepted as tradeoff)

Reviewed by 6 models: Claude, GPT 5.2 Codex, Gemini 3.1 Pro, Kimi K2.5, MiniMax M2.5, GLM-5. No convergence rounds needed — MAJOR finding fixed inline.

anandgupta42 and others added 3 commits March 22, 2026 17:22
The upgrade indicator was never shown when:
- `autoupdate` was `false` or `OPENCODE_DISABLE_AUTOUPDATE` was set
- Install method was `"unknown"` or `"yarn"`
- Auto-upgrade failed (error swallowed by `.catch(() => {})`)

Additionally, there was no guard against downgrading canary/preview users
to an older stable release.

Changes:
- Always publish `UpdateAvailable` event so the indicator and toast appear
- Add `semver.gte()` guard to prevent downgrades
- Add `log.warn()` for `latest()` fetch failures and auto-upgrade errors
- Handle `yarn` install method explicitly (detected but not auto-upgradeable)
- Add 34 tests covering every decision path in `upgrade()`
- Update docs: clarify `autoupdate` config values, add upgrade indicator note

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- `readFile` mock return type mismatch (string vs Buffer)
- `count` mock missing `context` and `rule` keys

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The documented env var `ALTIMATE_CLI_DISABLE_AUTOUPDATE` was not functional —
`flag.ts` only read the legacy `OPENCODE_DISABLE_AUTOUPDATE`. Updated to use
`altTruthy()` pattern matching other flags in the codebase.

Found during multi-model code review (GPT 5.2 Codex, Gemini 3.1 Pro).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai
Copy link

coderabbitai bot commented Mar 23, 2026

Warning

Rate limit exceeded

@anandgupta42 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 20 minutes and 12 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5fc00864-6ef1-44fe-9487-6b92c171bd03

📥 Commits

Reviewing files that changed from the base of the PR and between e71d1fa and 8f97b09.

⛔ Files ignored due to path filters (2)
  • docs/docs/assets/images/upgrade-indicator-shown.png is excluded by !**/*.png
  • docs/docs/assets/images/upgrade-no-indicator.png is excluded by !**/*.png
📒 Files selected for processing (7)
  • docs/docs/configure/config.md
  • docs/docs/reference/troubleshooting.md
  • docs/docs/usage/cli.md
  • packages/opencode/src/cli/upgrade.ts
  • packages/opencode/src/flag/flag.ts
  • packages/opencode/test/altimate/training-import.test.ts
  • packages/opencode/test/cli/upgrade-decision.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/upgrade-notification-silent-skip

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 and usage tips.

@anandgupta42 anandgupta42 merged commit b482df9 into main Mar 23, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade notification silently skipped — users never see update indicator

1 participant