Repository navigation
fix: stop retrying exhausted unadopted channel messages - #189393
roboclaw-bot wants to merge 1 commit into
Conversation
Apply the existing failure disposition to pre-adoption abandonment so exhausted messages reach the failed ledger and emit the terminal diagnostic. Preserve the explicit cancellation release and remove its now-single-use helper. Supersedes #124337, thanks @karmafeast. Co-authored-by: frond-scribe <[email protected]> Co-authored-by: gloss-dandelion-cult <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review Scoped maintainer replacement for #124337: the shared ingress owner now applies the existing retry disposition to abandonment. Codex autoreview with full owner and caller context found no P0–P2 findings; 61 focused tests passed. Please review the small replacement, including settlement ownership and the existing explicit-cancellation behavior. |
|
🦞👀 Re-review progress:
|
|
Codex review: needs changes before merge. What this changesRoute unadopted message abandonment through the existing retry policy so exhausted messages enter the failed ledger. Example: Telegram update 3 is 25 hours old and has seven recorded failed attempts.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains This PR addresses a current retry-exhaustion bug, but terminalizing abandonment also terminalizes explicit cancellations that still reach that callback. Priority: P1 Before merge
Findings
Tests
Agent review detailsHow this fits togetherChannel monitors feed durable SQLite claims into the shared ingress drain, whose lifecycle callbacks settle delivery, cancellation, adoption, and retry outcomes. flowchart TD
A[Channel monitor] --> B[SQLite ingress queue]
B --> C[Shared ingress drain]
C --> D[Reply lifecycle binding]
D --> E[Session mailbox]
E --> F[Terminal callback]
F --> C
C --> G[Retry or failed ledger]
Technical reviewBest possible solution: Preserve cancellation as a distinct budget-free outcome through the existing reply and ingress owners before applying terminal retry disposition to genuine abandonment. Do we have a high-confidence way to reproduce the issue? Source establishes both the current-main unbounded-abandonment path and the introduced cancellation-to-dead-letter path; no target code was executed during this read-only review. Is this the best way to solve the issue? Reusing the shared retry disposition is appropriate, but the complete fix must distinguish cancellation at the reply-mailbox boundary rather than assuming every abandonment callback represents a failed delivery. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 27c5554782e7. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource -2, Tests +48, Other +2. Total +48 across 4 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel 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 Reviewed October 31, 2026, 8:56 AM ET / 12:56 UTC. |
|
Withdrawing this narrow replacement: the P1 cancellation finding is verified. A real follow-up enqueue/queue-clear probe dead-lettered the message with this patch and passed with main's drain restored. Repairing the complete cancellation contract requires a broader cutover than this scoped takeover permits. All required CI ultimately passed at |
Supersedes #124337, thanks @karmafeast.
Withdrawn: this narrow replacement is unsafe without the broader cancellation cutover. Nothing was merged.
What Problem This Solves
The proposed shared-owner change bounds genuine pre-adoption abandonment, which still bypasses retry exhaustion on main.
User Impact
No shipped change. The proposal would also dead-letter explicitly cancelled queued messages at the retry threshold because reply cancellation still reaches
onAbandoned. It must not be deployed.Why This Change Was Made
The shared drain's direct abandonment release increments attempts but never consults the existing failure disposition. The proposed handoff fixes that defect, but retaining the drain's
onCancelledcallback is insufficient:bindIngressLifecycleToReplyOptionsdrops it, andabortSessionControllerInputinvokes abandonment during explicit cancellation. Shared debounce, dedupe settlement, and channel-owned lifecycle wrappers also need a complete cancellation contract. That broader cutover is outside this task's bounded shared-owner-only takeover scope; #124337 is not being ported wholesale.The useful part remains the shared retry-policy handoff and its exhaustion regression, conditional on completing cancellation propagation. Deliberate queue-cap drops remain the separate scope of #182252.
Evidence
c504abf10afa. The determining shared owner was also unchanged at338de6d69998.createChannelIngressDrain→bindIngressLifecycleToReplyOptions→enqueueFollowupRun→clearFollowupQueue, with the existing drain policymaxAttempts: 1, deadLetterMinAgeMs: 0. Clearing the queue returned 1; the row then entered the failed ledger withreason: retry-limit-exceededandmessage: turn-abandoned. The identical probe passed with main's drain restored, leaving the message pending/replayable. Candidate probe: 12.47 seconds; main control: 36.78 seconds including compilation. This disproves the original statement that retaining the drain callback alone preserves reply cancellation.gh pr view/gh pr diffand never checked out or executed. No production Gateway or live channel/model was used.CI completion is recorded in the closure comment; its outcome does not override the reproduced cancellation regression.