Repository navigation
fix(telegram): retry abandoned messages instead of dropping them - #123528
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 5:28 AM ET / 09:28 UTC. ClawSweeper reviewWhat this changesThe branch classifies an unadopted deferred Telegram turn as retryable and adds regression coverage for same-process retry followed by post-adoption deduplication. Regression provenancePossible regression — probable (reproduction; reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep this PR open for exact-head CI completion and maintainer merge review; the minimal producer-side result change repairs a verified Telegram message-loss path without a blocking correctness finding. Priority: P1 Review scores
Verification
How this fits togetherTelegram updates are durably spooled before they enter the session queue. The Telegram update tracker decides whether a replay may re-enter dispatch, while the ingress drain turns the final processing result into retry or completion. flowchart LR
A[Telegram update] --> B[Durable ingress spool]
B --> C[Deferred session turn]
C --> D{Adopted or abandoned?}
D -->|Adopted| E[Complete update tracking]
D -->|Abandoned| F[Retryable processing result]
F --> B
E --> G[Duplicate redelivery suppressed]
Decision needed
Why: The patch changes the terminal delivery disposition for a durable ingress path, so maintainers should make the final merge call after the active exact-head checks settle. Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +64. Total +64 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the producer-side retryable classification and merge only after exact-head CI confirms retry and post-adoption deduplication together. Do we have a high-confidence way to reproduce the issue? Yes. Current main maps abandonment to skipped at the producer, while the tracker and ingress drain source establish the resulting retry-suppression path; the branch adds a focused same-process sequence. Is this the best way to solve the issue? Yes. Changing the producer's abandoned outcome to the existing retryable result is the narrow owner-boundary repair; modifying tracker dedupe instead would blur intentional completed and skipped cases. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fc87337c1469. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
0fc06d7 to
1c45d32
Compare
1c45d32 to
61cd4ab
Compare
61cd4ab to
7d3e1f9
Compare
Treat pre-adoption Telegram turn abandonment as retryable so durable ingress releases the claim instead of tombstoning an unprocessed update.
Closes #123519
What Problem This Solves
Fixes an issue where Telegram messages queued behind an active same-session run could disappear when the queued turn was abandoned. Durable ingress retried the update, but Telegram's in-process update tracker suppressed that retry and falsely completed the ingress row.
Reported by @hannesrudolph.
Why This Change Was Made
Queue abandonment now uses the existing retryable processing outcome at the producer. This keeps durable-ingress release, Telegram update tracking, and message-dispatch dedupe aligned without changing intentional terminal skips or adding a compatibility path. Production code delta: 1 line added, 1 removed.
User Impact
Telegram messages abandoned before turn adoption remain eligible for same-process durable retry. Once a retry is adopted, later Telegram redelivery remains deduplicated.
Evidence
14882ac44dcd82bfa6fc145c5bcac73ceff036c4: queued markerOPENCLAW_E2E_ABANDONED_123519received no reply; provider received zero requests containing that marker; Gateway logged bothvisible channel turn dispatched with no queued reply payloadsandcompleted without a recorded processing outcome.skipped, failing the expected retryable owner outcome.defer -> abandon -> same-process retry -> adopt -> duplicate redelivery suppressed.node scripts/run-vitest.mjs extensions/telegram/src/bot-message.test.ts extensions/telegram/src/bot.create-telegram-bot.test.ts— 170 passed.pnpm tsgo:extensions,pnpm check:test-types, andgit diff --check— passed.0fc06d7a8206fac7443c0e952fb47d9ae1d40ae0: queued message48661received the SUT acknowledgement reaction, then/stop(48663) produced⚙️ Agent was aborted.(48664). Gateway dispatched message48661twice (initial attempt plus same-process retry) and emitted zerocompleted without a recorded processing outcomediagnostics. The forced stop intentionally prevented model admission; the transport retry is the changed path under test.