Commit b482df9
fix: upgrade notification silently skipped in multiple scenarios (#389)
* fix: upgrade notification silently skipped in multiple scenarios
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>
* fix: pre-existing typecheck errors in `training-import.test.ts`
- `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>
* fix: wire up `ALTIMATE_CLI_DISABLE_AUTOUPDATE` env var using `altTruthy`
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>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent e71d1fa commit b482df9
File tree
9 files changed
+395
-8
lines changed- docs/docs
- assets/images
- configure
- reference
- usage
- packages/opencode
- src
- cli
- flag
- test
- altimate
- cli
9 files changed
+395
-8
lines changedLoading
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
115 | 124 | | |
116 | 125 | | |
117 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
8 | 13 | | |
9 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
10 | 18 | | |
11 | 19 | | |
12 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
13 | 34 | | |
| 35 | + | |
14 | 36 | | |
15 | 37 | | |
16 | 38 | | |
17 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
18 | 46 | | |
19 | 47 | | |
20 | 48 | | |
21 | | - | |
22 | 49 | | |
23 | 50 | | |
24 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
25 | 55 | | |
| 56 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
0 commit comments