Repository navigation
fix(ci): join archive placement fixtures before teardown - #155751
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 changes before merge. Reviewed September 22, 2026, 9:47 AM ET / 13:47 UTC. ClawSweeper reviewWhat this changesThe PR makes three session-archive test cases release their held work and await request completion before fixture teardown, replacing polling with an explicit drain notification. Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this is a focused fixture-lifecycle repair still needed on current main. No introduced correctness or security defect was found; the maintainer-authored PR is also protected from automatic closure. Priority: P2 Review scores
Verification
How this fits togetherGateway session-archive tests exercise the session request handler with controlled worker drain and reclaim operations. Their fixture must finish those requests before closing the session databases. flowchart TD
A[Archive test request] --> B[Session request handler]
B --> C[Controlled drain or reclaim]
C --> D[Phase notification and assertions]
D --> E[Release and await request]
E --> F[Close fixture databases]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +26. Total +26 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep phase-driven synchronization and unconditional request joins in the existing fixture while preserving its archive-ordering and placement-identity checks. Do we have a high-confidence way to reproduce the issue? Yes, source establishes that a failed phase assertion can exit the old test without releasing or joining its pending request before database teardown. The original timing-dependent drain delay was not reproduced in this read-only review. Is this the best way to solve the issue? Yes, explicit phase notification and finally-based release/join repair the fixture owner without weakening assertions, extending timeouts, or changing production behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7eb4829ab8dd. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Reuse the landed fixture fix from 05804bc (#155751). Wait for actual drain and reclaim entry, then release and join held archive requests before teardown. Preserve ownership assertions and deadlines. Co-authored-by: Vincent Koc <[email protected]>
Preserve one-shot automatic SQLite exit cleanup and explicit recovery of retained worker custody. Include the reviewed checkout fixture single post-handler publication and current main's canonical archive-placement repair from #155751.
* commit '739e2410702e0b1ad1d17a6dac07ddc0ab6dbebb': (140 commits) fix(ui): pause passive polling in hidden tabs (#155617) improve(android): keep chat photos outside text bubbles (#155338) fix(ui): preserve saved project after discovery failure (#155619) feat: compare Kitchen Sink Gateway resource costs (#155734) test(gateway): arm clock-jump claim after readiness (#155748) chore(ui): refresh control ui locales (#155700) fix(ci): join archive placement fixtures before teardown (#155751) fix(matrix): keep bot discovery off the Gateway thread (#152122) fix(agents): reconcile late requester recovery receipts (#155357) test(gateway): guard embeddings HTTP fixture lifetimes fix: isolate triage fixture acquisition and cleanup (#155736) refactor(sessions): hydrate saved transcripts off thread (#153325) fix: Claude MCP turns abort before tool timeout (#155663) fix(goals): pause terminal failures and clarify goal states (#155694) fix(test): preserve watcher errors when diagnostic capture fails (#155383) ci: move native runtime proofs to release validation (#155606) fix(auth): decouple compaction from profile rotation (#155204) fix(agents): admit compaction outside retired plugin generations (#151232) perf(ui): reduce automatic session list refetches (#155705) test: avoid unused source repos in release input fixtures (#155733) ...
Archive lifecycle assertions polled for abort and batch-drain callbacks while directSessionReq was still preparing projection and history-worker state. On a polling failure, synthetic gates and RPCs could remain unsettled while fixture teardown revoked their readers. Install abort and drain checkpoints before dispatch, race them against RPC settlement, and release held synthetic work before joining the affected requests in cleanup. Preserve the cancellation, concurrency, generation, release-order and durable-state assertions. The intermediate one-second observation polls are intentionally removed; existing test-case and RPC timeouts remain unchanged. Keep the landed persistence-error repair and #155751's worker-placement repair intact. All 17 lifecycle cases passed on main 0a5b538 with the updated transcript hydration runtime in 87.462 seconds of cold command wall time. This exercises actual RPC preparation, SQLite/history workers and lifecycle ordering; cold compilation accounts for substantial setup cost. Fresh scoped P2 review found no actionable issues. Reuse the byte-identical fixture's previously passing formatting, lint, type and guard checks. No production code or test cases were added, and no whole-prefix replay or speedup claim is made.
* fix(sessions): stop repeated failed worker exit cleanup Use one-shot process-exit cleanup for retained reclamation workers and the canonical validation pool. A rejected asynchronous close previously kept its beforeExit listener, so each drained event loop repeated the same cleanup and could prevent CLI and QA commands from exiting. Keep failed database resource ownership and explicit close retries intact. The existing native-worker tests cover failed idle memory-pressure cleanup, repeated pressure, one exit cleanup attempt, and explicit receipt recovery. Exit simulations dispatch only still-registered handlers. Validation: 51 focused worker tests pass on current main, including pressure and custody composition. Both exit-event regressions fail with the original listeners. Independent autoreview found no actionable issues. * fix(sessions): preserve recovery when stopping repeated exit cleanup * fix(sessions): reconcile exit cleanup with current main Preserve one-shot automatic SQLite exit cleanup and explicit recovery of retained worker custody. Include the reviewed checkout fixture single post-handler publication and current main's canonical archive-placement repair from #155751. * test(ci): integrate canonical fixture repairs Merge current main with the memory candidate synchronization fix from #155745 and archive lifecycle request settlement from 94b9c47. Preserve the reviewed six-file SQLite exit cleanup and checkout fixture delta without further source changes. Co-authored-by: Peter Steinberger <[email protected]>
Archive lifecycle assertions polled for abort and batch-drain callbacks while directSessionReq was still preparing projection and history-worker state. On a polling failure, synthetic gates and RPCs could remain unsettled while fixture teardown revoked their readers. Install abort and drain checkpoints before dispatch, race them against RPC settlement, and release held synthetic work before joining the affected requests in cleanup. Preserve the cancellation, concurrency, generation, release-order and durable-state assertions. The intermediate one-second observation polls are intentionally removed; existing test-case and RPC timeouts remain unchanged. Keep the landed persistence-error repair and openclaw#155751's worker-placement repair intact. All 17 lifecycle cases passed on main cff7347 with the updated transcript hydration runtime in 87.462 seconds of cold command wall time. This exercises actual RPC preparation, SQLite/history workers and lifecycle ordering; cold compilation accounts for substantial setup cost. Fresh scoped P2 review found no actionable issues. Reuse the byte-identical fixture's previously passing formatting, lint, type and guard checks. No production code or test cases were added, and no whole-prefix replay or speedup claim is made.
) * fix(sessions): stop repeated failed worker exit cleanup Use one-shot process-exit cleanup for retained reclamation workers and the canonical validation pool. A rejected asynchronous close previously kept its beforeExit listener, so each drained event loop repeated the same cleanup and could prevent CLI and QA commands from exiting. Keep failed database resource ownership and explicit close retries intact. The existing native-worker tests cover failed idle memory-pressure cleanup, repeated pressure, one exit cleanup attempt, and explicit receipt recovery. Exit simulations dispatch only still-registered handlers. Validation: 51 focused worker tests pass on current main, including pressure and custody composition. Both exit-event regressions fail with the original listeners. Independent autoreview found no actionable issues. * fix(sessions): preserve recovery when stopping repeated exit cleanup * fix(sessions): reconcile exit cleanup with current main Preserve one-shot automatic SQLite exit cleanup and explicit recovery of retained worker custody. Include the reviewed checkout fixture single post-handler publication and current main's canonical archive-placement repair from openclaw#155751. * test(ci): integrate canonical fixture repairs Merge current main with the memory candidate synchronization fix from openclaw#155745 and archive lifecycle request settlement from 5f027d8. Preserve the reviewed six-file SQLite exit cleanup and checkout fixture delta without further source changes. Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Gateway archive-placement tests can fail before observing the runtime drain and leave an archive request running into fixture teardown.
User Impact
No user-visible behavior changes. This repairs the CI fixture lifecycle while preserving its archive, placement identity, and drain-release checks.
Why This Change Was Made
The active/failed identity cases used the default one-second polling window to observe an asynchronous request. If that assertion failed, teardown could close the session databases while the request was still running. The adjacent exact-active cloud-reclaim case also held a request without unconditional release and join.
All three cases now race the expected phase notification against archive completion, then release the held phase and await the archive request in
finally. Early completion or rejection fails visibly. All 24 test cases and their existing assertions remain; no timeout increase, retry, or production change is introduced. Test delta: 53 additions, 27 deletions.Evidence
Session history database read was revokederrors. Its 40-file group finished with 588 passing tests and two failures. The exact prerequisite that delayed drain entry has not been established.src/gateway/server.agent.gateway-server-agent-auth-refresh.test.ts:318, “aborts one affected waiter without cancelling shared auth publication”: active root-work count expected 2, received 3. The third root is unexplained; this is not an overall green result or proof of causal independence.cf32d5a527d75b44dfa23a57ab1c6cde919ebe2fwith staged treedfd8f08c597be6f5bf127a14e8b2da233048654f. Signed commit3637083eb13523c88e3e8015ee91f87a7d4bfb0fwas verified to have exactly that tree. A fresh P0–P2 source review of the signed commit found no actionable findings. Production delta: 0.Timing evidence, with each measurement boundary kept distinct:
There is no matched before/after whole-file benchmark and no speedup claim. Resources, cache state and source groups differ; the current hosted fixture ran with 2 CPUs/8.22 GB and did not select auth-refresh. Current exact-head CI completed successfully at
3637083eb13523c88e3e8015ee91f87a7d4bfb0f: 25 successful jobs, 20 skipped, no failures. These measurements address the timing-evidence request without treating unlike durations as equivalent.Related: the failure surfaced in the watcher coverage PR's CI; this change is isolated to the archive fixture.