Repository navigation
fix(step): resolve update archive root for flat Windows zips - #271
Merged
ZouR-Ma merged 1 commit intoOct 20, 2026
Merged
Conversation
Windows release zips place step.exe and the resources at the archive root, while Unix tar.gz archives wrap everything in a single top-level directory. findArchiveRoot assumed the wrapped layout and descended into the first subdirectory it saw, so on Windows the search for step.exe was confined to docs/ and step update always failed after a successful download and checksum verification. Anchor the decision on where the binary sits instead: if the binary is at the extract root, the root is the archive root (flat Windows zip); otherwise a single subdirectory is the wrapper (Unix archive); ambiguous layouts fall back to the extract root for the recursive findFile. This matches how infra/release/install.sh already derives the root and leaves install.ps1's flat assumption untouched. Add unit tests covering both archive layouts plus the fallback cases.
li-xiu-qi
requested review from
MelodyVAR,
Uking-xxx,
ZouR-Ma and
liuedcson
as code owners
October 20, 2026 07:03
ZouR-Ma
approved these changes
Oct 20, 2026
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.
Fixes #269
Problem
step updatefails on every Windows install, after the download andchecksum verification have already succeeded:
Reproduced on Windows 11 x64 with the native 0.1.4 install updating to
0.1.5. Fresh installs via
install.ps1are fine — only the self-updatepath is broken. Windows users currently have to reinstall manually.
The two platforms ship different archive layouts:
step.exe,docs/,node_modules/, … allsit at the archive root.
step/directory holds everything (
scripts/build-binaries.shadds thewrapper directory for mise compatibility on Unix only).
findArchiveRootinpackages/coding-agent/src/step/local-update.tsassumed the wrapped layout and picked the first subdirectory it saw:
On Windows the first subdirectory is
docs, so the subsequent recursivesearch for
step.exewas confined todocs/and never found it. Anyarchive containing at least one subdirectory trips this, regardless of
sort order.
Changes
Anchor the decision on where the binary sits instead of inferring the
layout from the first subdirectory:
findFilestill locates the binary.Behavior and compatibility
findArchiveRootgains abinaryNameparameter; its single callerreplaceInstallationis updated accordingly. No other call sites.persisted sessions, or provider responses.
install.sh(recursive find + dirname) andinstall.ps1(
$ExtractDir/step.exe, flat by design) keep working as before — thefix aligns
findArchiveRootwith the layouts both installers alreadyhandle, so no packaging change is needed.
Validation
Added
packages/coding-agent/src/step/local-update.test.tscovering:docs/+node_modules/at the root)step/directory)Verified on Windows 11 x64:
npm run check— biome, static checks, tsgo: all passpackages/coding-agenttest suite — pass, including the 4 new testswindows-x64release artifact now resolves the archiveroot correctly (binary found at the extract root instead of
docs/)Intentional skips: two pre-existing failures on Windows reproduce on a
clean
mainand are unrelated to this change —scripts/release-bundle.test.mjs(install.sh PATH persistence) andpackages/config/test/migrations.test.ts(session relocation). Both looklike Windows shell/path-encoding issues; happy to file them separately
if useful.
Limitations
A full real-machine
step update(0.1.4 → 0.1.5 end-to-end) has notbeen run — the binary installed on the test machine is still the
unfixed 0.1.4. What is verified: archive-root resolution against the
real release artifact, the 4 new unit tests,
npm run check, thepackage test suite, and the PR's
build-check-testCI run. No otherunverified behavior or pending CI at this time.