Repository navigation
fix: keep Gateway responsive while admitting outbound messages - #153076
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 19, 2026, 10:06 PM ET / September 20, 2026, 02:06 UTC (Revision 9). ClawSweeper reviewWhat this changesMoves outbound message enqueue writes to the shared database worker so storage waits do not block unrelated Gateway work, while preserving message and media recovery. Merge readiness✅ Ready for maintainer review This PR remains useful: current main and the latest release still enqueue synchronously. The reviewed patch preserves queue ownership and recovery semantics, with no blocking defect found. Priority: P2 Review scores
Verification
How this fits togetherThe outbound delivery queue stores prepared messages and staged media before channel transport sends them. Its publication result determines whether live delivery proceeds, cleanup runs, or recovery retains responsibility. flowchart TD
A[Prepared outbound message] --> B[Host captures payload and media]
B --> C[Shared database worker]
C --> D[Atomic queue publication]
D --> E{Publication outcome}
E -->|Confirmed| F[Live channel delivery]
E -->|Uncertain| G[Retain custody for recovery]
E -->|Confirmed rollback| H[Cleanup and existing fallback]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +131, Tests +725, Docs +16. Total +872 across 32 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep enqueue on the canonical shared worker while preserving atomic custody, confirmed-rollback fallback, and the existing final transport-authority checks. Do we have a high-confidence way to reproduce the issue? Yes, from source: current-main enqueue executes synchronous SQLite writes, making writer contention a concrete responsiveness regression scenario. This review did not execute that scenario. Is this the best way to solve the issue? Yes. Reusing the shared worker and existing transaction kernels is a focused repair, and the supplied runtime observations and fault coverage support the publication and recovery behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 26505c528b50. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
|
Merged via squash.
|
…law#153076) * fix: keep Gateway responsive while admitting outbound messages * test: run durable delivery flows with the host database broker * test: complete durable delivery test routing * test: include WhatsApp in the database-worker batch expectation
What Problem This Solves
Fixes: unrelated Gateway requests can stall while an outbound message waits for durable queue storage.
User Impact
Other Gateway work stays responsive during enqueue. An unconfirmed publication result retains message/media custody for recovery and stops an independent live send; existing fallback rules apply only when nonpublication is known.
Why This Change Was Made
Run enqueue through the existing shared-state worker while preserving atomic publication, deduplication, preparation checks, and original transaction boundaries. Recovery owns the terminal audit result when custody is retained, and a complete result survives later worker cleanup.
Media preparation, stage creation/cancellation/pruning, preparation checkpoints, and other queue writes retain their existing host work. The final provider-authority fence remains synchronous immediately next to transport. Schemas and public APIs are unchanged.
Evidence
044f78eeae1a17af03ef07415641a98ead48830d, including the canonical cleanup-fixture isolation repair in #153286. CI run 35480651177 exposed that inherited failure on the prior successor. The Enqueue feature patch is unchanged; exact-head CI run 35481632662 passed onbbc8792e922f3e1b5b63be9428800fcdc12c2145.