fix: extract native zips in the staged updater - #96
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fork's update channel ships per-platform zips (bare binaries exceed GitHub's 100 MB per-file limit), but
stageNativeUpdatedownloaded 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:unzipon 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).