Repository navigation
Conversation
Accept reclamation commits atomically under current authority and retain writer admission through asynchronous native settlement. Remove the synchronous parent SQLite probe and its release handshake. A 1.5-second worker hold now leaves the event loop responsive; revocation, FIFO, cleanup, and publication remain covered by focused Testbox proof.
|
🦞👀 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 25, 2026, 6:50 AM ET / 10:50 UTC. ClawSweeper reviewWhat this changesThe branch replaces the parent’s synchronous SQLite commit probe with an atomic authority check and asynchronous worker settlement for session reclamation, and updates tests and documentation. Merge readiness✅ Ready for maintainer review Keep open. Current main and the latest release still contain the blocking commit probe; this PR addresses that behavior with a focused change and credible production-boundary proof. Priority: P2 Review scores
Verification
How this fits togetherSession reclamation archives or deletes session data in a SQLite worker after a Gateway operation requests cleanup. The parent authorizes the commit, retains writer admission through settlement, and then publishes session changes. flowchart LR
A[Gateway cleanup request] --> B[Session reclamation plan]
B --> C[Worker write admission]
C --> D[SQLite transaction]
D --> E[Parent authority check]
E --> F[Worker settlement]
F --> G[Publish session changes]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -160, Tests -196, Docs +7. Total -349 across 10 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Land the existing owner change through normal merge gates while preserving pending-revocation refusal, FIFO writer custody, and publication after native settlement. Do we have a high-confidence way to reproduce the issue? Yes. The reported Testbox comparison held a real worker transaction for 1,500 ms and measured a 1,667.04 ms loopback request on the original owner; current main still contains that owner. This read-only review did not rerun the probe. Is this the best way to solve the issue? Yes. Removing the parent’s synchronous lock probe while retaining the existing authorization and worker-result owners is a narrow solution; the changed tests cover refusal and settlement ordering. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4e4b5c5c515b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
What Problem This Solves
Gateway requests stop making progress when a reclamation worker takes a long time to settle its SQLite commit. The parent authorizer opened another SQLite connection and synchronously waited for the worker's writer lock.
User Impact
Unrelated requests keep running during slow reclamation commits. Pending revocation still refuses a commit, and accepted work retains its writer slot and request lifetime until native settlement. No configuration, schema, retention, or update changes are required.
Why This Change Was Made
Check current authority and atomically accept the commit in the existing parent owner, then consume completion through the existing asynchronous result/exit transport. Remove the synchronous probe, its parent-release handshake, and obsolete probe-failure tests. Keep FIFO ordering and post-settlement publication with their existing owners.
Automatic-maintenance conflict backoff from #156583 already applies; its quiet-window/capped-retry regression passes unchanged.
Evidence
Blacksmith Testbox (
blacksmith-testbox, profileopenclaw-check), leasetbx_01m3byyes7bfgft4j4jxn0g3kz(hydration run), using synthetic SQLite data and the actual commit owner/request bridge. Each measurement holds the worker transaction for 1,500 ms after commit acceptance while serving a loopback HTTP request:node --import tsx reclamation-perf-probe.mts: before/after results above; temporary fixture removed after proof.node scripts/run-vitest.mjsacross reclamation commit/admission/reuse/memory, maintenance worker/admission/kick, and cold storage: 114 tests passed in 8 files. This also ran the full runtime build successfully (34.9 s).The new responsiveness regression fails on the original commit owner: queued work cannot run until the worker has committed and released admission. It passes with this change, together with rollback, abrupt exit, pending revocation, accepted-operation drainage, and FIFO checks.
pnpm test src/config/sessions/session-accessor.sqlite-reclamation-commit.test.ts --maxWorkers=1: 7 passed, 29.56 s wall including transformation; approximately 2.7 s test execution.pnpm test src/config/sessions/session-accessor.sqlite-reclamation-admission-race.test.ts --maxWorkers=1: 9 passed, 21.34 s wall. These existing lifecycle integration cases retain real SQLite/worker and session-publication coverage.Independent review through P2: no actionable findings.
Initial probe setup lacked
tsxon the lease;pnpm install --frozen-lockfilerepaired that prerequisite. Both subsequent performance probes succeeded; the original-code regression intentionally fails.Additional
node scripts/run-vitest.mjscheckpoint, reclamation-maintenance, canonical-validation, request-lifetime, and commit coverage: 38 passed in 6 files, 32.27 s Vitest wall (7 commit cases overlap the earlier batch: 145 distinct tests across 13 files).node scripts/check-changed.mjs: core typechecking, all 25 core-test graphs, and all preceding guards/dead-export scans passed. Final lint caught a missing explicit empty Worker transfer list in the new fixture; fixed it, then reran the exact selectedrun-oxlint.mjscommand and all remaining schema, database, media, runtime-loader, import-cycle, webhook, and pairing guards successfully. A separate attempted--lint-onlyinvocation was rejected as unsupported; it supplied no validation evidence.pnpm check:docs: passed, including 14,611 internal links with zero broken links and config-example/changelog checks.git diff --check: passed. The Testbox lease was stopped after validation. Net production change: 160 fewer lines.The timing fixture isolates slow commit settlement; it is not a production deployment or proof that every observed stall has this cause. Other legacy synchronous SQLite writers can still contend on native locks. Existing unlabeled deferred-hold logs cannot be conclusively attributed to this immediate-transaction owner.
CI status
Squash auto-merge is enabled for
6e2bc69e89fccedd805980a7049a0f42099798a1. The initial bare merge commands were refused by the local publication guard; supplying the explicit reviewed subject/body and exact-head condition was accepted.CI run 36123920765 was canceled by fail-fast after the unchanged Windows tooling test
test/scripts/direct-run-entrypoints.test.ts→runs the checked-out Crabbox wrapper through its Windows Job childexceeded its 10,000 ms managed-command deadline (failed job). The shard recorded 168 passing tests, one failure, and 12 skips. Core production types, completed test-type stripes, lint, security, and docs checks passed; unfinished test shards were canceled, so full CI and per-file CI timing closeout remain incomplete.Bounded diagnosis: the 10,514 ms case reached its first fake CLI invocation about 8,739 ms after case start; all four expected invocations then wrote their output within 1,168 ms. This suggests cold source startup consuming the deadline, rather than establishing a shutdown deadlock. The fixture, its managed-process owner, and Crabbox wrapper are unchanged by this PR. Current-main history already contains the cold-compilation, startup-tracing, and output-close ownership changes (#156011, #155905, #147781); no newer owning fix was found. The configured Testbox provider cannot execute this Windows-only native Job case:
crabbox warmup --target windows --keep --timing-jsonrefused before provisioning withprovider=blacksmith-testbox managed provisioning supports target=linux only. The task requires this provider; AWS or an existing Windows host would be a host-rule exception. No timeout increase, retry-to-green, weakened assertion, or speculative unrelated repair was made.