Repository navigation
fix(outbound): retain delivered receipts after heartbeat renewal fails - #190318
Conversation
Keep cancellation on send initiation while concrete receipts settle through the existing exact claim. Protect replacement claims and partial batches with production queue regressions.
Replace parallel mailbox summary arrays and the derived elision count with paired entries. Preserve original-to-compact source identity, active custody, approved text, and routing through enqueue, drain, cancellation, and compaction.
Clarify mailbox admission versus settlement, subagent compensation, transcript drain budgets, plugin health, reload receipts, managed handoff custody, and the UI save slot. Keep existing owners and behavior.
|
🦞👀 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 retains accepted delivery receipts after producer-heartbeat failure, pairs mailbox summary sources with their text, and documents lifecycle ownership. Example: Matrix returns messageId accepted-message after the producer heartbeat fails.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it addresses a current delivery-settlement defect, preserves exact-claim fencing, and has no concrete introduced correctness finding; CI remains blocked by an unattributed restart-resume timeout. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe outbound queue receives prepared channel payloads, holds durable send custody, invokes channel adapters, and settles receipts or retains uncertain deliveries for recovery. flowchart TD
A[Prepared payloads] --> B[Durable queue claim]
B --> C[Producer lease]
C --> D[Channel send]
D --> E[Platform receipt]
E --> F[Exact claim settlement]
F --> G[Completion or recovery]
Technical reviewBest possible solution: Keep receipt settlement in the existing exact-claim queue owner while retaining cancellation checks before every subsequent send. Do we have a high-confidence way to reproduce the issue? Current-main source shows the aborted producer lease rejecting settlement after an accepted receipt; the PR reports a base-failing regression, but this read-only review executed no target code. Is this the best way to solve the issue? The repair uses the existing queue owner and transactional claim check, preserves send cancellation, and removes the superseded mailbox representations without adding competing machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f79a4e602b11. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +42, Tests +72, Docs +9, Other +2. Total +125 across 25 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 November 1, 2026, 8:04 AM ET / 13:04 UTC. |
Require a written seal for the fixture physical store while preserving marker ordering and the no-backfill check. Emit bounded Gateway context for rejected provider gates through raw stderr so the silent E2E runner retains it.
|
Merged via squash auto-merge.
|
Remove the obsolete provider-phase rejection case: an expired lease still settles a concrete receipt through its exact durable claim, as intended by #190318. The unchanged cancellation suite already proves same-owner receipt acceptance, replacement-claim preservation, partial-batch fencing and no replay. Keep both pre-dispatch ownership-loss cases and the stable-intent renewal/completion checks. The original fixture reproduces one failure; the remaining lease and cancellation suites pass all 25 cases on Node and Bun. Scoped types, typed lint, format and the staged line ratchet pass. Production code is unchanged; test code shrinks by forty lines.
openclaw#190318) * fix(outbound): preserve accepted receipts after lease renewal fails Keep cancellation on send initiation while concrete receipts settle through the existing exact claim. Protect replacement claims and partial batches with production queue regressions. * refactor(sessions): pair overflow summary sources with their text Replace parallel mailbox summary arrays and the derived elision count with paired entries. Preserve original-to-compact source identity, active custody, approved text, and routing through enqueue, drain, cancellation, and compaction. * docs(runtime): clarify lifecycle custody and settlement boundaries Clarify mailbox admission versus settlement, subagent compensation, transcript drain budgets, plugin health, reload receipts, managed handoff custody, and the UI save slot. Keep existing owners and behavior. * test(gateway): qualify restart receipts and report gate failures Require a written seal for the fixture physical store while preserving marker ordering and the no-backfill check. Emit bounded Gateway context for rejected provider gates through raw stderr so the silent E2E runner retains it.
Remove the obsolete provider-phase rejection case: an expired lease still settles a concrete receipt through its exact durable claim, as intended by openclaw#190318. The unchanged cancellation suite already proves same-owner receipt acceptance, replacement-claim preservation, partial-batch fencing and no replay. Keep both pre-dispatch ownership-loss cases and the stable-intent renewal/completion checks. The original fixture reproduces one failure; the remaining lease and cancellation suites pass all 25 cases on Node and Bun. Scoped types, typed lint, format and the staged line ratchet pass. Production code is unchanged; test code shrinks by forty lines.
What Problem This Solves
A failed producer heartbeat can discard an accepted outbound receipt and leave
delivery unresolved even when its original queue claim survives. This cleanup
also removes parallel mailbox summary state and clarifies lifecycle ownership.
User Impact
Already-started sends can settle their unchanged claim after heartbeat failure.
Cancellation blocks later sends, replacement claims remain protected, and partial
batches retain recovery custody. Mailbox and UI behavior are preserved.
Why This Change Was Made
Keep receipt settlement in the existing exact-claim delivery owner. Pair mailbox
sources with summary text and remove the derived elision count. Document existing
mailbox, subagent, plugin, reload, update, transcript and UI ownership without a
state-machine framework or public API, config, dependency, schema or protocol change.
During CI qualification, the restart fixture also gained failure-only gate/Gateway
diagnostics through raw stderr, which the silent E2E runner retains. Its closure
assertion now selects the first successful seal for the actual physical session
store, preserving strict marker ordering and the no-late-backfill check.
Evidence
ba51135a5962and passeswith the fix; paired cases protect replacement claims and partial-batch custody.
The original production snapshot passed 380 selected tests across 16 files.
Queue proof uses controlled external adapters; no live transport-client recovery
trace is claimed.
checks and hooks passed. The final fixture passed its owning
test-root-othertype graph, lint, format, diff and test-line checks without a new allocation.
timed out in the blocked-store:false restart case at 180 seconds. A
paired Linux replay
passed 212/212 tests on its exact CI merge
dd1398ab7753and 212/212 on main based2710e1efaa7, using the original four-file shard order and matching observedresources/runtime. This predates the fixture-only follow-up and did not reproduce
or attribute the timeout. Main's original run had zero jobs; no inherited-failure
or successful-repair claim is made.
c07d1e19bad, both original-budget restart cases passed.A controlled missing gate verified visible context under the silent runner.
Injected interim/unrelated receipts were ignored, while an early matching
successful seal still failed the strict ordering assertion. All probe-only
changes were restored; committed bytes match the tested candidate. A prior
generic-receipt ordering failure remains documented in native review evidence.
ba51135a5962through P2. Hosted ClawSweeper
found no actionable findings at production head
2d6d636b5097. Fresh localautoreview covered the complete fixture delta from that head to
c07d1e19bad,with the full fixture and owners supplied: scoped-clean through P2, zero
actionable findings.
passed for
c07d1e19bad. GitHub completed the normal gated squash merge.