fix(cli): handle Windows upgrades and lifecycle ACK failures - #488
Merged
Conversation
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.
Related issue
Same-repository bug fix; no linked issue.
Problem / pressure
Remote daemon updates fail on Windows because native Node spawn cannot directly
execute
npm.cmd. Separately, an accepted restart or upgrade remains pendingforever when its RPC acknowledgement fails to append, blocking subsequent attempts.
Summary
Use the existing
cross-spawndependency for npm installation. For acceptedrestart/upgrade requests, attempt ACK delivery with a five-second total budget,
then invoke the existing CLI lifecycle callback on success, failure, or timeout.
ACK errors remain diagnostic and do not produce a contradictory operation-failed
response. Rejected requests never invoke the callback.
Retain the existing process exit guard and upgrade preparation. Add synthetic npm
shim tests and fake-clock ACK delivery tests. Document the acceptance semantics
in a draft Spec and record both fixes in Agent Notes.
Before / after
npm.cmddirectly.cross-spawnhandles the Windows command shim.Test plan
pnpm check: passed, including typecheck, lint, full tests, i18n, and boundary checks. Existing local IPC tests ran outside the sandbox to allow socket creation.pnpm formatandpnpm run docs check: passed; unrelated formatter output excluded.Context handoff
Instructions for reviewing agents
Authoring context