Skip to content

fix(cli): resolve curl upgrade version from npm dist-tag instead of GitHub releases/latest - #12167

Merged
marius-kilocode merged 2 commits into
mainfrom
scandalous-watcher
Jul 13, 2026
Merged

fix(cli): resolve curl upgrade version from npm dist-tag instead of GitHub releases/latest#12167
marius-kilocode merged 2 commits into
mainfrom
scandalous-watcher

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

Problem

kilo upgrade for curl-detected installs (~/.kilo/bin/kilo) resolved the latest version from GitHub's /releases/latest endpoint. That endpoint now returns JetBrains plugin releases (e.g. jetbrains/v7.0.4) instead of the latest CLI release, because JetBrains releases are published more recently than CLI releases. The old code stripped the leading v from tag_name, leaving jetbrains/v7.0.4 — not a valid semver — which then broke the upgrade flow. This is the same root cause as issue #12125 (fixed for the install script in #12148), but in a separate code path: Installation.latest() in src/installation/index.ts.

Reported in Discord: kilo upgrade and curl https://kilo.ai/cli/install both broken, with kilo --version and kilocode --version diverging (stale curl-installed binary vs up-to-date npm-installed one).

Fix

The curl/unknown fallback in Installation.latest() now fetches the npm latest dist-tag (${registry}/@kilocode%2fcli/${InstallationChannel}) instead of GitHub /releases/latest. This naturally excludes JetBrains releases and CLI prerelease channels (RC lives on the rc dist-tag) without requiring jq or pagination. The npm branch already used this approach for npm/yarn/bun/pnpm installs — the curl fallback now uses the same source for consistency.

upgradeCurl needed no change: it passes VERSION: target to the install script (already fixed in #12148), which constructs the versioned GitHub asset URL from it.

Verification

  • Installation.latest("curl") with KILO_CHANNEL=latest resolves 7.4.5 from the live npm registry
  • npm latest dist-tag: 7.4.5; npm rc dist-tag: 7.4.2 (prerelease correctly excluded)
  • GitHub /releases/latest: still returns jetbrains/v7.0.4 (broken)
  • Unit tests: 13 pass, 0 fail (test/kilocode/installation/upgrade.test.ts)
  • Typecheck: no errors in changed files

Comment thread .changeset/fix-upgrade-curl-version.md Outdated
Comment thread packages/opencode/src/installation/index.ts Outdated
@kilo-code-bot

kilo-code-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .changeset/fix-upgrade-curl-version.md
  • packages/opencode/src/installation/index.ts
  • packages/opencode/test/installation/installation.test.ts
Previous Review Summary (commit 988a92e)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 988a92e)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 0

Fix these issues in Kilo Cloud

Issue Details (click to expand)

WARNING

File Line Issue
.changeset/fix-upgrade-curl-version.md 2 Changeset targets a nonexistent package because its key has a leading space
packages/opencode/src/installation/index.ts 316 Curl version resolution inherits project-local npm registry configuration
Files Reviewed (4 files)
  • .changeset/fix-upgrade-curl-version.md - 1 issue
  • packages/opencode/src/installation/index.ts - 1 issue
  • packages/opencode/src/kilocode/installation/index.ts - 0 issues
  • packages/opencode/test/kilocode/installation/upgrade.test.ts - 0 issues

Reviewed by gpt-5.6-sol · Input: 49.1K · Output: 8.6K · Cached: 452.8K

@marius-kilocode
marius-kilocode merged commit fc52751 into main Jul 13, 2026
30 checks passed
@marius-kilocode
marius-kilocode deleted the scandalous-watcher branch July 13, 2026 11:08
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
fix(cli): resolve curl upgrade version from npm dist-tag instead of GitHub releases/latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants