Skip to content

fix: extract native zips in the staged updater - #96

Merged
mbuckaway merged 1 commit into
fork/mainfrom
fix/native-stage-extract-zips
Aug 30, 2026
Merged

fix: extract native zips in the staged updater#96
mbuckaway merged 1 commit into
fork/mainfrom
fix/native-stage-extract-zips

Conversation

@mbuckaway

Copy link
Copy Markdown
Owner

The fork's update channel ships per-platform zips (bare binaries exceed GitHub's 100 MB per-file limit), but stageNativeUpdate downloaded the manifest-referenced file and staged it verbatim — so every upgrade staged a zip archive that the startup swap rejected as not an executable ("version detected, downloaded, but not installed", TUI re-prompting every launch).

Fixes:

  • apps/kimi-code/src/cli/update/native-stage.ts: detect zip payloads (PK magic) and extract the inner executable before staging, hashing/sizing the extracted binary; bare binaries (upstream layout) pass through unchanged. Cross-platform: unzip on unix, bsdtar on win32.
  • apps/kimi-code/test/cli/update/native-stage.test.ts: new case staging a zip payload and asserting the staged file is the extracted executable (plus .part/extraction-dir cleanup).
  • apps/kimi-code/scripts/native/produce-manifest.mjs + fork/scripts/publish-update-channel.mjs: restore the zip-based manifest and /binaries/<version>/ zips (reverting the bare-binary layout, which cannot be served from gh-pages due to the 100 MB limit).

The fork's update channel ships per-platform zips (bare binaries exceed
GitHub's 100 MB per-file limit), but stageNativeUpdate downloaded the
manifest-referenced file and staged it verbatim, so every upgrade staged a
zip archive that the startup swap rejected as not an executable — 'version
detected, downloaded, but not installed'.

- native-stage.ts: detect zip payloads (PK magic) and extract the inner
  executable before staging, hashing/sizing the extracted binary; bare
  binaries (upstream layout) pass through unchanged. Cross-platform: unzip
  on unix, bsdtar on win32.
- native-stage.test.ts: new case staging a zip payload and asserting the
  staged file is the extracted executable (plus .part/.x cleanup).
- produce-manifest.mjs / publish-update-channel.mjs: restore the zip-based
  manifest and /binaries/<version>/ zips (reverting the bare-binary change
  that cannot be served from gh-pages).
@mbuckaway
mbuckaway merged commit aebcce9 into fork/main Aug 30, 2026
13 checks passed
@mbuckaway
mbuckaway deleted the fix/native-stage-extract-zips branch August 30, 2026 20:31
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.

1 participant