Repository navigation
fix(gateway): queue board and progress-card writes - #148948
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: blocked before merge. Reviewed September 19, 2026, 6:00 AM ET / 10:00 UTC (Revision 4). ClawSweeper reviewWhat this changesQueues board and progress-card writes behind existing database writers and rechecks request and MCP source permissions before saving. Warning SQLite table change This PR modifies persisted SQLite tables in Merge readiness⛔ Blocked before merge - 2 items remain No actionable patch findings remain. The previous migration blocker is unsupported: schemas, serialization, and storage kernels are unchanged, and the earlier MCP admission finding is addressed. Current main still needs this repair. Priority: P2 Review scores
Verification
How this fits togetherGateway requests save conversation boards and progress cards in per-agent SQLite databases. Writer admission coordinates these updates with background database work before handlers publish results. flowchart TD
A[Board or progress request] --> B[Capture target and authority]
B --> C[Agent database writer queue]
D[Background database writer] --> C
C --> E[Recheck request and source permissions]
E --> F[Synchronous SQLite mutation]
F --> G[Authorized response and notification]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +93, Tests +574, Docs +9. Total +676 across 9 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain one canonical writer queue, synchronous storage kernels, and final authority checks without introducing a migration or parallel persistence path. Do we have a high-confidence way to reproduce the issue? Yes: current-main storage calls synchronously enter SQLite while a background writer can hold the database; supplied paired contention results demonstrate the failure. This read-only review did not execute a reproduction. Is this the best way to solve the issue? Yes: the patch uses the existing admission owner and preserves storage contracts while refreshing authority after waiting; a migration or new policy option would add unnecessary scope. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cc9f1008a3c8. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
|
@clawsweeper re-review The branch now includes main without rewriting contributor history. Exact head For the previous |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Follow-up on the current review's two remaining checklist notes:
No product change is needed for either note. The remaining landing requirement is hosted CI; the isolated Windows skills-watcher timeout is being investigated without changing this PR's scope. |
|
Merged via squash.
|
* fix(gateway): queue board and progress-card writes * fix(gateway): revalidate MCP pin authority after admission
Related: #130741
What Problem This Solves
Board and progress-card RPCs can block the gateway event loop for the SQLite busy timeout while a background native operation owns the agent writer. Their async APIs still opened the database and initialized first-use tables synchronously before entering the existing writer queue.
User Impact
Board and progress updates now wait asynchronously for that writer, so the gateway can continue handling other requests. MCP pins whose source permission is revoked while waiting remain read-only.
Why This Change Was Made
Queue writes at their storage owners, capture the original physical target and state environment, and recheck request/session authority before schema work, mutation and publication.
MCP App pins also need current source permission after the wait. A reproduced ordering removed the granted source before the queued destination pin, yet the destination retained interactive tools and successfully called one. Refreshing source interaction policy under writer admission preserves the read-only behavior for revoked sources. Cancellation or database retirement during preparation refuses the write.
The SQLite schema, stored formats, revision/grant rules and reset lifetimes are unchanged. This is a scheduling and authority-preservation change, with no DDL or migration changes.
Evidence
The same synthetic real-SQLite contention fixture was run on canonical base
10b13070c4afb9f4c5ecefab01212ef5511246d3and exact PR headbfeb7e16b3128acc4799ab284493e3ade6bd35dc. A 75 ms host timer took 5,372.94 ms on the base; the write failed withdatabase is lockedand persisted nothing. On this head the timer took 74.58 ms and the widget persisted once.scripts/pr review-testspassed all 57 tests acrossboard-progress.write-admission.test.ts,board.mcp-admission.test.tsandsession-accessor.sqlite-reclamation.test.ts. Coverage includes registered RPC admission, allowed/revoked MCP tool calls, cancellation, database retirement, native authorization and durable revision readback.Fresh independent P0-P2 review of that integration reported one hypothetical indefinitely stalled permission resolver. The current production callback graph does not support that premise: the sole callback awaits an immediate SQLite read, with no external asynchronous provider. The finding was rejected after tracing all production assignments and forwarding paths. No accepted actionable findings remain.
The storage compatibility evidence is the unchanged schema/format owners plus existing-row, native reclamation and persisted-revision tests. This synthetic proof does not establish a universal 500 ms live Gateway latency target.