Skip to content

Auto-update never fires for extension (serve) users — fleet stuck at old versions #939

Description

@ralphstodomingo

Summary

Auto-update never fires for users running Altimate Code through the VS Code / Cursor extension. A large share of the fleet is stuck at old versions (e.g. 0.7.3). The autoupdate config works for terminal (TUI) users but extension users never receive any update.

Root cause

The upgrade routine is wired only into the TUI startup path:

  • packages/opencode/src/cli/upgrade.ts exports upgrade() — checks Installation.latest(), gates on config.autoupdate, calls Installation.upgrade().
  • Its only invoker is the TUI worker checkUpgrade (packages/opencode/src/cli/cmd/tui/worker.ts), called from exactly one site: packages/opencode/src/cli/cmd/tui/thread.ts (TUI bootstrap, ~1s after launch).

The extension never launches the TUI — it spawns altimate serve --port <n>. But packages/opencode/src/cli/cmd/serve.ts only calls Server.listen() and blocks; it performs no version check or upgrade. Nothing else (no server route, no extension call) triggers upgrade() for a serve process. So the binary is never updated after install and the fleet freezes at the onboarding version.

This is independent of #734/#735 (which fix which package a Windows upgrade installs). Even with those merged, the upgrade still never fires for serve/extension users.

Fix (this issue)

Invoke the existing upgrade() check on serve startup, mirroring what the TUI already does — reuse bootstrap() (cli/bootstrap.ts) + upgrade() (cli/upgrade.ts). Fire-and-forget, non-blocking, errors logged not thrown. This reuses all existing tested logic: install-method detection, the autoupdate config gate (true / false / "notify"), the downgrade guard, and upgrade telemetry.

Note: this is the durable fix going forward. Users already on a version without this serve-side trigger (the stuck 0.7.3 fleet) need a push from the extension side to upgrade once — tracked separately in the extension repo.

Verification

  • serve startup triggers an upgrade() check when a newer release exists and autoupdate is not disabled.
  • autoupdate: false / OPENCODE_DISABLE_AUTOUPDATE → notify only, no auto-upgrade (parity with TUI).
  • Downgrade guard and method detection unaffected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions