Repository navigation
Conversation
…openclaw#101392 follow-up) The spawn() call in startManagedServiceUpdateHandoff() creates a detached child process with child.unref() but without an 'error' listener. When spawn fails, Node.js emits an async 'error' event that crashes the parent as an unhandled error. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed July 7, 2026, 9:15 AM ET / 13:15 UTC. Summary PR surface: Source +1, Tests +1. Total +2 across 2 files. Reproducibility: yes. Source inspection and local Node probes show failed child-process spawns arrive through an asynchronous Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Wait for the helper child to emit Do we have a high-confidence way to reproduce the issue? Yes. Source inspection and local Node probes show failed child-process spawns arrive through an asynchronous Is this the best way to solve the issue? No. The no-op listener is a crash mitigation, but the best fix preserves the documented failed-handoff contract before reporting a started handoff. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cd86107a10f6. Label changesLabel justifications:
Evidence reviewedPR surface: Source +1, Tests +1. Total +2 across 2 files. View PR surface stats
What I checked:
Likely related people:
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. How this review workflow works
Review history (2 earlier review cycles)
|
|
Superseded and landed via #103278 as The original change correctly identified the asynchronous detached-spawn crash. The landed repair additionally prevents a false I could not safely push the repaired tree back to this fork branch: GitHub's Proof: 131 focused tests and the full changed gate passed on Testbox-through-Crabbox; real direct, systemd, and 30-second timeout probes passed; final autoreview was clean; exact-head CI run 29065636575 passed. Full land-ready evidence is recorded in the replacement PR comment. Thank you, @krissding, for finding and reporting the crash path. |
What Problem This Solves
startManagedServiceUpdateHandoff()insrc/infra/update-managed-service-handoff.tsspawns a detached child process withchild.unref()but no'error'listener. When spawn fails (e.g. execPath invalid, permissions changed), Node.js emits an async'error'event on the ChildProcess. Without a listener, this crashes the parent as an unhandled error.This is the same pattern identified and fixed in #101392 for
process-respawn.ts.Why This Change Was Made
The spawn at line 731 creates a detached handoff process during managed service updates. If the executable path is invalid, the async
'error'event crashes the parent gateway.Evidence
Before: no error listener → unhandled crash
After: error listener attached → graceful handling
Test mock updated
Updated
spawnMockinupdate-managed-service-handoff.test.tsto includeon: vi.fn()in the return value — required because the production code now callschild.on("error", ...).Merge Risk
Low. The change adds a no-op error listener before
child.unref(). Test mock updated accordingly.🤖 Generated with Claude Code