Repository navigation
fix: prevent queued conversation replies from switching storage - #146984
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, 7:49 AM ET / 11:49 UTC. ClawSweeper reviewWhat this changesKeeps conversation sends, turns, and delivery completion bound to their original storage while waiting for database writes, with regression coverage and storage documentation. Merge readiness✅ Ready for maintainer review Keep open: this remains a useful repair beyond the related merged changes, and no introduced blocking defect was found. Maintainer authorship and the protected label also preclude cleanup closure. Priority: P2 Review scores
Verification
How this fits togetherGateway conversation requests pass through shared message dispatch and a durable delivery queue before reaching a channel. Agent SQLite stores hold conversation operations and session bindings; queue completion records the delivery outcome. flowchart TD
A[Conversation request] --> B[Capture original storage]
B --> C[Wait for database admission]
C --> D[Check current route and session]
D --> E[Durable delivery queue]
E --> F[Channel transport]
F --> G[Complete original conversation operation]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +265, Tests +943, Docs +7, Other +5. Total +1220 across 31 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep conversation persistence and settlement with the existing SQLite admission and delivery-queue owners, preserving captured storage and current authorization throughout the flow. Do we have a high-confidence way to reproduce the issue? Yes, from source: hold the agent writer and rotate configuration or the state root while a conversation send advances into queue custody or completion. The inspected regressions model these boundaries; this review did not execute them. Is this the best way to solve the issue? Yes. Carrying private prepared storage through existing owners removes repeated target selection without adding a public API or persistent format, while preserving retry and authorization contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 274df5be0729. 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 '4aff70f27016f9acf62d0acc19c8bd3592993e4c': (1537 commits) test: align plugin fixtures with current runtime contracts (#147000) refactor(browser): separate session tab tracking from cleanup (#146973) fix(tests): make systemd clock fixtures private (#146990) fix(linux): retire sleep guards when logind disconnects (#146046) refactor(matrix): share draft fallback delivery (#144840) fix(sessions): preserve cross-agent replies after reload (#146799) test(models): cover quota recovery during catalog discovery (#146708) fix(macos): recover browser sign-in when no browser opens (#146787) fix(process): prevent one-shot agents exiting while polling (#144268) fix(status): label the session inventory as stored (#146979) fix: avoid repeated background reads while loading chat (#146953) refactor(ui): narrow Skill Workshop proposal context (#146977) perf(sessions): keep cleanup responsive and reuse workers (#140897) fix(sessions): prevent stranded writers after abort and restart (#146792) refactor: reuse deferred owners in Gateway and infra fixtures (#146809) fix: prevent queued conversation replies from switching storage (#146984) test(ui): preserve nested failure summaries in CI logs (#146864) fix(test): respect process memory limits in local scheduling (#146298) fix: validate large media data URLs without regexp stack exhaustion (#146972) fix(ui): label model usage contributions as messages (#146735) ...
* commit '4aff70f27016f9acf62d0acc19c8bd3592993e4c': (30 commits) test: align plugin fixtures with current runtime contracts (#147000) refactor(browser): separate session tab tracking from cleanup (#146973) fix(tests): make systemd clock fixtures private (#146990) fix(linux): retire sleep guards when logind disconnects (#146046) refactor(matrix): share draft fallback delivery (#144840) fix(sessions): preserve cross-agent replies after reload (#146799) test(models): cover quota recovery during catalog discovery (#146708) fix(macos): recover browser sign-in when no browser opens (#146787) fix(process): prevent one-shot agents exiting while polling (#144268) fix(status): label the session inventory as stored (#146979) fix: avoid repeated background reads while loading chat (#146953) refactor(ui): narrow Skill Workshop proposal context (#146977) perf(sessions): keep cleanup responsive and reuse workers (#140897) fix(sessions): prevent stranded writers after abort and restart (#146792) refactor: reuse deferred owners in Gateway and infra fixtures (#146809) fix: prevent queued conversation replies from switching storage (#146984) test(ui): preserve nested failure summaries in CI logs (#146864) fix(test): respect process memory limits in local scheduling (#146298) fix: validate large media data URLs without regexp stack exhaustion (#146972) fix(ui): label model usage contributions as messages (#146735) ...
Related: #130741. Builds on #146866, #146917 and #146927.
What Problem This Solves
Fixes conversation sends and turns losing their storage target or writing outside database admission when queued work waits while configuration or routing changes.
User Impact
Conversation replies keep their original storage destination, wait for conflicting writes, and recheck current routing and session authority before delivery. Public plugin options and persisted queue records remain unchanged.
Why This Change Was Made
Carry the captured physical database owner and resolved state root through private preparation and completion paths. Conversation writes use the existing per-agent admission owner, while the canonical delivery queue alone records queue custody. Session binding shares the existing patch implementation and checks authority again after waiting.
Evidence
Seven controlled regressions fail with the old consumers and pass with this change. The integrated runtime checks passed 366 distinct cases across nine files, including the real Gateway → message action → queue → synthetic transport path under held writers and state-root rotation. Subsequent affected tests and canonical changed checks passed after fixture corrections; the canonical proof combines an initial run and a recorded continuation.
The normal Worker, SDK and UI build, public/private SDK consumer checks, and isolated P0/P1 review passed. All public declaration bytes match after restoring the normal profile. The local build retains 192 unreferenced private declaration chunks; the final combined-source run will use a fresh normal build. These checks do not establish the separate, unchanged 500 ms Swarm target; final composed-source real-provider acceptance remains pending.