fix(infra): attach error listener to detached spawn to prevent unhandled rejection crash#101487
fix(infra): attach error listener to detached spawn to prevent unhandled rejection crash#101487tzy-17 wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 7, 2026, 4:36 AM ET / 08:36 UTC. Summary PR surface: Source +6. Total +6 across 1 file. Reproducibility: yes. Current main lacks a ChildProcess Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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: Land one canonical fix that attaches the listener before Do we have a high-confidence way to reproduce the issue? Yes. Current main lacks a ChildProcess Is this the best way to solve the issue? Not as submitted. The production fix is the right narrow layer, but the branch should add focused regression coverage and real-behavior proof before it is the best merge candidate. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cc2c6a87dc35. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +6. Total +6 across 1 file. 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
|
a723a21 to
7eed5df
Compare
…led rejection crash spawnDetachedGatewayProcess calls child.unref() without attaching an error listener. If spawn fails asynchronously (ENOMEM, missing executable), the ChildProcess emits an unhandled 'error' event that crashes the parent Node process. Add a guard-checked noop error listener before unref() to prevent the unhandled-event crash. Fixes openclaw#101458
7eed5df to
d16b965
Compare
What Problem This Solves
Fixes #101458:
spawnDetachedGatewayProcesscallschild.unref()without attaching an error listener. Ifspawnfails asynchronously (ENOMEM, missing executable), Node.js treats the unhandlederrorevent as an uncaught exception and crashes the parent process.Why This Change Was Made
Added a guard-checked noop error listener (
child.on("error", () => {})) beforechild.unref(). Thetypeof child.on === "function"guard handles test mocks that return plain objects without EventEmitter methods.User Impact
Evidence
pnpm test src/infra/process-respawn.test.ts— 25 tests passoxlintpasses🤖 Generated with Claude Code