Repository navigation
improve(sqlite): transfer privately owned worker command buffers - #156200
vincentkoc wants to merge 2 commits into
Conversation
Transfer private command snapshots and staged frames while preserving caller buffers and opening-input custody. Treat a throwing first send as an uncertain native outcome, join worker exit, and preserve no-replay settlement.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check could not safely complete for this revision. Automatic review is on hold, including after source changes. Request a fresh re-review after resolving the failure; maintainers can also release the hold through an intentional scanner-policy update. Next step: No contributor action is requested. Maintainers should inspect the linked workflow run. |
|
Codex review: blocked before merge. Reviewed September 24, 2026, 6:08 AM ET / 10:08 UTC (Revision 5). ClawSweeper reviewWhat this changesThe branch transfers broker-owned SQLite command buffers and staged frames to worker threads while preserving caller buffers and retiring workers after uncertain sends. Merge readiness⛔ Blocked before merge - 4 items remain Keep open. Current main still copies SQLite command bytes when posting them to workers, and the paired issue remains open. The branch offers distinct work, but its cleanup expectation conflicts with a merged lifecycle change and its performance benefit remains unqualified. Priority: P2 Review scores
Verification
How this fits togetherThe SQLite worker broker receives serialized database commands from Gateway and plugin callers, queues them, and sends them to worker threads. It returns database results and settles worker cleanup before releasing callers. flowchart LR
A[Database caller] --> B[Broker command snapshot]
B --> C{Buffer privately owned?}
C -->|Yes| D[Reuse buffer]
C -->|No| E[Make private copy]
D --> F[Transfer to SQLite worker]
E --> F
F --> G[Database result]
G --> H[Cleanup and settlement]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +12, Tests +113. Total +125 across 7 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Integrate private-buffer transfer into the current broker lifecycle, preserve clean retirement and no-replay settlement, and land it only after controlled large- and small-command comparisons establish a useful result. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: source shows the extra worker-message copy, and the branch tests buffer custody, but end-to-end speed benefit has not been established. Is this the best way to solve the issue? Unclear. The existing owned-buffer helper fits this transport boundary, but the branch must retain current cleanup behavior and demonstrate a performance benefit. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 340cb1c8402a. LabelsLabel changes: No label 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
HistoryReview history (4 earlier review cycles)
|
Closes #156198
Change
The SQLite broker already snapshots commands before queueing them. This candidate transfers its privately owned serialized command bytes to the worker, avoiding another structured-clone copy for eligible buffers. It reuses
ownedWorkerBytes, which already owns worker reply transfers, for inline commands and independently serialized continuation frames.Caller buffers stay attached. The complete frame producer snapshot, operation-admission port, opening-input custody, queue credits, per-slot admission, FIFO and existing retirement owner remain intact. Initial-dispatch error classification is unchanged. The continuation send-then-throw test is injected fault/custody proof after command admission; it does not establish that native Node throws after enqueue.
Production: +10/-5, net +5, in one transport owner. Tests/support: +252/-82, net +170, covering private transfer, full/sliced/pooled caller buffers, snapshot mutation, 40/72 MiB frames, queued followers, joined exit, successful close/reopen, durable readback and no replay. Observer tests capture command facts before transfer while preserving request/worker correlation.
Validation
e3f591d1333d8eb052fdca551f2f16cd7dfc2dfe; tree:9cda5b4e5b175f10707650aba98f9a79f9b75123. Frozen main baseline:bfcec878635d9725d15f5f33af478da1f511d7f4. The normal signed merge preserves the originalb8607480branch ancestry.1b919d5e; the proof below comes from the native command results, not candidate CI on that workflow. All reported completed children were joined.state-loggingtest-type graph passes after the substantive reduction (37.774s). Production core types and the touched Gateway/config/plugin graphs passed in the preceding static run; the remaining planned guards subsequently passed on the narrowed source.check:changedremains failed: frozen baseline and candidate both count 484OPENCLAW_*names against budget 483. The changed production file does not change that set; the budget was not raised. The broad test-type batch also reached its 900s command cap inui-pages, after 14 named graphs passed. No full aggregate type success is claimed.Performance hold and remaining work
This cycle's single capability attempt exited 78 at the observed namespace-root cgroup assertion, before quiet intervals or samples. This does not establish that pressure counters were missing. No baseline comparison build, baseline suite-cost measurement or benchmark sample ran, and no performance admission retry occurred.
Earlier attempts remain relevant: one Blacksmith image lacked pressure files; a separate AWS attempt failed its second quiet interval at approximately 9.96% I/O pressure, above the declared 1% ceiling. Both produced zero samples. Earlier noisy 72 MiB measurements had a candidate median approximately 12% slower, still unresolved.
The Claw cleanup-contract concern is reconciled with the frozen main owner: failed continuation retirement joins native exit, rejects the admitted operation/queued follower appropriately, and permits successful close and recovery. The performance/test-cost rank-up remains open: obtain the fixed three alternating 72 MiB pairs and three 128-write pairs on a positively admitted host, with durable-state/FIFO/caller-ownership/no-replay assertions and comparable baseline test costs. Keep this PR draft until that evidence and exact-head CI/review justify adoption. The frozen-main environment-budget failure is a separate named follow-up.