Repository navigation
fix: distinguish unresolved delivery failures from delivery history - #207897
Conversation
Keep duplicate-send receipts visible without making them a standing warning. Report unresolved failures and their own age without changing retention or replay. Co-authored-by: daniel-lxs <[email protected]>
Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: d962dcf0-197a-4fbc-b27c-735d5c8bfc1e
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. |
|
Codex review: passed. What this changesThis PR separates retained failure receipts from unresolved delivery warnings in health and detailed status reports. Example: One retained outbound receipt remains while a newer inbound Telegram event fails.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes misleading delivery warnings still present on main, with no actionable correctness or security findings. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe delivery queue owner aggregates failed SQLite rows into Gateway health snapshots, which CLI health and status render as warnings or informational history. flowchart LR
A[Delivery queue rows] --> B[Queue worker aggregate]
B --> C[Owner health cache]
C --> D[Gateway health snapshot]
D --> E[Shared health formatters]
E --> F[Health and status output]
Technical reviewBest possible solution: Use the existing queue aggregate and shared formatters to distinguish unresolved failures from retained history while preserving delivery fences. Do we have a high-confidence way to reproduce the issue? Main’s aggregate and formatter deterministically include retained receipts in warning counts and age, matching the supplied before captures. Is this the best way to solve the issue? The change uses existing recovery-state facts and rendering owners, preserves conservative warnings for unknown states, and avoids changing persistence or delivery behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cb59aaa31064. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +69, Tests +37, Docs +3. Total +109 across 14 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:
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 28, 2026, 10:10 PM ET / November 29, 2026, 03:10 UTC (Revision 3). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Keep the one-statement assertion and assert that the captured read exists before using its SQL and bound parameters. Co-authored-by: daniel-lxs <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…penclaw#207897) Show retained duplicate-send receipts as delivery history. Count unresolved failures in the dead-letter warning and report the age of the oldest unresolved failure. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: d962dcf0-197a-4fbc-b27c-735d5c8bfc1e
* commit '99b4afc696081eda8aefd8e91250c112f53a8a73': (564 commits) test(ios): verify send-at-tap feedback and work grouping (#207913) test(agents): reject unsuccessful live replay completions (#207724) fix(cron): keep a started cron turn running when its job is edited (#207947) improve(ui): put waiting for a free agent under automation timing (#201282) chore(ui): refresh control ui locales (#207514) fix: distinguish unresolved delivery failures from delivery history (#207897) test(doctor): require security check in proxy ordering assertion (#207912) fix: keep update rollback tests in sync with shipped workers (#207822) test(agents): fix provider header filtering coverage (#207732) refactor: remove the bundled GBrain adapter (#207924) improve(ui): show optional run limits beside the automation schedule (#201283) test(onboarding): inspect recorded output for credential leaks (#207872) perf(exec): reduce host memory sampler allocations (#207927) test(mcp-relay): isolate the Connected apps fallback locale (#207923) fix(acp): deliver bound channel replies to the pending question (#207035) fix(cron): keep required reports from going silent when nothing changes (#207044) test(sessions): assert participant queue rollback state (#207891) perf(gateway): skip session display preparation for transcript recall (#207916) test(agents): verify complete bracketed paste payload (#207733) test: stop timing out the cron recovery settlement test on slow runners (#207920) ...
* commit '1b246c09b0c1d41ed0f090f07fc50381decba90d': (574 commits) fix: stop the manual handoff UI test from hanging after completion (#207945) fix: surface favorites and recommended models in picker search (#201450) fix: show the saved quota reset when chat skips its only model (#207210) fix: avoid reloading unchanged plugins after Gateway boot (#207949) fix: keep Task progress double-clicks from changing the window (#207937) fix(doctor): continue repairs past retained conflicting exec approvals (#207951) test(reply): make account isolation assertion decisive (#207793) fix: keep task progress compact when reopening Details (#207943) fix(ui): restore the saved reading position after an empty search (#207673) fix: remove four Memory Wiki settings that had no effect (#207882) test(ios): verify send-at-tap feedback and work grouping (#207913) test(agents): reject unsuccessful live replay completions (#207724) fix(cron): keep a started cron turn running when its job is edited (#207947) improve(ui): put waiting for a free agent under automation timing (#201282) chore(ui): refresh control ui locales (#207514) fix: distinguish unresolved delivery failures from delivery history (#207897) test(doctor): require security check in proxy ordering assertion (#207912) fix: keep update rollback tests in sync with shipped workers (#207822) test(agents): fix provider header filtering coverage (#207732) refactor: remove the bundled GBrain adapter (#207924) ...
…207897) Show retained duplicate-send receipts as delivery history. Count unresolved failures in the dead-letter warning and report the age of the oldest unresolved failure. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: d962dcf0-197a-4fbc-b27c-735d5c8bfc1e (cherry picked from commit 51d75fe) Release adaptation: Keep the closed beta snapshot shape and report only unresolved outbound failures. Co-authored-by: RomneyDa <[email protected]>
Related: #112313
What Problem This Solves
A failed delivery can leave a receipt so OpenClaw does not send the same message twice. That receipt keeps the delivery queue warning on even when no work remains. When a new failure appears, the warning can still show the age of the old receipt.
User Impact
openclaw health,status --deep, andstatus --allshow past failures that are not queued for retry as history. The dead-letter warning counts only unresolved failures and reports their oldest age. Inbound dead letters and ingress pressure remain visible. No configuration, migration, purge, or replay is needed.Why This Change Was Made
The queue already records which failures are permanent or bounded duplicate-send receipts. The health read uses those two states; a missing or unfamiliar state still warns. Existing JSON totals and timestamps keep their meaning. A new CLI reading an older Gateway still warns on the undifferentiated total; third-party clients that reject unknown snapshot fields need the updated schema. Nothing changes delivery, settlement, retention, or the one-time warning when session recovery abandons a delivery.
This preserves the privacy and duplicate-prevention decisions in #123642 and the failed-range search in #164131. The count reads the recovery state of each failed row; it does not read message bodies, scan pending or completed deliveries, add an index, or rebuild a database.
Evidence
I used an isolated Gateway and an
operator.readcredential on Crabbox AWS, with synthetic deliveries and no live Telegram traffic.status --deepshowed history as INFO andstatus --allas plain detail. Three regression suites failed on main; 66 focused tests passed on the behavioral fix. The terminal captures compare15a54eaa5479and03fa7bf8dc03; the final lint cleanup did not change the SQL or displayed text.Read cost: The AWS benchmark found one indexed search before and after, with and without planner statistics. With 100,000 completed rows, the warm median after
ANALYZEwent from 0.021 to 0.044 ms with 100 failures, and from 9.55 to 86.88 ms with 100,000 failures. These are query times on a cache miss, not health RPC latency. Reading each failed row’s recovery state avoids a database migration. Idle reads reuse the cached aggregate.AWS CLI verification on
bbce2eb92f82passed touched-file lint (zero warnings/errors), formatting, focused regressions, the query-plan assertion, and core types. The read-only CLI showed the new failure at 19s, not the receipt at 43–49s. After resubmission and restart, only history remained. The preparation receipt records the patch and exact Git tree. Commitb7f68b66d8e8has the same Git tree as that AWS run.Full CI found that TypeScript could not prove the test had captured a query before inspecting it.
5847f0cdd677changes onlysqlite-query-plan.test.ts, leaving the production tree and CLI captures unchanged. On Crabbox AWS, the previously failingcore-test-state-loggingtype graph and the failed-range query-plan test both passed with that test fix.Terminal comparison
Before
After
What changed
Co-authored-by: daniel-lxs [email protected]
Worked on by
Work sessions
Linked for team reference; these sessions aren’t public.
🦞 Made with OpenClaw