Repository navigation
fix: avoid waiting for the writer when finishing consumed chat input - #146795
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 13, 2026, 2:24 AM ET / 06:24 UTC. ClawSweeper reviewWhat this changesThe PR prevents completed chat-input cleanup from waiting for SQLite’s writer lock by recording committed consumption on the existing private input owner. Merge readiness✅ Ready for maintainer review Keep open: the cleanup defect remains on current main, and this focused patch preserves commit, rollback, and ownership semantics. No actionable correctness or security findings were identified. Priority: P2 Review scores
Verification
How this fits togetherAccepted chat input is held in the session store until it is committed to the conversation transcript. Completion then releases execution ownership and records a terminal disposition only for input that remains unconsumed. flowchart TD
A[Accepted chat input] --> B[Private input owner]
B --> C[Transcript transaction]
C --> D{Transaction committed?}
D -->|Yes| E[Record consumed fact]
D -->|Rollback| F[Input remains pending]
E --> G[Release ownership without write]
F --> H[Release ownership and record disposition]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +27, Tests +169. Total +196 across 3 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep consumption bookkeeping with the existing transaction owner so committed inputs release without a write while pending inputs retain durable cancellation and interruption handling. Do we have a high-confidence way to reproduce the issue? Yes: consume a staged input, hold BEGIN IMMEDIATE on another connection, then finish the receipt; current main still requests the writer lock. The new regression covers this path, but was not executed during this read-only review. Is this the best way to solve the issue? Yes: the patch reuses committed transaction publication and skips an otherwise empty write without changing persisted formats, replay checks, or execution revocation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b2670d47f621. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* commit '2acbeee461474b6ba41f5186ae1a4e0e80f4087a': (117 commits) fix(ui): import the shared deferred helper in sidebar scope tests (#146862) fix(ui): copy chat content from its context menu (#146679) perf(memory): defer legacy sidecar writer imports (#146815) fix(e2e): accept expected Kitchen Sink worker rejection (#146681) fix(ui): distinguish absolute and relative file links (#146572) feat(ui): keep file previews in tabs and render HTML (#146672) refactor: reuse shared deferred promises in UI tests (#146670) fix: gateway stop/restart refuses a healthy gateway when the Windows process snapshot misses (#146387) improve(crabbox): keep healthy cloud desktops warm on resume (#146816) fix: report blocked SQLite WAL checkpoints in status and doctor (#146775) feat: share browser dashboards with agents (#146702) fix(doctor): continue repairs after legacy agent directory collisions (#146092) feat(agents): retry cyber-refused embedded turns on Daybreak (#145291) fix: restore media uploads through protected egress (#144902) refactor(qa): share capture filter rendering (#146696) fix(cli): keep running stream jobs visible as running (#146793) refactor(parallels): share gateway readiness loop (#146694) fix(sessions): avoid rewriting already-consumed input on release (#146795) fix: preserve scheduled conversation delivery after Doctor (#146794) perf(ui): avoid redundant session-row provenance work (#146797) ...
…nclaw#146795) (cherry picked from commit 1cc5eea)
Related: #130741
What Problem This Solves
Fixes an issue where finishing or canceling a chat turn could wait for a busy database writer even after its accepted input had already been consumed into the transcript.
Why This Change Was Made
Record committed consumption on the existing private input owner, using the transaction owner's commit publication. Completion still revokes execution authority immediately, then skips the empty disposition write for consumed input. Rolled-back and unconsumed inputs retain their existing disposition persistence.
User Impact
Consumed-input cleanup no longer competes for the SQLite writer. Direct and collected inputs keep their existing transcript, cancellation, and recovery behavior.
Evidence
The regression reproduced four failures on unchanged main with a real foreign SQLite writer. The candidate passes all eight consumed-release and rollback cases, plus the pending-input, user-turn recorder, and transaction suites: 114 tests total. All selected canonical checks and fresh P1 review passed. This proves the bounded cleanup correction; the wider Swarm responsiveness target remains tracked in #130741.