anomalyco / anomalyco/opencode

opencode2: auto-update only triggers on second launch when background server is already running

Open
#45,548 0 comments 0 reactions 1 assignee View on GitHub

@nexxeln is already working on this.

Since Aug 27, 2026.

2.0
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.jsonc in repo; ~/.config/opencode/opencode.json contains only small_model and empty mcp/tools; no .opencode/plugin/ or .opencode/plugins/ directories)

Reproduction

  1. Ensure no opencode2 background server is running (fresh terminal session / after reboot / opencode2 server stopped).
  2. Launch opencode2 in ghostty (/bin/zsh) — first launch starts the background server but no auto-update is triggered; opencode2 --version still shows the previous version.
  3. Exit opencode2 (close TUI) but keep the same terminal session open (background server remains running).
  4. Launch opencode2 again 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.