anomalyco / anomalyco/opencode
opencode2: auto-update only triggers on second launch when background server is already running
@nexxeln is already working on this.
Since Aug 27, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
opencode2 does not trigger its auto-update on the first launch in a terminal session when the background server is not yet running. Closing and reopening opencode2 in the same terminal session is required for the auto-update to start. This suggests the first launch starts (or connects to) a stale background server and the update check is deferred until the second launch when the server is already running.
Environment
- opencode version: 1.18.20 (
opencode2 v0.0.0-beta-18387) - OS: Darwin 25.6.0 Darwin Kernel Version 25.6.0: Fri Jul 31 19:19:08 PDT 2026; root:xnu-12377.161.14~5/RELEASE_ARM64_T6050 arm64
- Terminal: ghostty, TERM=xterm-256color, TERM_PROGRAM=ghostty, COLORTERM=truecolor
- Shell: /bin/zsh
- Install/channel: beta (1.18.20 + beta-18387)
- Active plugins: None found in config (no
opencode.json/opencode.jsoncin repo;~/.config/opencode/opencode.jsoncontains onlysmall_modeland emptymcp/tools; no.opencode/plugin/or.opencode/plugins/directories)
Reproduction
- Ensure no
opencode2background server is running (fresh terminal session / after reboot /opencode2server stopped). - Launch
opencode2inghostty(/bin/zsh) — first launch starts the background server but no auto-update is triggered;opencode2 --versionstill shows the previous version. - Exit
opencode2(close TUI) but keep the same terminal session open (background server remains running). - Launch
opencode2again in the same terminal session — auto-update now starts/triggers.
Expected Behavior
Auto-update should be checked/triggered on the first launch, regardless of whether the background server was already running. A single launch should bring opencode2 up to date without requiring a close-and-reopen cycle.
Actual Behavior
Auto-update is not triggered on the first launch (when the background server is cold-started). It only triggers on the second launch in the same terminal session when the background server is already running. User observes: "when I close opencode2 and open it again on the same terminal session, it starts the auto update" — implying the first session was stale.
Additional Context
- Reproducibility: Reported as consistent (every update requires second launch). Reporter has not indicated intermittent behavior.
- Terminal: ghostty + zsh on macOS (Darwin arm64).
- Install: beta channel (
0.0.0-beta-18387/1.18.20), no plugins configured. - No logs/config snippets provided yet. No workaround except relaunching a second time.
- Possible cause: first launch cold-starts background server with current binary and defers update check; second launch reuses running server and then performs update check. May need to check update before/fork server or restart server after update on first launch.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.