Repository navigation
fix: finish shutdown without disabling V8 compilers - #168587
Conversation
Co-authored-by: steipete <[email protected]>
Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 09df66dc-cd63-4093-b782-154eeacdaa8f
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. What this changesThis PR restores Node’s default V8 compilers and makes executable lifecycle owners finish cleanup before exiting naturally. Example: A Node 24.19.0 CLI command finishes with status 7 while native cleanup remains pending.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this maintainer-directed PR replaces main’s compiler workaround with owned natural shutdown; current-head CI remains blocked, and no new actionable defect was established in the inspected paths. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherCLI, Gateway, worker, and child-process lifecycle owners receive completion or cancellation requests and release accepted work, native resources, transports, and output before recording terminal outcomes. flowchart TD
A[CLI or Gateway entry] --> B[Command lifecycle owner]
B --> C[Accepted work and child transports]
B --> D[Shutdown request]
D --> E[Join work and native cleanup]
C --> E
E --> F[Record exit status]
F --> G[Natural Node shutdown]
Technical reviewBest possible solution: Land the owned natural-shutdown cutover after current-head CI failures are repaired or qualify through the documented inherited-failure route. Do we have a high-confidence way to reproduce the issue? No reproduction was run during this read-only review; the merged predecessor records real Node deadlocks, while current main mitigates them by disabling the affected compilers. Is this the best way to solve the issue? Owned cleanup and natural termination address the lifecycle cause while preserving explicit compiler policy, signal outcomes, and system-certificate trust. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ddca97e26ac2. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfacePR surface statistics unavailable: the file list is incomplete. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (7 earlier review cycles)
Reviewed October 10, 2026, 11:06 PM ET / October 11, 2026, 03:06 UTC (Revision 8). |
Co-authored-by: steipete <[email protected]>
Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 0cf512ac-0bca-402e-aab2-7a2721c9175a
Join process-owned CLI skills watchers and leave terminal restoration with the terminal owners. Align natural-exit and native-cleanup fixtures without restoring forced exits. Integrate the exact CI-tested main base and repair memory publication observation, eligible terminal transcript recording, fallback thinking metadata, and compatible Responses private-context expectations. Preserve the post-reload UI readiness boundary. Co-authored-by: steipete <[email protected]>
Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 2997ea59-8441-47bb-b6ee-88c5d27a5f84
Merge pinned main ea4693e while retaining natural shutdown ownership. Adopt its already-reviewed canonical private-completion parser and native/compatible carrier tests instead of duplicating the branch-local oracle. Preserve negative controls for leaked, missing, unmarked, and stale private context. Co-authored-by: steipete <[email protected]>
matrix-js-sdk's timeoutSignal ponyfill arms a referenced setTimeout for every request and never clears it. /sync requests use pollTimeout + 80s, so each Matrix CLI command stayed alive for up to 110s after printing its result once CLI completion stopped forcing process exit (#168587). The QA Matrix E2EE CLI scenarios timed out on these idle waits. Unref the deadline timer, matching AbortSignal.timeout semantics: an in-flight request still keeps the process alive through its socket and the deadline still fires while the loop is running.
matrix-js-sdk's timeoutSignal ponyfill arms a referenced setTimeout for every request and never clears it. /sync requests use pollTimeout + 80s, so each Matrix CLI command stayed alive for up to 110s after printing its result once CLI completion stopped forcing process exit (#168587). matrix-js-sdk 43.0.0 still ships the same ponyfill. Unref the deadline timer, matching AbortSignal.timeout semantics: an in-flight request still keeps the process alive through its socket and the deadline still fires while the loop is running. Forward-port of 4bbc597 from release/2026.10.10.
matrix-js-sdk's timeoutSignal ponyfill arms a referenced setTimeout for every request and never clears it. /sync requests use pollTimeout + 80s, so each Matrix CLI command stayed alive for up to 110s after printing its result once CLI completion stopped forcing process exit (#168587). matrix-js-sdk 43.0.0 still ships the same ponyfill. Unref the deadline timer, matching AbortSignal.timeout semantics: an in-flight request still keeps the process alive through its socket and the deadline still fires while the loop is running. Forward-port of 4bbc597 from release/2026.10.10.
) * fix(matrix): defer ready status through startup Keep account readiness in startup until Matrix startup maintenance and crypto ownership initialization have settled, preventing hard-restart consumers from interrupting final state handoff. The monitor is the status controller's only consumer, so deferral is unconditional rather than an option. Forward-port of 5fe32d9 from release/2026.10.10. * fix(matrix): let Matrix CLI commands exit after their client stops matrix-js-sdk's timeoutSignal ponyfill arms a referenced setTimeout for every request and never clears it. /sync requests use pollTimeout + 80s, so each Matrix CLI command stayed alive for up to 110s after printing its result once CLI completion stopped forcing process exit (#168587). matrix-js-sdk 43.0.0 still ships the same ponyfill. Unref the deadline timer, matching AbortSignal.timeout semantics: an in-flight request still keeps the process alive through its socket and the deadline still fires while the loop is running. Forward-port of 4bbc597 from release/2026.10.10. * fix(matrix): report late in-room verification failures instead of crashing matrix-js-sdk starts in-room verification processing without awaiting it, including after an encrypted verification event finishes decrypting. Once the client has stopped, OpenClaw's retired crypto IndexedDB generation rejects receiveVerificationEvent, and the rejection reaches the process unhandled-rejection guard, which begins process exit. In the QA Matrix lane the exit gate stopped the CLI scheduler mid-run, so every later isolated scenario failed with "Failed to stage the isolated QA auth profile store". matrix-js-sdk 43.0.0 still leaves this path unguarded. Catch and log the failure inside the SDK's fire-and-forget verification path. Forward-port of 2a6a3bc from release/2026.10.10. * test(qa): align Matrix E2EE scenarios with offline ownership contracts Two Matrix QA scenarios asserted behavior the product intentionally retired; earlier lane failures masked them. - matrix-e2ee-cli-setup-then-gateway-reply ran `openclaw matrix encryption setup` while the Gateway owned the state root. Since #168471 only verify status/bootstrap/device route through a running Gateway; other Matrix commands refuse until it is stopped (docs/channels/matrix.md). Run setup in the stop/run/restart window, then keep the Gateway reply proof. - matrix-e2ee-corrupt-crypto-idb-snapshot expected backup restore to repair a corrupted crypto snapshot. Since #160707 crypto ownership refuses unsafe or corrupt snapshots and points at `openclaw matrix doctor inspect` (docs/channels/matrix/encryption.md). Assert that refusal and that the corrupted snapshot is left in place. The refusal assertion and the backup-bootstrap classifier move to the destructive-recovery sibling to keep the scenario module under its line cap. Forward-port of 0f4dc59 from release/2026.10.10. * test(matrix): scope forward-port regression allocation
…claw#192385) * fix(matrix): defer ready status through startup Keep account readiness in startup until Matrix startup maintenance and crypto ownership initialization have settled, preventing hard-restart consumers from interrupting final state handoff. The monitor is the status controller's only consumer, so deferral is unconditional rather than an option. Forward-port of 5fe32d9 from release/2026.10.10. * fix(matrix): let Matrix CLI commands exit after their client stops matrix-js-sdk's timeoutSignal ponyfill arms a referenced setTimeout for every request and never clears it. /sync requests use pollTimeout + 80s, so each Matrix CLI command stayed alive for up to 110s after printing its result once CLI completion stopped forcing process exit (openclaw#168587). matrix-js-sdk 43.0.0 still ships the same ponyfill. Unref the deadline timer, matching AbortSignal.timeout semantics: an in-flight request still keeps the process alive through its socket and the deadline still fires while the loop is running. Forward-port of 4bbc597 from release/2026.10.10. * fix(matrix): report late in-room verification failures instead of crashing matrix-js-sdk starts in-room verification processing without awaiting it, including after an encrypted verification event finishes decrypting. Once the client has stopped, OpenClaw's retired crypto IndexedDB generation rejects receiveVerificationEvent, and the rejection reaches the process unhandled-rejection guard, which begins process exit. In the QA Matrix lane the exit gate stopped the CLI scheduler mid-run, so every later isolated scenario failed with "Failed to stage the isolated QA auth profile store". matrix-js-sdk 43.0.0 still leaves this path unguarded. Catch and log the failure inside the SDK's fire-and-forget verification path. Forward-port of 2a6a3bc from release/2026.10.10. * test(qa): align Matrix E2EE scenarios with offline ownership contracts Two Matrix QA scenarios asserted behavior the product intentionally retired; earlier lane failures masked them. - matrix-e2ee-cli-setup-then-gateway-reply ran `openclaw matrix encryption setup` while the Gateway owned the state root. Since openclaw#168471 only verify status/bootstrap/device route through a running Gateway; other Matrix commands refuse until it is stopped (docs/channels/matrix.md). Run setup in the stop/run/restart window, then keep the Gateway reply proof. - matrix-e2ee-corrupt-crypto-idb-snapshot expected backup restore to repair a corrupted crypto snapshot. Since openclaw#160707 crypto ownership refuses unsafe or corrupt snapshots and points at `openclaw matrix doctor inspect` (docs/channels/matrix/encryption.md). Assert that refusal and that the corrupted snapshot is left in place. The refusal assertion and the backup-bootstrap classifier move to the destructive-recovery sibling to keep the scenario module under its line cap. Forward-port of 0f4dc59 from release/2026.10.10. * test(matrix): scope forward-port regression allocation
Related: #163788
What Problem This Solves
Fixes commands hanging after output during forced Node shutdown without retaining the blanket Maglev and concurrent-Sparkplug workaround.
User Impact
CLI commands and the Gateway finish owned work and cleanup before exiting naturally, with Node's default compiler settings restored. Exit status, Unix signal termination, output, explicit compiler overrides, and system-CA trust are preserved.
The Gateway still joins native skills-watcher retirement. This can retain synchronous FSEvents shutdown latency on macOS; the separate upstream certificate-loader stall is not fixed. Native macOS/Windows qualification is not claimed.
Why This Change Was Made
Existing lifecycle owners retain admitted work, native workers, child transports, updater recovery, and watchdogs through actual completion. The boundary guard prevents new forced normal exits. Cleanup dependencies are retained before a command can replace its package, without eagerly importing them into CLI bootstrap. No new configuration, dependency, or schema is introduced.
Evidence
Current-head CI run 38106144930 is red: 12 failing test jobs are attributed to the tested baseline (294b2e3), with complete job and source-bound evidence for native admission. They cover browser catalog/focus and a stale Details selector, channel mocks, Codex import/steering, and Claude discovery fixtures. None is claimed fixed or green by this PR. The original Gateway read-admission and node-wire timeout observations remain unreproduced, not declared fixed. Earlier local smoke preparation was refused by managed-artifact separation; no guard was bypassed.
Requested and directed by @steipete.
Work sessions
Worked on by
View the OpenClaw team session