fix(update): ignore restart script spawn failures#85761
Conversation
|
Codex review: needs real behavior proof before merge. Latest ClawSweeper review: 2026-05-24 00:52 UTC / May 23, 2026, 8:52 PM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
PR Surface View PR surface stats
Summary Reproducibility: yes. for the code path: current main lacks both a try/catch around the restart script spawn and a child PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the small restart-helper hardening after maintainer review and real handoff proof, then let it close #83892. Do we have a high-confidence way to reproduce the issue? Yes for the code path: current main lacks both a try/catch around the restart script spawn and a child Is this the best way to solve the issue? Yes, the code direction is the narrow maintainable fix: handle both synchronous spawn failures and async child-process Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against acf265d4d51d. |
779bc4e to
989ad91
Compare
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
CI triage for
Maintainer alert: I did not fold a config-defaults/test change into this PR because that is a config/model-default boundary and unrelated to #83892. This PR remains scoped to update restart handoff error handling. |
654fde1 to
e224c84
Compare
Summary
spawn()fails immediately.errorlistener so ENOENT/EACCES-style spawn failures after handoff do not crash the update CLI.Fixes #83892.
Verification
2026-05-23 update after rebasing onto
origin/main(acf265d4d5), heade224c84c34:node scripts/run-vitest.mjs src/cli/update-cli/restart-helper.test.ts --reporter=verbose(1 file, 29 tests passed)./node_modules/.bin/oxfmt --check --threads=1 CHANGELOG.md src/cli/update-cli/restart-helper.ts src/cli/update-cli/restart-helper.test.ts./node_modules/.bin/oxlint src/cli/update-cli/restart-helper.ts src/cli/update-cli/restart-helper.test.tsgit diff --check origin/main...HEADEarlier verification before the rebase:
corepack pnpm installcorepack pnpm exec oxfmt --write --threads=1 src/cli/update-cli/restart-helper.ts src/cli/update-cli/restart-helper.test.ts CHANGELOG.mdOPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 CI=1 node scripts/run-vitest.mjs src/cli/update-cli/restart-helper.test.ts- 29 tests passed before pushgit diff --checkcorepack pnpm exec oxfmt --check --threads=1 src/cli/update-cli/restart-helper.ts src/cli/update-cli/restart-helper.test.ts CHANGELOG.mdcorepack pnpm exec oxlint src/cli/update-cli/restart-helper.ts src/cli/update-cli/restart-helper.test.ts- 0 warnings, 0 errorscodex review --uncommitted- clean, no actionable findings before initial commitorigin/mainafter PR creation to resolve the changelog conflict with fix(doctor): canonicalize git checkout detection #85735.OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=900000 CI=1 node scripts/run-vitest.mjs src/cli/update-cli/restart-helper.test.ts- 29 tests passedgit diff --check fork/fix-83892-restart-script-spawn-error..HEADcorepack pnpm exec oxfmt --check --threads=1 src/cli/update-cli/restart-helper.ts src/cli/update-cli/restart-helper.test.ts CHANGELOG.mdcorepack pnpm exec oxlint src/cli/update-cli/restart-helper.ts src/cli/update-cli/restart-helper.test.ts- 0 warnings, 0 errorscodex review --base origin/main- clean, no actionable findingsNote:
node scripts/run-oxlint.mjs src/cli/update-cli/restart-helper.ts src/cli/update-cli/restart-helper.test.tswas attempted, but its preflight failed before linting touched files because the local checkout could not build unrelated WhatsApp boundary DTS artifacts: missingbaileystype declarations underextensions/whatsapp/**. Direct oxlint on the touched TS files passed.Real behavior proof
Behavior addressed:
openclaw updatecan crash during the gateway restart handoff when the detached restart script process cannot be spawned or emits a child-processerrorevent afterspawn()returns.Real environment tested: WSL checkout at
/root/src/openclaw-85761on Ubuntu-24.04, branchfix-83892-restart-script-spawn-error, heade224c84c34.Exact steps or command run after this patch:
node scripts/run-vitest.mjs src/cli/update-cli/restart-helper.test.ts --reporter=verboseEvidence after fix: The focused regression test covers both the synchronous
spawn()throw path and the async child-processerrorevent path, while preserving the existing Linux, macOS, and Windows restart script behavior.Observed result after fix:
restart-helper.test.tspassed 29 tests including the new failure-mode regressions; focused static checks were clean.What was not tested: A destructive full package self-update with an actual managed gateway restart was not run; this patch only changes the detached handoff error handling and preserves existing restart script behavior.