Skip to content

fix: Windows upgrade + uninstall route to upstream opencode package #734

Description

@anandgupta42

Summary

Multiple CLI paths reference the upstream opencode / opencode-ai package names instead of altimate-code's actual package identifiers, causing Windows users to hit the wrong product during upgrade and uninstall flows.

Evidence

Production telemetry (last 3 days) shows Windows users receiving auto-upgrade attempts that target 1.14.19 — a version of the upstream sst/opencode package, not altimate-code. The stuck user ID 12c7c779-a669-4342-ad8d-ef518e640914 hit "not running from an elevated command shell" five times in a row trying to upgrade to the wrong product.

upgrade_attempted from=0.6.0 to=1.14.19 method=other status=error
  error="not running from an elevated command shell" × 5

Root causes

  1. packages/opencode/src/installation/index.tsmethod() auto-detected choco/scoop by looking for the upstream opencode package in those registries; latest() queried the upstream chocolatey feed / scoop bucket for version; upgrade() ran choco upgrade opencode / scoop install opencode@....
  2. packages/opencode/src/cli/cmd/upgrade.ts--method option still advertised choco and scoop as valid choices even after the fix made them fail.
  3. packages/opencode/src/cli/cmd/uninstall.ts — Same class of bug: npm uninstall -g opencode-ai, brew uninstall opencode, choco uninstall opencode — would either fail silently or uninstall the wrong product.

altimate-code is not distributed via chocolatey or scoop (verified: publish.ts only publishes to npm / Docker / AUR / Homebrew).

Observability gap

The existing upgrade_attempted telemetry captured upgrade outcomes but not proactive notifications, so we couldn't compute a "user was told an upgrade exists → user upgraded" funnel. Without that signal, we can't distinguish "nobody knows 0.6.0 exists" from "people saw it and ignored it."

Acceptance criteria

  • Windows users running altimate upgrade via choco or scoop get a clear error pointing to npm / Homebrew / https://altimate.ai/install — never install the upstream product.
  • altimate upgrade --help no longer offers choco / scoop as --method values.
  • altimate uninstall uses altimate-code's real package identifiers (@altimateai/altimate-code for npm-family, altimate-code for brew).
  • Auto-detection (Installation.method()) never returns "choco" or "scoop" — matching upstream opencode installed alongside would misroute upgrades.
  • New upgrade_available telemetry event fires when users are proactively shown an "upgrade available" notification (dedup per correlation_id + version), enabling funnel analysis.

Out of scope

  • Adding chocolatey / scoop publishing pipelines for altimate-code (possible future work; not required for this fix).

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