Repository navigation
fix: restore recovery notices to history after a Gateway crash - #198139
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. What this changesThis PR restores an already delivered recovery notice to conversation history when a Gateway crash interrupts its acknowledgement. Example: The Gateway crashes after committing the delivery ACK for notice intent-1 to chat-1, before recording its transcript entry.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a receipt-reconciliation gap still present on main. No actionable patch defects were found; final-head CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe pending-notice owner receives unresolved delivery debt during recovery or an inbound turn, sends through the lifecycle runtime, and records the outcome through the existing transcript and session owners. flowchart TD
A[Recovery or inbound turn] --> B[Pending notice owner]
B --> C[Lifecycle sender]
C --> D[Durable delivery queue]
D -->|Suppression and receipt| B
B --> E[Transcript owner]
E --> F[Session notice acknowledgement]
Technical reviewBest possible solution: Use the existing completed receipt to reconcile suppressed notice sends before the guarded transcript append and debt acknowledgement. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically skips transcript recording for a suppressed completed intent; the supplied channel regression reports the intended red/green result, while the pre-fix process run stopped during fixture setup. Is this the best way to solve the issue? The patch is the smallest complete repair: it extends existing receipt reconciliation to suppression, retains session, revision, route, and intent checks, and adds no competing recovery path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against da0e0ba8cae1. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +2, Tests +184. Total +186 across 5 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed November 13, 2026, 2:43 AM ET / 07:43 UTC (Revision 3). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash auto-merge.
|
…ted final resend Main now delivers the unconfirmed-delivery notice when recovery settles (#195400, #198139), so this branch drops its agent-hint notice redesign and keeps the routed final text resend, the channel opt-in, and the proxy reset control. Co-authored-by: obviyus <[email protected]>
…law#198139) * test(postgres): reproduce notice acknowledgement reply loss * fix: record delivered recovery notices after a crash * test(postgres): match serialized recovery checkpoint metadata * test(postgres): preserve JSON checkpoint normalization in lint * test(postgres): register checkpoint serialization lint exception
What Problem This Solves
Fixes a delivered recovery notice disappearing from conversation history after the Gateway dies between committing its queue acknowledgement and recording the notice in its originating session.
Maintainer PostgreSQL qualification follow-up to #197780.
User Impact
Restart can record the already delivered notice and acknowledge its existing debt without sending it again. Ordinary suppressed notices without a completed receipt retain their existing behavior. No schema, schema-version, DDL, migration, persisted-format, config, retention, or durability-policy changes.
Why This Change Was Made
The queue correctly suppresses reuse of a completed stable intent. The pending-notice owner treated that suppression as non-delivery, even though it already reconciled the same completed receipt after a send error. Both outcomes now use the existing receipt before appending the transcript and acknowledging debt. This removes the suppression-only branch at the existing owner; session, revision, intent, and acknowledgement-precedence checks remain intact. No new abstraction, send path, or async transaction work.
The PostgreSQL fixture withholds the notice ACK's successful worker reply after commit, independently reads PostgreSQL, kills the real Gateway, and restarts it against a synthetic HTTP sink. The previous three answer-delivery crash cases remain covered.
Evidence
d4bb8e6aa825: channel regression failed at the intended missing-transcript assertion, with 830 other channel assertions passing. Its PostgreSQL case stopped before the crash on an incorrect undefined-property expectation; pre-fix process proof at the intended assertion is unavailable.460ff0a791a: PostgreSQL shard 1 passed, including all four Gateway crash windows. The new ACK-reply-loss case passed in 46.4s: completed notice receipt survives SIGKILL, restart acknowledges debt, records exactly one notice in the original transcript, finalizes the original failure, and sends no duplicate notice or answer. Shard 2 and shard 3 also passed.b89c5f85aaed(head085d3432dfd, base6c57f13ade83) passed all three PG17 conformance shards and PG16 Gateway smoke. PG17 shard 1 passed all four crash windows, including notice ACK-reply loss in 79.0s. PG16 independently passed the new window in 46.2s and all 11 Gateway database tests.085d3432dfddiffers by a justified one-line lint directive preserving JSON serialization semantics and its explicit allowlist entry. The targeted rule and used-directive check passed locally. Final-head PR CI attempt 2 passed: 42 jobs successful, 28 intentionally skipped, no failures. This includes the runtime suppression guard (all 14 cases), changed-channel tests, production and test types, lint, browser and baseline checks; no behavior assertion was removed.94259259a62, plus independent review of the fixture serialization correction: both scoped-clean at P0–P2. Local ClawSweeper was unavailable because its checkout was ambiguous. Final-head ClawSweeper review at085d3432dfdfound no actionable issues, no before-merge items, and sufficient process proof. The exact suppression allowlist entry also has separate independent review; no coverage was weakened.git diff --checkpassed. Production +6/-4 (net +2); tests/support +254/-70 (net +184), including relocation of the existing anchor reader to keep the test module within its line cap.ubuntu-24.04and completed successfully; successful PostgreSQL results preserve their original execution times. No runner configuration or CI source change was made for the outage. Final-head security-fast and all five Security High lanes passed.Next bounded qualification: crash after the notice transcript commits but before debt acknowledgement; test existing keyed transcript deduplication without changing storage or policy.