Repository navigation
fix: join process shutdown and isolate runtime fixtures - #174359
Conversation
|
🦞👀 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR joins brokered child exit with IPC disconnection, skips catalog recovery after owner retirement, and corrects runtime-dependent test fixtures. Example: Brokered child PID 123 exits with SIGKILL before its IPC disconnect receipt arrives.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it makes focused lifecycle repairs and preserves runtime coverage, with no actionable introduced defect found and the exact-head aggregate CI gate passing. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe spawn broker translates native child lifecycle receipts into caller-visible process events; the catalog worker manages discovery and recovery for Gateway model-runtime borrowers. flowchart TD
A[Gateway callers] --> B[Spawn broker host]
B --> C[Native child process]
C --> D[Broker child lifecycle]
D --> A
A --> E[Catalog worker pool]
E --> F[Current runtime borrowers]
Technical reviewBest possible solution: Retain these repairs in the existing child and catalog lifecycle owners. Do we have a high-confidence way to reproduce the issue? Source shows premature close when exit precedes IPC disconnection and unconditional recovery import after cleanup; the body also reports original-code IPC regression failures, but this review executed no target code. Is this the best way to solve the issue? The repairs enforce completion and retirement at their existing owners, while fixture changes preserve custody and cancellation assertions across runtimes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8079cb87aefe. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +4, Tests +68. Total +72 across 7 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel 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 Reviewed October 16, 2026, 11:35 AM ET / 15:35 UTC. |
336cf24 to
f222828
Compare
Wait for IPC disconnection before completing brokered children, and stop catalog recovery before importing a runtime whose owners have retired. Keep Darwin census fixtures synthetic under Bun, expect the native Linux subreaper independently of the test runtime, and avoid epoch-zero session expiry in heartbeat model-override tests.
f222828 to
c8aea39
Compare
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* commit '14e993fff3ecb84eb1d7c9724c4ceda235d797e4': (110 commits) fix(decisions): align accounting ratchet evidence feat(memory): activate PostgreSQL memory search and lifecycle (#174374) fix: join process shutdown and isolate runtime fixtures (#174359) refactor(ui): scope native gateway observation to Solid (#174367) refactor(ui): own canvas widget lifetime in Solid (#174370) perf(control-ui): keep agent avatar faces stable across agent publications (#174239) perf(models): release unused account catalog instructions (#174361) refactor(ui): own composer command menus in Solid stores (#174321) refactor(ui): separate sidebar filter state from view lifecycle (#174352) test(release): make artifact qualification deadlines deterministic fix(codex): preserve sandboxed process inspection and setup errors (#174284) fix(gateway): stop worker processes before draining their queues (#174312) refactor(agents): reuse prepared tool facts (#174349) test(gateway,plugins,ui): remove low-value tests (batch d174) (#174331) refactor(ui): replace MCP retirement host adapters with a factory (#174375) refactor(logging): remove redundant native success traces (#174330) refactor(test): remove dead control-plane fixture branches (#174377) refactor(mcp): remove test-only session runtime seams (#174347) feat(matrix): account-root state databases follow the selected engine (#174315) refactor(discord): collapse private interaction and factory seams (#174322) ...
* commit '14e993fff3ecb84eb1d7c9724c4ceda235d797e4': (110 commits) fix(decisions): align accounting ratchet evidence feat(memory): activate PostgreSQL memory search and lifecycle (#174374) fix: join process shutdown and isolate runtime fixtures (#174359) refactor(ui): scope native gateway observation to Solid (#174367) refactor(ui): own canvas widget lifetime in Solid (#174370) perf(control-ui): keep agent avatar faces stable across agent publications (#174239) perf(models): release unused account catalog instructions (#174361) refactor(ui): own composer command menus in Solid stores (#174321) refactor(ui): separate sidebar filter state from view lifecycle (#174352) test(release): make artifact qualification deadlines deterministic fix(codex): preserve sandboxed process inspection and setup errors (#174284) fix(gateway): stop worker processes before draining their queues (#174312) refactor(agents): reuse prepared tool facts (#174349) test(gateway,plugins,ui): remove low-value tests (batch d174) (#174331) refactor(ui): replace MCP retirement host adapters with a factory (#174375) refactor(logging): remove redundant native success traces (#174330) refactor(test): remove dead control-plane fixture branches (#174377) refactor(mcp): remove test-only session runtime seams (#174347) feat(matrix): account-root state databases follow the selected engine (#174315) refactor(discord): collapse private interaction and factory seams (#174322) ...
* commit '0c6c7ee5837ed93f6fb09ca58b280e76878c21f1': (109 commits) feat(memory): activate PostgreSQL memory search and lifecycle (#174374) fix: join process shutdown and isolate runtime fixtures (#174359) refactor(ui): scope native gateway observation to Solid (#174367) refactor(ui): own canvas widget lifetime in Solid (#174370) perf(control-ui): keep agent avatar faces stable across agent publications (#174239) perf(models): release unused account catalog instructions (#174361) refactor(ui): own composer command menus in Solid stores (#174321) refactor(ui): separate sidebar filter state from view lifecycle (#174352) test(release): make artifact qualification deadlines deterministic fix(codex): preserve sandboxed process inspection and setup errors (#174284) fix(gateway): stop worker processes before draining their queues (#174312) refactor(agents): reuse prepared tool facts (#174349) test(gateway,plugins,ui): remove low-value tests (batch d174) (#174331) refactor(ui): replace MCP retirement host adapters with a factory (#174375) refactor(logging): remove redundant native success traces (#174330) refactor(test): remove dead control-plane fixture branches (#174377) refactor(mcp): remove test-only session runtime seams (#174347) feat(matrix): account-root state databases follow the selected engine (#174315) refactor(discord): collapse private interaction and factory seams (#174322) refactor(feishu): reuse streaming merge in dispatcher tests (#174371) ...
* commit '14e993fff3ecb84eb1d7c9724c4ceda235d797e4': (110 commits) fix(decisions): align accounting ratchet evidence feat(memory): activate PostgreSQL memory search and lifecycle (#174374) fix: join process shutdown and isolate runtime fixtures (#174359) refactor(ui): scope native gateway observation to Solid (#174367) refactor(ui): own canvas widget lifetime in Solid (#174370) perf(control-ui): keep agent avatar faces stable across agent publications (#174239) perf(models): release unused account catalog instructions (#174361) refactor(ui): own composer command menus in Solid stores (#174321) refactor(ui): separate sidebar filter state from view lifecycle (#174352) test(release): make artifact qualification deadlines deterministic fix(codex): preserve sandboxed process inspection and setup errors (#174284) fix(gateway): stop worker processes before draining their queues (#174312) refactor(agents): reuse prepared tool facts (#174349) test(gateway,plugins,ui): remove low-value tests (batch d174) (#174331) refactor(ui): replace MCP retirement host adapters with a factory (#174375) refactor(logging): remove redundant native success traces (#174330) refactor(test): remove dead control-plane fixture branches (#174377) refactor(mcp): remove test-only session runtime seams (#174347) feat(matrix): account-root state databases follow the selected engine (#174315) refactor(discord): collapse private interaction and factory seams (#174322) ...
* commit '0c6c7ee5837ed93f6fb09ca58b280e76878c21f1': (109 commits) feat(memory): activate PostgreSQL memory search and lifecycle (#174374) fix: join process shutdown and isolate runtime fixtures (#174359) refactor(ui): scope native gateway observation to Solid (#174367) refactor(ui): own canvas widget lifetime in Solid (#174370) perf(control-ui): keep agent avatar faces stable across agent publications (#174239) perf(models): release unused account catalog instructions (#174361) refactor(ui): own composer command menus in Solid stores (#174321) refactor(ui): separate sidebar filter state from view lifecycle (#174352) test(release): make artifact qualification deadlines deterministic fix(codex): preserve sandboxed process inspection and setup errors (#174284) fix(gateway): stop worker processes before draining their queues (#174312) refactor(agents): reuse prepared tool facts (#174349) test(gateway,plugins,ui): remove low-value tests (batch d174) (#174331) refactor(ui): replace MCP retirement host adapters with a factory (#174375) refactor(logging): remove redundant native success traces (#174330) refactor(test): remove dead control-plane fixture branches (#174377) refactor(mcp): remove test-only session runtime seams (#174347) feat(matrix): account-root state databases follow the selected engine (#174315) refactor(discord): collapse private interaction and factory seams (#174322) refactor(feishu): reuse streaming merge in dispatcher tests (#174371) ...
) Wait for IPC disconnection before completing brokered children, and stop catalog recovery before importing a runtime whose owners have retired. Keep Darwin census fixtures synthetic under Bun, expect the native Linux subreaper independently of the test runtime, and avoid epoch-zero session expiry in heartbeat model-override tests.
What Problem This Solves
Fixes Bun test failures caused by Darwin fixtures reaching the host's native process census, stale cleanup expectations, and incomplete lifecycle settlement during cancellation and Gateway shutdown.
User Impact
Brokered child completion now includes IPC disconnection. Gateway shutdown avoids importing model recovery after all catalog owners retire. The test fixture changes preserve the same custody, cancellation, and admitted-work assertions on Node and the pinned Bun fork.
Why This Change Was Made
openclaw-process-census.test.tsdoctor-plugin-source-captures.test.tspsfixture. Mock the native boundary with the same self/peer records.node-worker-supervisor.lifetime.test.tsheartbeat-runner.model-override.test.tssqlite-readonly-worker.auth.test.tscloseafter process exit but before its IPC disconnect receipt, allowing cancellation to settle withconnected === true. Join both receipts in the existing child owner; add deterministic event-order regression tests.server-close.model-acquisition.test.tsNo Bun-only skips, timeout increases, dependency changes, or new runtime owners. The simplification pass retained the existing protocol and ownership boundaries. Production delta is +5/-1 (net +4): the IPC completion check and post-cleanup recovery guard have no coherent nearby deletion to offset them. Test delta is +62/-4 (net +58). Main now owns the shared-row synthetic census fixture in the Doctor test; this PR retains its isolation annotation.
Evidence
Refreshed head
c8aea392eeaada6d61e1123122e60e586ffe8295includes main's launcher-bound maintenance fix (#174268) and baseline ratchet repair (#171916). The Doctor conflict preserves main's complete fixture and assertions, including one shared synthetic process inventory forpsand native Darwin census; the duplicate mock was removed. Bothdoctor-plugin-source-captures.test.tsandopenclaw-process-census.test.tspassed 3/3 on Node and 3/3 on pinned Bun. The other three touched test files passed once on each runtime: 18 whole-file executions, 762 test cases, no failures. Commands usedTMPDIR=/private/tmp/oc-bunci3,CI=1,OPENCLAW_VITEST_RUNTIME=node|bun, andpnpm test <files> --maxWorkers=1. Bun revision and executable SHA-256 match the repository pin. Conflict-file formatting/lint andgit diff --checkpass; fresh Codex autoreview found no actionable P0–P2 findings. Exact refreshed-head CI run 38926585552, attempt 1, completed with one inherited failure:check-guardsrejects main’s newcli-parent-lifetime.mjsbecause the duplicate-scan targets omit it;openclaw/ci-gatefails downstream. All other selected jobs passed, includingchecks-fast-baseline-ratchets. The failure table calls this new relative to scheduled main9151847f, which predates the file. The failed job checked out mergef93da3edover main5aec2058; its root file, scanner, and tracked-path inventory match that main parent exactly.node scripts/check-duplicates.mjs --coveragereproduces the same failure. Landing uses the coordinator-authorized inherited-failure exception; CI remains recorded as failed. The older CI result below remains prior-head evidence.Linux candidate: all 26 whole-file runs passed (13 files under both runtimes), including the six tests listed above, the broker event-order regression, positive catalog-pool recovery, and the five remaining Gateway siblings. The new IPC tests fail on the original child owner under both runtimes and pass with the repair. Formatting, targeted lint, core typecheck, scoped test typechecks, and
pnpm buildall passed. Exact-head native CI watch is GREEN for336cf242b2ff273448ce39e2be4955321eea5307: run 38922899998, zero pending/current failures. GitHub's aggregate still includes 79 superseded cancellations; the repository watcher reconciled them.pnpm test:ci-failed 174359 --jsonreported no failed jobs or tests, so no replay was needed.The starting snapshot
a60b6a7f77902f5eb1e306138c511a816b03150awas repeated three times per runtime on one direct AWS Crabbox lease (72 whole-file executions). Census, Doctor capture, and native-supervisor fixtures failed 3/3 on Bun and passed 3/3 on Node. All six Gateway files, heartbeat, and user preferences passed 3/3 on both runtimes. The auth-reader cancellation case passed every run; an unrelated observation-count case failed once on Node. All Bun commands use the repository pin1.4.3-canary.1+c45839085.Linux used Node
v24.19.0and the pinned Bun revision. Each listed test used these commands; focused macOS census, Doctor, and IPC runs also passed on both runtimes:For original-code regression proof, both commands additionally used
-t 'joins IPC'with the originalsrc/process/spawn-broker/child.tsrestored temporarily on the remote lease; both exited 1 with the premature-close assertions. No local source was reverted.Static/build gates (all exit 0):
pnpm exec oxfmt --check <seven changed files>;node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json <seven changed files>;pnpm tsgo:core;node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.<area>.jsonforinfra,other,gateway-other, andservices;pnpm build(290 seconds).Candidate whole-command wall times, Bun/Node in seconds: census 29.72/11.23, Doctor 10.83/12.08, auth 15.44/21.05, lifetime 29.36/35.47, heartbeat 19.75/25.01, event-order 9.58/10.73, shutdown 27.56/34.82, positive recovery 46.65/57.66. These include compiler/worker preparation; the cold census run rebuilt the worker cache.
Codex autoreview of the final diff and surrounding lifecycle modules: scoped-clean through P2.
git diff --checkpasses.Trial Findings and Limits
The original agent-chat shard never reached its terminal summary. Its final snapshot recorded severe CPU, memory, and I/O pressure; the current dual-all wiring already doubles deadlines. Individual baseline repeats distinguish those late timeout/cleanup failures from the reproducible fixture and lifecycle defects; no speculative trial-wiring change is included.
user-preferences.test.tspassed all 13 cases on both runtimes in the saved trial-2 log. A test name containingon FAILwas not a failed status.The auth-reader baseline separately exposed a pre-existing Node exact-count flake: disabling
fs.watchleaves fallback recovery polling active at the next wall-clock boundary, which may legally publish an unchanged observation. The cancellation case passed. That unrelated assertion is unchanged.