fix: upgrade notification silently skipped in multiple scenarios#389
fix: upgrade notification silently skipped in multiple scenarios#389anandgupta42 merged 4 commits intomainfrom
Conversation
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>
There was a problem hiding this comment.
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.
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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"unknown"→ returned with no notification.catch(() => {})swallowed the error silentlyyarninstall method → detected but not inInstallation.upgrade()switch, threw silentlyALTIMATE_CLI_DISABLE_AUTOUPDATEenv var was documented but not wired up inflag.tsBefore (v0.5.2, no indicator):

After (indicator shown):

Type of change
Issue for this PR
Closes #388
How did you verify your code works?
ALTIMATE_CLI_DISABLE_AUTOUPDATEenv var not wired up)Checklist
Finding Attribution
autoupdate: falsemethod === "unknown"ALTIMATE_CLI_DISABLE_AUTOUPDATEenv var not functionalReviewed 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.