Repository navigation
refactor(gateway): reuse completed conversation delivery projection - #131107
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 2:19 PM ET / 18:19 UTC. ClawSweeper reviewWhat this changesThe PR reuses the outbound delivery owner’s completed-operation projection for Gateway conversation-send retries and replaces copied in-memory test state with the canonical SQLite-backed store helper. Merge readinessKeep open for normal maintainer handling: the introduced consolidation preserves Gateway route checks and delegates completed-status interpretation to the outbound delivery owner; no actionable defect was found. Exact-head CI is still incomplete. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherGateway conversation sends resolve a registered address, validate current route ownership, then either replay a durable completed operation or dispatch through the outbound delivery owner. The persisted delivery record is the canonical replay source. flowchart LR
A[Gateway send request] --> B[Conversation registry]
B --> C[Route ownership check]
C --> D[Durable delivery operation]
D --> E{Already completed?}
E -->|Yes| F[Shared result projection]
E -->|No| G[Outbound delivery owner]
F --> H[Gateway response]
G --> H
Before merge
Agent review detailsSecurityNone. PR surfaceSource +13, Tests -55. Total -42 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one shared completed-delivery interpreter in the outbound owner while retaining Gateway’s current-route eligibility check and persisted-store replay coverage. Do we have a high-confidence way to reproduce the issue? Not applicable: this is an internal behavior-preserving refactor, not a report of a user-observable failure. The changed tests exercise persisted delivery records, but were not run in this read-only review. Is this the best way to solve the issue? Yes. The patch deletes the send-only duplicate and reuses the existing outbound owner without collapsing the turn path’s separate correlated-reply projection. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8466a2e5c98b. 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.
|
What Problem This Solves
Completed conversation-send retries duplicated the canonical delivery-result projection, while their tests used copied in-memory stores instead of the real conversation storage owner. That left two internal interpretations of the same durable operation and made the tests less representative of production persistence.
Why This Change Was Made
The Gateway send path now reuses
resultFromExistingOperation, the canonical completed-delivery projection. Completed retries still validate current route eligibility before replay, retain persisted operation metadata, and bypass fresh delivery-store resolution and transport; fresh sends keep their existing current-conversation projection and delivery behavior. Test setup now uses the canonical SQLite-backed store through one shared helper.User Impact
No user-visible behavior, schema, protocol, configuration, or public API changes. This is an internal behavior-preserving consolidation of completed delivery replay and its tests.
Evidence
ECONNREFUSEDduring startup before their route assertions; the unchanged failed-only retry passed. The startup cause was not reproduced or proven. Named follow-up: improve deterministic browser test-server startup diagnostics and lifecycle proof without extending its existing retry window.