You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[v2] cli: update prompt recommends older version #47714
Launching opencode2 version v0.0.0-beta-19215 shows an update prompt recommending v0.0.0-beta-19213, which is older than the currently installed version.
$realPwsh='%LOCALAPPDATA%\Local\Microsoft\WindowsApps\pwsh.exe'$filteredArgs=foreach ($argin$args) {
if ($arg-ine'-NoProfile') {
$arg
}
}
&$realPwsh@filteredArgsexit$LASTEXITCODE
Install/channel: Beta
Active plugins: None configured; no local plugin files found
Reproduction
Install or run opencode2 v0.0.0-beta-19215.
Launch opencode2.
Observe the update notification recommending v0.0.0-beta-19213.
Expected Behavior
The update check should recognize that v0.0.0-beta-19215 is newer than v0.0.0-beta-19213 and should only recommend an update when a newer version is available.
Actual Behavior
The update prompt recommends updating from v0.0.0-beta-19215 to the older version v0.0.0-beta-19213.
Additional Context
This was observed immediately after launching opencode2.
The exact update prompt text has not yet been captured, and it is currently unclear whether the prompt appears on every launch.
Another instance of this, with a different shape: a 2.0.9 install was downgraded to 2.0.8 because the update service's answer for current=2.0.9 moved backwards.
Earlier the same day the same check reported current=2.0.9 latest=2.0.9 (action=up-to-date, 08:54:53 UTC), so the service's "latest" for latest/cli/npm changed from 2.0.9 to 2.0.8 between 08:54 and 09:21 UTC.
The update API still answers this way (checked 2026-09-19 ~09:35 UTC):
Meanwhile @opencode/[email protected] is published on npm (dist-tag latest, published 2026-09-19T05:11:15Z) and v2.0.9 is tagged in the repo. So any client on 2.0.9 is currently told that 2.0.8 is "available".
Expected
The update prompt/install should only fire when latest > current (semver-greater), so a client that is ahead of the update service can never be downgraded.
Actual
2.0.9 was downgraded to 2.0.8; OpenCode even logged it as updated OpenCode from=2.0.9 to=2.0.8. (Same missing semver-gt guard noted in #49660.)
I looked at the updater code, and this is how it's built to work right now. The CLI asks the update server which version you should be on for your channel. If your installed version is different from that answer, it shows the prompt, even when the server's version is older. This is on purpose: it lets the server roll users back if a release has problems (there's a test for this rollback case in packages/cli/src/services/updater.test.ts). So when you saw it, the beta channel was most likely still serving 0.0.0-beta-19213, and the prompt pointed you back to it.
I've filed this as a feature request: offer only newer versions, or at least say clearly when a prompt is a rollback/downgrade and not an update. Maintainers will consider it.
In the meantime, you can turn off automatic updates or switch to notify-only with the autoupdate setting in your config (false or "notify"). The beta channel is also older than the current 2.x releases, so moving to the stable 2.x channel may be worth it.
Related: #49660 is a different /update problem (an update offered on a pacman install that can't actually be upgraded), so it's only loosely related.
Activity
github-actions commentedon Sep 7, 2026
This issue might be a duplicate of existing issues. Please check:
ZaraByte commentedon Sep 19, 2026
Another instance of this, with a different shape: a 2.0.9 install was downgraded to 2.0.8 because the update service's answer for
current=2.0.9moved backwards.Environment
~/.bun/bin), channellatest,local=falseEvidence
CLI log (
~/.local/share/opencode/log/opencode.log, UTC):Earlier the same day the same check reported
current=2.0.9 latest=2.0.9(action=up-to-date, 08:54:53 UTC), so the service's "latest" forlatest/cli/npmchanged from 2.0.9 to 2.0.8 between 08:54 and 09:21 UTC.The update API still answers this way (checked 2026-09-19 ~09:35 UTC):
Meanwhile
@opencode/[email protected]is published on npm (dist-taglatest, published 2026-09-19T05:11:15Z) andv2.0.9is tagged in the repo. So any client on 2.0.9 is currently told that 2.0.8 is "available".Expected
The update prompt/install should only fire when
latest > current(semver-greater), so a client that is ahead of the update service can never be downgraded.Actual
2.0.9 was downgraded to 2.0.8; OpenCode even logged it as
updated OpenCode from=2.0.9 to=2.0.8. (Same missing semver-gt guard noted in #49660.)opencodejr commentedon Oct 28, 2026
Thanks for the detailed report!
I looked at the updater code, and this is how it's built to work right now. The CLI asks the update server which version you should be on for your channel. If your installed version is different from that answer, it shows the prompt, even when the server's version is older. This is on purpose: it lets the server roll users back if a release has problems (there's a test for this rollback case in
packages/cli/src/services/updater.test.ts). So when you saw it, the beta channel was most likely still serving0.0.0-beta-19213, and the prompt pointed you back to it.I've filed this as a feature request: offer only newer versions, or at least say clearly when a prompt is a rollback/downgrade and not an update. Maintainers will consider it.
In the meantime, you can turn off automatic updates or switch to notify-only with the
autoupdatesetting in your config (falseor"notify"). The beta channel is also older than the current 2.x releases, so moving to the stable 2.x channel may be worth it.Related: #49660 is a different
/updateproblem (an update offered on a pacman install that can't actually be upgraded), so it's only loosely related.