Repository navigation
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: needs maintainer review before merge. Reviewed September 29, 2026, 12:38 AM ET / 04:38 UTC (Revision 21). ClawSweeper reviewWhat this changesDuring Gateway restart drain, the branch closes settled agent and session-reclamation SQLite writers early, logs lease and receipt outcomes, and updates lifecycle documentation and tests. Merge readiness✅ Ready for maintainer review Keep open. Current main still retains the writers that can prevent a clean restart receipt, and the earlier merged receipt work did not resolve that remaining path. The process, crash, and upgrade evidence supports this distinct fix; review found no actionable defect. Priority: P2 Review scores
Verification
How this fits togetherOn a managed restart, the Gateway drains work while agent and session-maintenance workers may still hold SQLite connections. Their final lease release determines whether the next process can reuse a clean-close receipt or must run the full integrity gate. flowchart LR
A[Managed restart] --> B[Gateway drain signal]
B --> C[Agent writer]
B --> D[Session maintenance writer]
C --> E[Lease and checkpoint owner]
D --> E
E --> F{Clean close receipt?}
F -->|Yes| G[Fast reopen]
F -->|No| H[Full integrity gate]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +79, Tests +178, Docs +18. Total +275 across 20 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep final checkpoint and last-lease certification with the existing lease owner, and use Gateway drain to retire settled writers while interrupted writes retain full admission checks. Do we have a high-confidence way to reproduce the issue? Yes. The supplied Testbox process fixture compares the retained-writer baseline and candidate through managed SIGTERM, a blocked sidecar, and public cold reopen; current main still has the baseline writer behavior. Is this the best way to solve the issue? Yes. The patch acts in the existing writer and lease owners, preserving the final checkpoint requirement and the full integrity gate for a killed writer. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 33b10da45a8e. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (20 earlier review cycles; latest 8 shown)
|
199ad25 to
243e3d6
Compare
c87c984 to
728bbac
Compare
3176f13 to
d3f4f9a
Compare
Retire ordinary retained reclamation connections when Gateway drain commits, after accepted requests settle. Preserve canonical-validation scope ownership and prove native close, lease release, clean receipts, and cached readmission. Extend the managed SIGTERM fixture to include both retained writer owners.
Keep independent config file notifications out of approved-operation journal fixtures. Join real requester retry work before advancing its remaining virtual deadline window, and scan core import ASTs through the existing batched parser without changing inventory or assertions. Production behavior and timeout limits remain unchanged.
Replace the drain-recovery fixture clock poll with the existing durable admission observer. Let that fixture await scheduler stop in finally and migrate all callers together, preserving their state and RPC assertions.
2efc3a8 to
ed9ce55
Compare
Retire ordinary retained reclamation connections when Gateway drain commits, after accepted requests settle. Preserve canonical-validation scope ownership and prove native close, lease release, clean receipts, and cached readmission. Extend the managed SIGTERM fixture to include both retained writer owners.
Keep independent config file notifications out of approved-operation journal fixtures. Join real requester retry work before advancing its remaining virtual deadline window, and scan core import ASTs through the existing batched parser without changing inventory or assertions. Production behavior and timeout limits remain unchanged.
Replace the drain-recovery fixture clock poll with the existing durable admission observer. Let that fixture await scheduler stop in finally and migrate all callers together, preserving their state and RPC assertions.
Integrate main at 6391a9a while preserving drain-time writer retirement and the current maintenance admission owner. Keep the integrity timing suite from main after its retired case was removed. Verified on Blacksmith Testbox: changed checks passed; 346 focused tests passed across 11 files. Independent review found no actionable P0-P2 defects.
Reconnect the published PR head after the pre-existing local rebase without rewriting remote history. Keep main’s deliberate integrity-test removal and cursor icon isolation together with the PR cleanup. The resulting tree is byte-identical to the independently reviewed and Testbox-validated merge candidate.
Backport main fix 743c2ce for the inherited check-lint-core-1 failure in CI 36520697644. Preserve all fixture records, ordering, and assertions. Blacksmith Testbox incremental checks passed and run-history.test.ts passed 10 tests; independent review found no actionable P0-P2 defects.
…penclaw#160201) * perf(state): close idle writers during shutdown drain * fix(state): keep receipt diagnostics out of CLI JSON * fix(state): retire reclamation writers during shutdown drain Retire ordinary retained reclamation connections when Gateway drain commits, after accepted requests settle. Preserve canonical-validation scope ownership and prove native close, lease release, clean receipts, and cached readmission. Extend the managed SIGTERM fixture to include both retained writer owners. * test: stabilize CI fixtures and batch import guards Keep independent config file notifications out of approved-operation journal fixtures. Join real requester retry work before advancing its remaining virtual deadline window, and scan core import ASTs through the existing batched parser without changing inventory or assertions. Production behavior and timeout limits remain unchanged. * test(recovery): await durable admission and scheduler cleanup Replace the drain-recovery fixture clock poll with the existing durable admission observer. Let that fixture await scheduler stop in finally and migrate all callers together, preserving their state and RPC assertions. * test(gateway): scope first sign-in fixture to its provider * test(gateway): join cursor workspace icon preparation * perf(state): close idle writers during shutdown drain * fix(state): keep receipt diagnostics out of CLI JSON * fix(state): retire reclamation writers during shutdown drain Retire ordinary retained reclamation connections when Gateway drain commits, after accepted requests settle. Preserve canonical-validation scope ownership and prove native close, lease release, clean receipts, and cached readmission. Extend the managed SIGTERM fixture to include both retained writer owners. * test: stabilize CI fixtures and batch import guards Keep independent config file notifications out of approved-operation journal fixtures. Join real requester retry work before advancing its remaining virtual deadline window, and scan core import ASTs through the existing batched parser without changing inventory or assertions. Production behavior and timeout limits remain unchanged. * test(recovery): await durable admission and scheduler cleanup Replace the drain-recovery fixture clock poll with the existing durable admission observer. Let that fixture await scheduler stop in finally and migrate all callers together, preserving their state and RPC assertions. * test(gateway): scope first sign-in fixture to its provider * test(gateway): join cursor workspace icon preparation * test(cron): build history ordering records without a map spread Backport main fix 11a8e2c for the inherited check-lint-core-1 failure in CI 36520697644. Preserve all fixture records, ordering, and assertions. Blacksmith Testbox incremental checks passed and run-history.test.ts passed 10 tests; independent review found no actionable P0-P2 defects.
What Problem This Solves
Fixes unnecessary full agent-database integrity scans after a managed restart exhausts its drain budget and exits while unrelated cleanup is still pending. Related: #159753.
User Impact
Finished SQLite writers release their leases early enough to preserve the existing clean-restart witness. A crash during a write still requires the full admission gate. No configuration, schema, migration, or rollback change is required.
Why This Change Was Made
The previous process reached OpenClaw's own shutdown deadline and exited zero with cleanup incomplete. Native execution and ordinary session-reclamation workers retained idle connections for 30 minutes; their late shutdown close sat behind stalled sidecars. A synchronous exit callback could not finish asynchronous worker lease release.
Both existing owners now observe the one-way drain signal: idle connections retire immediately, and active connections close after accepted work settles. Canonical-validation scopes retain their existing ownership. Cancellation never certifies a receipt: the last lease must still finish its checkpoint and native close. A later cleanup writer uses ordinary admission and dirties the receipt again.
The lease owner logs
agent database clean-close receipt: writtenor its skip reason, after commit. Stale admission logsowner-pid-deadorowner-start-time-changedand that the previous release was not observed. Agent leases have no expiry, boot ID, or generation field. Archive-worker diagnostics go to stderr so CLI JSON stays valid.Evidence
Merge repair: current head
03e578aa9535Merged main at
6391a9ad3311and preserved the published7089beb81c4dancestry with ordinary merge commits and a fast-forward push. This worktree already contained an unpublished rebase when the repair began; no rebase or force-push was performed during this repair. Final tree:794d37691c4c23a45db309b7d46dee0cefe403cb.Resolved the integrity-timing conflict by retaining main's replacement suite from
e5d45852792b(#160766), which deliberately removed the case changed by the older PR. Retained main's cursor icon-isolation mock fromcaf777893868(#160807) alongside the PR's cleanup. Main's session-entry redesign (#160358) and maintenance admission changes (#160815) remain intact. The ancestry-reconnection commit has no tree changes; its tree exactly matches the reviewed and tested candidate. No additional production behavior or configuration was introduced.Fresh proof ran through the installed Crabbox CLI on blacksmith-testbox / openclaw-check, lease
tbx_01m3nkrdqm33wsh49bdq26kg4k(provisioning run). Before both validation commands, Git blob hashes verified all 19 PR paths, the integrity-test resolution, package files, and validation runners. Native sync overlays the candidate on its own Git checkout; checks used the exact merged base. Dependencies were installed once withpnpm install --frozen-lockfile. The lease was stopped after proof.env CI=1 OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 node scripts/check-changed.mjs --base 6391a9ad3311451c39f5d0653332d574513a5e3d -- <all 19 PR paths>passed in 25m13.402s. Core production types, all 27 test type groups, formatting, ratchets, dead-export scans, storage/boundary guards, and import cycles passed. Typed lint: 0 warnings/errors, 18 files, 22.0s.oxfmtandgit diff --checkpassed. Fresh independent Codex review was scoped-clean through P2, with no findings. The default connection failed without a verdict; the configured authenticated route completed with unchanged model selection and reviewer isolation.The initial changed-check command used the Testbox's newer
HEADas its comparison base and stopped at an unrelated line-cap mismatch insession-accessor.test.ts; it was corrected to the pinned merged base without changing candidate source. The successful run reported the environment-variable base-budget comparison unavailable in its shallow Git history; the current count remained 476/476, and all selected guards completed. Non-fatal dependency build warnings and runner-portal sync timeouts did not affect validation or lease cleanup.No new performance benchmark or published-updater proof was run for this integration-only repair. Historical measurements below remain evidence for their named heads: notably 114 → 0 synchronous integrity PRAGMAs after managed shutdown; they are not relabeled as measurements of this head. No live Gateway was modified.
Current-head CI 36520697644 is running on
03e578aa9535c33752698a500a8e4406213954df. GitHub reports the PR mergeable. No merge or auto-merge command was issued during this repair.Previous integration, performance, update, and CI evidence
Final head:
7089beb81c4d, including the two CI fixture follow-ups below. Receipt-owner source remains unchanged from the rebased runtime proof.Rebased onto
165fd29a4c1d0308a3dd264de40a9b755963b983; candidateed9ce554b39efb737aa9a4f5a2f32bf61eb419ea. The only textual conflict was the cold-startchat.startupwait already present on main (with its explanatory comment, via #160366). Main's version is retained verbatim and the duplicate commit is dropped. The config-watcher fixture correction was also already on main. All three production commits are patch-identical, and the drain/lease/receipt owner files are byte-identical to previously green2efc3a8e677c. Main's newer registry/config owners and planner repair are preserved.Fresh proof uses blacksmith-testbox / openclaw-check, lease
tbx_01m3mwjb62ez9hp9gqztan8eb4(provisioning run). The native transport retains main as Git HEAD and overlays the unpublished candidate; exact checkout/base and SHA-256 checks bind all 18 PR paths, package files, and runners to this candidate. An initial head-only guard stopped before tests; checksum-bound validation then passed. Dependencies were installed once withpnpm install --frozen-lockfile. No heavy validation ran locally.The reconstructed process fixture compares the same 68,395,008-byte synthetic store on one lease. Its independent baseline copy removes only drain retirement from the two writer owners, retaining current main, diagnostics, and type moves. Both variants use actual SIGTERM, exhausted drain, a real admitted reply claim through the abort-finalizer commit, stalled external cleanup, and the real 85-second watchdog under a synthetic 90-second service stop budget.
The elapsed cold-open improvement in this single pair is 3.9%, smaller than the historical measurements below; the deterministic result remains removal of all 114 synchronous checks. Candidate warmed receipt reuse measured 0.097 ms, and a separate post-open schema/index probe measured 9.832 ms. Neither is a cold-open component timing. The SIGKILL-mid-write control kept a dirty receipt, ran 114 PRAGMAs / 14 ms of table checks, and rolled back the unfinished write.
python3 /tmp/lane252d-compare.py /tmp/lane252d-proof.mtspassed baseline managed restart, candidate managed restart, and candidate SIGKILL in 227.836 s remote command time. The temporary baseline cleaned itself up.Focused suites passed 122 tests across 10 files, 183.62 s runner / 195.668 s remote command. Managed SIGTERM took 2.950 s; idle/active reclamation drain regressions took 1.380/1.511 s.
env CI=1 OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 node scripts/check-changed.mjs --base HEAD -- <all 18 PR paths>passed on the same checksum-bound candidate in 28m23.853s. Core production types, all 26 test type groups, formatting, line/suppression guards, all dead-export scans, storage/schema/boundary checks, export checks, and import cycles passed. Typed lint reported 0 warnings/errors on 17 source files in 22.1s.git diff --checkpassed. The lease was stopped after proof.Fresh independent Codex review is scoped-clean through P2. The default route failed without a report; the configured direct route completed with no findings and unchanged reviewer isolation. Runtime/package/updater proof below remains labeled with its originally tested commits; no package rebuild or published-driver rerun was requested for this patch-identical integration. No live Gateway was modified.
Conflict-repair CI 36486597970 on
ed9ce554b39efailed onlychecks-node-changed-compact-large-2plus the aggregate gate: the existingsetup-inference.first-signin.integration.test.tscase exceeded 90 seconds. Diagnostics showed 72.728s inside Gateway startup/connect, then completed mocked device login, catalog, and embedded-probe requests before the wizard deadline. All Windows shards, extension bundles, UI E2E, and Docker seed passed; neither named infrastructure hold occurred.The exact CI merge tree
3738b052fc8a7158e392a2140364463b9994a64d(maina46cde88785dplused9ce554b39e) was replayed on blacksmith-testbox / openclaw-check, leasetbx_01m3mzt3xerzmhknt2mkhfvhjv(provisioning). The captured five-group plan ran throughnode --import tsx scripts/ci-run-node-test-shard.mts, preserving group/file order, worker limits, serial plan execution, and eight-CPU affinity. It passed 160 tests, one Windows-only skip, in 11m17.401s including preparation. The unchanged sign-in case took 22.480s; this passing replay does not explain the original timeout.The retained follow-up adds only
plugins.allow: ["github-copilot"]to that provider-specific fixture. Its existing explicit configuration otherwise allowed unrelated default plugins to load. The real Gateway, setup RPC, device login, embedded probe, durable credential, hot-reload, and final model assertions stay intact, as does the 90-second timeout. No production code or assertion changed.Paired standalone
node scripts/run-vitest.mjs src/gateway/setup-inference.first-signin.integration.test.ts --maxWorkers=1measurements, with identical temporary phase logging in both variants, showed startup/connect 32.782s → 9.419s, case time 40.025s → 24.064s, and runner wall 81.26s → 57.30s. Both passed every assertion. The paired command took 162.027s. Its first byte guard caught a transfer-added trailing newline before running tests; the corrected transfer matched the candidate SHA-256. This demonstrates reduced fixture startup cost, not a reproduced diagnosis of the CI timeout.The final, instrument-free Gateway group passed 97 tests, one Windows-only skip in 325.26s runner; sign-in took 9.748s. The same merge-tree changed gate then found an inherited environment-count mismatch (485 vs 484) from main's Windows browser probe change
68a9ce03243a(#160432). That source and budget are untouched by this PR. The local Crabbox reporting wrapper stalled after recording the completed remote failure and was stopped; no remote test was interrupted. Validation continued on the published PR source plus the checksum-bound one-line fixture edit, whose count remains 484/484.env CI=1 OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 node scripts/check-changed.mjs --base HEAD -- src/gateway/setup-inference.first-signin.integration.test.tspassed on the checksum-bound published-head candidate in 5m24.699s: Gateway-root types passed in 67.2s, all formatting/declaration/dead-export/boundary guards passed, and typed lint reported 0 warnings/errors in 10.8s.git diff --checkpassed. The lease was stopped before committing.Fresh independent review of the fixture change is scoped-clean through P2. The previously reviewed and tested receipt owners are unchanged. CI 36492961494 on
061359450b48passed the sign-in follow-up but exposed a different fixture lifecycle failure inchecks-node-changed-compact-small-17:EnvironmentTeardownErrorduring ACP suite collection. The recorded import chain came from the preceding cursor test's nonblocking workspace-icon preparation. Its final twochat.startupcalls launched those real promises, but cursor teardown joined only session readers and databases.The cursor fixture now spies through the real icon-preparation function and joins its returned promises in
finallybefore disposing its state. Assertions and optional-production behavior are unchanged. Shared history response typing keeps the file at 595 lines, five fewer than before; this follow-up adds no production code.On
blacksmith-testbox/openclaw-check, leasetbx_01m3n3bx2mdcf4cfe0dwm2sjvx, the captured original 14-file group passed 99 tests unchanged in 124.39s runner / 177.639s remote command on exact CI merge treee324b99f905d4c7f46ab998180411e2c332a7646. This replay alone did not reproduce the teardown race. A disposable deterministic gate then retained both real icon preparations until the scenario's next event-loop turn: old source failed the named ownership assertion with 2 pending preparations at callback return; repaired source passed with 0 pending, still calling the real owner twice. Both probe paths joined their work even on failure.python3 /tmp/lane252d-icon-probe.pypassed this negative/positive comparison in 121.874s remote time (baseline/candidate test commands 53.508s / 44.702s).The instrument-free repaired 14-file group passed 99 tests in 110.37s. Intermediate typechecking caught incomplete response annotations in the nearby consolidation; the required array and discriminator types were restored without changing runtime behavior. Two subsequent source-sync attempts hit Blacksmith's two-minute checksum deadline before tests began; the stopped lease was replaced through the normal owner. Final source hash
1541aebd7edc92c6aebdc195d2cf0f9c65ad0bb8743d85dbe5a3940cd0a4259apassednode scripts/check-changed.mjs --base HEAD -- src/gateway/server.chat-history-cursor.test.tson branch-based leasetbx_01m3n64xn9y6ss1wvabjas9qct: 5m11.968s, Gateway-server types 53.9s, typed lint 13.3s with zero warnings/errors, and all selected formatting/guard/dead-export checks. Intermediate leasetbx_01m3n5mbx9had7kke11xjfxpy3and the final lease were also stopped.Final independent review of the cursor cleanup is scoped-clean through P2, with no findings. Two earlier reviews were cancelled before verdict when static checking identified the intermediate type omissions; they are not counted as approvals. Fresh CI is pending on
7089beb81c4d; both earlier failures and their corrections remain recorded above. No merge command, workflow rerun, timeout increase, or empty proof push was used.Earlier implementation, package/update, and CI evidence
The pre-integration process fixture on
5afe970abd5bused a 68,395,008-byte synthetic database, actual SIGTERM, exhausted restart/reply drain, an abort-finalizer write, stalled non-storage cleanup, and the real 85-second watchdog under a synthetic 90-second systemd stop budget. Both retained writer owners were present. Baseline and candidate shared the same Testbox; only those two owner files were restored frombb05e779e2a7for the baseline, with final diagnostics and all siblings held constant.5afe970abd5b0)1)stale-lease, table gate (32 ms)The candidate logged a written receipt after the abort-finalizer SQL commit and released both native writers before blocked external cleanup/watchdog exit. Intermediate incomplete checkpoints remained conservative; a later completed last close certified the receipt. Observed shutdown-owner lines included:
The baseline reopen logged this for both surviving leases:
The same candidate's separate SIGKILL-mid-write control retained a dirty receipt, ran the full gate (15 ms, 114 PRAGMAs), and rolled back the unfinished write.
Receipt validation took 0.124 ms. A separate schema/index probe after public open took 16.787 ms. Total cold open is not under 10 ms. An earlier broader 10 ms probe assertion also failed (16.67 ms); receipt validation and total admission are distinct measurements.
This paired proof passed against
5afe970abd5b0130445dce9eb05743bd4bd03364onblacksmith-testbox/openclaw-check, leasetbx_01m3ksx8tdc1vkyc5f5g9cvxky, in 255.34 seconds. It ran the checksum-bound comparison script invokingnode --import tsx /tmp/lane252c-proof.mts driver stale managedfor the baseline andnode --import tsx /tmp/lane252c-proof.mts driver witness allfor the candidate. The independent scratch copy was removed; the synced source remained clean.The existing managed-SIGTERM Gateway regression now holds both writer types. It checks that abort settlement releases their leases while a sidecar is blocked, then verifies a clean receipt and cached reopen. New reclamation cases cover idle drain and drain during an accepted commit; both failed on the old owner because retirement never started. They also verify native worker exit, zero leases, committed data, and reopen without another full scan. No real sleeps, extra Gateway boots, or test-only production seams were added.
Final focused proof on
tbx_01m3kp1tpg69pv8dg1fff3vf8r:node scripts/run-vitest.mjs src/config/sessions/session-accessor.sqlite-reclamation-reuse.test.ts src/config/sessions/session-accessor.sqlite-reclamation-worker.test.ts src/config/sessions/session-canonical-validation-readiness.test.ts src/gateway/server-close.agent-databases.test.ts --maxWorkers=1passed 46 tests in 91.85s runner / 116.28s remote command including check selection. The new idle and active cases took 1.087s and 0.973s; the Gateway file took 51.30s including transform/setup and the three owner files took 37.51s. The final type/fixture split and real-IPC test observation were then verified ontbx_01m3kqh6s4brfbvgdce3cqj7bt: selected formatting, file-size, documentation, storage, boundary, export, import-cycle, lint, and type checks all passed. Core production types passed in 51.72s; Gateway and sessions test-type groups passed in 51.3s and 41.4s, with the final test-only change rechecked in 21.0s. Typed lint finished with zero warnings/errors.node scripts/run-vitest.mjs src/config/sessions/session-accessor.sqlite-reclamation-reuse.test.ts src/config/sessions/session-accessor.sqlite-mutation-worker.runtime.test.ts --maxWorkers=1passed 25 tests in 70.82s runner; the final idle/active cases took 2.021s/1.978s. The continuation command, including remaining checks and tests, took 5m28.06s. Earlier failed attempts identified missing shallow Git refs, file-size limits, and the test method-capture lint issue; all were addressed without relaxing guards. The stalled history-fetch lease was stopped and the remaining checks used the published PR head as their explicit incremental comparison.All heavy validation used the installed Crabbox CLI with provider
blacksmith-testbox, profileopenclaw-check. No local tests, builds, or typechecks ran.tbx_01m3k7br2gn9ha7mwbh9ee71am:node scripts/check-changed.mjs --base HEAD -- <original seven paths>passed in 21m17s, including core types, all 25 required test type partitions, formatting, lint, storage guards, and import cycles. The Gateway/lease pair passed 20 tests (51.64s runner); six admission/lease siblings passed 74 tests (57.57s runner). The original process fixture passed in 1m41.6s.tbx_01m3kjd5mj549s0ckmrg4f0vax: the five original CLI JSON failures, seven admission-timing cases, and five reclamation cases passed after archive-worker stderr routing. Formatting, typed lint, core types, selected test types, and import cycles passed.tbx_01m3kp1tpg69pv8dg1fff3vf8r: the two new reclamation regressions failed on the old owner in 31.02s runner / 49.42s remote command. Source hashes bound the published base, reviewed unpublished correction, and dirty candidate because native targeted sync initially omitted the unpublished commit.Published-updater × candidate proof passed on
tbx_01m3ksx8tdc1vkyc5f5g9cvxky. The canonicalnode scripts/package-openclaw-for-docker.mjspacker built candidate5afe970abd5b0130445dce9eb05743bd4bd03364in 539s; tarball SHA-256:a06df3f081aa185e716f905f027cc26ff7003aa64315456b656909c0e8ae6c29. The installed published[email protected]created a real session/history in isolated operator state (3,960,832-byte shared database), then its unchanged updater ranopenclaw update --tag file:<candidate.tgz> --yes --no-restart --json: ok, npm mode, 73.034s. The installed build commit matched the candidate exactly.Candidate startup/history/write passed. The fixture initially attempted to import an intentionally unshipped
qa-runtimemodule; that was a fixture error. It resumed on the same installed package and state using the matching source helper only to prepare the supervisor's native restart intent, without reinstalling or rerunning the updater. The corrected managed-restart/readmission segment passed in 31.207s: actual SIGTERM and exit zero, 1/1 clean receipts, preserved published history and candidate write, a successful subsequent write, one consumed receipt, and no stale-lease gate. All fixture children were joined and the lease was stopped. This is isolated package/update proof, not a production deployment.Independent Codex reviews of the original fix, CLI-output correction, and reclamation completion were scoped-clean through P2. Integrated production head:
728bbac9576095d4e22cb362051c70bb39a53325, rebased onto465fdd5adba67a2b8cef72fcc8c7fd688b7c9967to resolve an actual conflict.git range-diffconfirms the three production commits are patch-identical. Main had landed the equivalent requester clock repair in #160407; its version is retained verbatim and the duplicate was dropped from this PR.CI run 36411439267 on
5afe970abd5bexposed a config-fixture race, requester timeout/duplicate-wake failures, and a guardrail no-output timeout. The config group now disables independent seed-file notifications while keeping real managed writes, cache, journals, and every assertion. Exact-merge replay passed 81 cases before the change; that passing replay does not erase the original failure. The repair passed 81 cases (214.62s runner), typed lint (30.2s), and Gateway test types (50.5s) ontbx_01m3kw0bw3tgg6dszs2v6dxyxb.Requester tracing exposed a real worker-task timeout during a 151-second virtual-clock advance. Joining the retry at its stored deadline before crossing the rest of the same window passed all 18 cases, lint, and types; main now supplies that repair. The original native timeout and following duplicate did not recur in focused replays, so their cause remains unconfirmed.
The import guard retains all 20 cases and all AST assertions but uses the existing parser's 32-file batches. Paired two-CPU runs with the same 300-second no-output watchdog passed both variants: core assertion 18.258s → 11.865s, command 73.887s → 56.414s, with 12,046 inventory/parsed/asserted files. Final instrument-free code passed 20 cases, typed lint, canonical plugin-SDK test types, and size guards on the same lease. The CI watchdog timeout did not reproduce; this is a measured reduction in scan cost, not a proven diagnosis of that timeout.
Exact-head CI case costs from the five successful jobs in the
5afe970abd5brun were recovered: reclamation-reuse 24.405s (new idle/active cases 1.271s/1.148s), Gateway close 20.023s (managed SIGTERM 2.699s), integrity-lease 7.102s, open-timing 1.061s, mutation-worker runtime 0.002s. These are summed case times, not isolated file wall time.Final integrated-head validation on
728bbac9576095d4e22cb362051c70bb39a53325passed onblacksmith-testbox/openclaw-check, retained leasetbx_01m3m39157hj1ez25kngktw8r6:active-leases; final executor close loggedwritten. Both leases were gone before blocked sidecar cleanup/watchdog exit. Managed reopen hadclean_close=1, cached admission, 0 integrity PRAGMAs, and 97.750ms cold public open. Separate warmed probes after open measured 7.582ms schema/integrity validation and 0.025ms receipt reuse; these are not cold-open component timings. SIGKILL mid-write retained a dirty receipt, logged the stale dead owner, ran 114 PRAGMAs / 9ms of table checks, and rolled back the unfinished write.8dbbc8b4ab148239e0d0e29b55aa2dc11776827d27247e4e5a48eac553eb8043. The installed published2026.9.6updater activated exact728bbacin 87.827s, npm mode/status ok. Installed-candidate startup/history/write, native restart intent plus actual SIGTERM, 1/1 clean receipts, preserved history, receipt consumption, and subsequent write all passed. The serial runtime/package/update command completed in 13m11.115s, exit zero. The lease and all owned Gateway children were stopped.CI follow-through exposed fixture and inherited-main failures, with no further production change in this lane. Main supplies the Telegram JSON-decoding repair (
c582939c018c), initial-roster/readiness repairs (6b9da9dc028,f03d64f6a56,94cbd1335dfb,e256cbef8ae0), retired voice-call guard removal (02a95db98aa1), heartbeat settlement repair (d9569745764f), and environment-budget correction (6e0d8aa1a0c4). These upstream versions are retained verbatim; duplicate local fixture edits were dropped.The remaining recovery-fixture correction is commit
4a82911f3afe: await the existing durable admission observer instead of a one-second mock-call poll. That fixture now owns awaited scheduler cleanup infinally; all six callers migrate together, preserving state, RPC-count, and pre-admission cleanup assertions. The large test file shrinks. Original-order replays passed the 18-file heartbeat shard and full recovery file, so their original timing causes remain unconfirmed. The side-chat lost-request failure reproduced in a sibling table row; a held-roster probe verified Status focus before Owners existed and retained focus after roster admission. Its added Escape-close step failed separately; a revised probe using the existing filter toggle passed the entire original keyboard flow, including its original later Escape assertions.Final retained-fixture proof passed on
blacksmith-testbox/openclaw-check, leasetbx_01m3mjyz33zwh2dhzjzc62m02x, at published11bfeaa51c42plus the checksum-bound candidate.node scripts/run-vitest.mjs src/agents/main-session-recovery/main-session-restart-recovery.test.ts --maxWorkers=1passed 222 tests in 188.16s runner / 209.64s wrapper. The equivalent local side-chat correction also passed all 24 cases in 33.56s before being replaced by upstream's broader shared helper. Targeted lint passed with zero warnings/errors (18.4s); canonical agents-other and UI-E2E type graphs passed (46.7s / 45.0s); line-cap, max-lines, environment census (484/484), and diff checks passed. Full serial command 399.789s, exit zero; lease stopped. The retained two recovery files exactly match the reviewed and tested bytes. Fresh review is scoped-clean through P2. Earlier proof ontbx_01m3mc9msjnbfn3vxj1xyyt3xqcovered the original-order baselines and 265 candidate tests; that lease expired only after its completed checks were recorded.Previous head:
2efc3a8e677c1a7cef10e711631fc7536b11e5f1. It preserves the tested8c2fbeb36d1fcorrection and the subsequent external merge of main. The prior integration through385ac2893544repaired the named export-guard failure. The original drain/receipt owners and the two recovery-file hashes are unchanged by that integration. Runtime/package/updater evidence above names the commit actually tested; unrelated incoming main changes have not been repackaged here.CI 36452900735 on
11bfeaa51c42had only two substantive failures: the daemon facade's nine transparent lazy exports were reported as collisions (fixed by385ac2893544), and Windows dependency installation failed before tests when the Matrix native-binary download returned HTTP 500 and its upstream error handler threw. No dependency patch, timeout increase, workflow rerun, or install-check bypass was added. The exact export guard passed on published8c2fbeb36d1fusingblacksmith-testbox/openclaw-check, leasetbx_01m3mm76gtnjsrp1mxsbq2fzpc:node --import ./scripts/tsx.mjs scripts/check-export-name-collisions.mts, 33.461s guard / 199.846s native command including checkout/dependencies, exit zero. CI 36464875599 was cancelled when the branch was advanced externally; its last snapshot had 100 successful jobs and zero failed jobs. That is not a green completion. CI 36466301485 on19cf7c1d449aended with 163 successful jobs, a navigation-fixture failure, and a cancelled real-Gateway shard that had already recorded two 180-second delegation/media test timeouts; the aggregate gate failed. All five Windows shards and the export guard passed. No real-Gateway failure artifacts were retained. The receipt owners remain unchanged. The focused packaged-Gateway replay below passed unchanged; the original timeout causes remain unconfirmed.The navigation fixture read the request count before transport readiness: both panes can enter loading while connection/initial-snapshot hydration is still pending. Commit
2efc3a8e677cawaits the existingchat.startuprequest observer before the exact one-request assertion; loading, response deferral, and both transcript assertions remain. Onblacksmith-testbox/openclaw-check, leasetbx_01m3mrw11v1vbkva2nd95phd4f,env CI=1 OPENCLAW_UI_E2E_SKIP_REAL_GATEWAY=1 OPENCLAW_VITEST_MAX_WORKERS=3 OPENCLAW_VITEST_FS_MODULE_CACHE_WRITER=0 taskset -c 0,1,2,3 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner --maxWorkers=3 ui/src/e2e/chat-flow.navigation-presentation.e2e.test.tspassed all 10 tests: unchanged exact-CI-tree baseline 29.00s, candidate 28.79s (target case 1.163s → 1.117s). The CI race did not reproduce. Targeted lint (11.32s, zero warnings/errors), UI E2E types (50.4s), line guards, and diff checks passed; final serial command 114.537s, exit zero. Fresh independent review was scoped-clean through P2; lease stopped. Previous-head CI 36478122119 passed the navigation file 10/10 in 31.075s, including the changed case in 2.410s. The entire run completed successfully, including Docker seed E2E andopenclaw/ci-gate. All nine mocked UI shards and both real-Gateway shards passed. No workflow rerun or empty push was used. The CI merge tree isd0b903bc642606786ca9c1caa1556080b077807e, combining this PR head with main548a1b899fd09d7adc1580fabe6c8cfd3643ff82.The two real-Gateway files passed unchanged on exact
2efc3a8e677c, providerblacksmith-testbox, profileopenclaw-check, leasetbx_01m3mtpestw5ydj4sr7vrmvs7t(lease provisioning). After restoring missing dependencies once and preparing Chromium through its existing owner,OPENCLAW_BUILD_PRIVATE_QA=1 OPENCLAW_RUN_NODE_SKIP_DTS_BUILD=1 pnpm buildpassed in 61.7s. With outerCI=true, the focused command was:Result: 2 files / 5 tests passed, 153.38s Vitest, zero unhandled errors; complete native command 381.628s, exit zero. Native approval took 48.987s, preceding media image 26.616s, PowerPoint 55.165s, and the two FullAccess cases 4.716s / 15.503s. The prebuilt owner verified runtime generation before and after. Node 24.19.0, eight CPUs, and two workers match the CI resource report. No source edits, tracing, assertion changes, or timeout changes were applied. Both original 180-second failures remain unreproduced; faster setup and case timings do not prove a fix or identify the original wait stage. The lease was stopped. Its separately linked provisioning workflow is cancelled after lease shutdown; the native proof command completed with exit zero, and the current-head repository CI run passed.
The earlier CI failures attributable to this PR were archive-worker diagnostics contaminating CLI JSON and a timing assertion counting unrelated receipt logs; both are fixed. Inherited merge-base failures were repaired separately on main: duplicate UI export (
bb05e779e2a7), reliability-helper export (da2efd83b8a6), update-test Node path (8b549de1e0c7), Bun GC scheduling (c136ec631464), and custody-test expectations (fa90c83d1ab8). No duplicate base repairs are included here.Production delta: 79 net lines, including a type-only extraction of the existing worker wire contract required by the file-size guard. Shared test fixtures were extracted with their assertions unchanged. The production Gateway was inspected read-only and was neither modified nor restarted. Fixtures use synthetic state and a synthetic systemd timeout response; they do not prove every possible blocked shutdown owner is eliminated. Active or unsettled writers, failed checkpoints, and failed cleanup retain conservative admission checks.