Stage the updater binary under a name Windows will launch #116
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/windows-updater-installer-detection"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Every agent CLI update on Windows failed at the final step:
The download and SHA-256 verification both succeeded; only the spawn of the detached finalizer failed, so the update never applied and the staged binary was cleaned up, leaving nothing to diagnose.
Cause
Windows installer detection. An executable without an embedded manifest whose name looks like an installer is treated as requiring elevation, so
CreateProcessrefuses to launch it from an ordinary process. The staged binary is spawned by exactly such a process, so the word "update" in its own filename was enough to block it.Measured on Windows 11, spawning copies of one identical binary that differ only in name:
probe-alpha.exe.probe-alpha.exeprobe-update.exeprobe-updater.exeprobe-setup.exeprobe-install.exeRuled out along the way: no process held the file, the directory grants FullControl, a copied binary runs from that same directory, the leading dot is irrelevant, and it is not a scan race (the same file still failed eight seconds after it was written). It failed identically with and without
detached/stdio: 'ignore'.Fix
Stage as
.planner-staged-<nonce>instead. Verified on the same host:.planner-staged-<nonce>.exeandplanner-staged-<nonce>.exeboth spawn,.planner-update-<nonce>.exestill fails.Cleanup sweeps both stems, so a leftover staged binary from a build predating this still gets removed.
A regression test pins the staged name against the installer keywords rather than against one specific string, since the constraint is the class of names, not this one.
Verification
Full typecheck, type-aware oxlint, knip, oxfmt, and 952 bun tests pass. The two updater test files pass, including the new guard and the extended cleanup coverage.
Not addressed here: embedding an
asInvokermanifest in the compiled binary would remove the whole class of problem, but that is a build-level change to the Bun compile step and worth doing separately.kReview review
Verdict: no findings
No findings to address in the reviewed diff.
No concrete regressions or actionable defects are established by the changed code and visible repository context.
Reviewed by kReview at
2245e9dd69. This comment is conservative and based only on the PR diff, metadata, and supplied repository context.Est. cost ~$0.23 (108.7k in / 560 out / gpt-5.6-sol).