Repository navigation
fix(reply): report settled delivery outcomes once - #124773
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 17, 2026, 9:26 AM ET / 13:26 UTC. ClawSweeper reviewWhat this changesThe PR makes settled receipts canonical for reply delivery while also changing configuration health reporting and several migration/session utilities. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open: the latest head fixes the earlier admission-counter concern, but it also introduces a P1 remote-configuration health-reporting regression outside the stated reply-delivery work. Priority: P1 Review scores
Verification
How this fits togetherReply dispatch queues agent output through channel transports, then reports settled visibility and failure facts to channel fallbacks, reactions, logs, and compatibility consumers. Separately, the configuration wizard probes a gateway and tells an operator whether its health check completed. flowchart LR
A[Agent reply payload] --> B[Reply dispatcher]
B --> C[Channel transport]
C --> D[Settled delivery receipt]
D --> E[Fallbacks and channel status]
D --> F[Legacy SDK projection]
G[Configure remote gateway] --> H[Reachability and health result]
H --> I[Operator-facing setup status]
Decision needed
Why: Those changes alter setup and migration behavior outside the stated delivery invariant, so only maintainers can decide whether they share one merge and release-risk boundary. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +295, Tests +376. Total +671 across 71 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Restore the three-state health outcome and its failed-health regression coverage, then separate unrelated configuration, migration, and session changes from the reply-delivery repair unless maintainers explicitly retain them together. Do we have a high-confidence way to reproduce the issue? Yes, by source: Is this the best way to solve the issue? No. The receipt design now preserves the prior admission-count contract, but the branch must restore failed-health reporting and narrow or explicitly justify unrelated setup and migration changes. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bc277fa09554. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (21 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
36e45bf to
dd2bfa6
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer adjudication of the latest P1 (configure.wizard.ts:167-172, failed gateway health reporting): skipped as out of scope for this PR. That file is not among this PR's 71 changed files, and the concern (health-command failure visibility during the configure wizard) belongs to the setup/wizard owner and its silent-failure invariant — unrelated to dispatch-receipt settlement. It is filed as a dedicated follow-up task rather than absorbed into an already seven-round delivery-accounting PR. All previous actionable findings from this review series are addressed on the current head: seal race (idle-barrier finalizations + fake-timer regression), Matrix receipt consumption, channel-message facade legacy projections, shipped counter API restored as receipt-derived projections, legacy-dispatcher admission-conservative visibility with capability detection, and getQueuedCounts admission semantics restored (d10dacd). |
|
Merged via squash.
|
* refactor(reply): publish settled dispatch receipts * refactor(reply): isolate dispatch outcome accounting * refactor(discord): infer settled dispatch result * test(reply): model settled dispatch receipts * test(reply): type settled receipt fixtures * test(telegram): declare settled final receipt * test(telegram): adapt legacy dispatch fixtures * fix(reply): complete settled receipt compatibility * test(channels): keep delivery suite within lint budget * test(channels): reuse settled count fixture * test(channels): consolidate receipt assertions * test(channels): extract delivery receipt fixtures * fix(qa): recover stopped clients after config restart * fix(reply): settle deferred delivery receipts * test(channels): share delivery turn fixtures * fix(channels): preserve non-visible reconciliation * fix(reply): preserve settled receipt compatibility * refactor(reply): make settled receipts canonical * refactor(reply): absorb settlement at dispatcher boundary * test(matrix): prove settled receipt precedence * refactor(sessions): extract prompt snapshot types * fix(reply): restore queued admission counts
What Problem This Solves
Fixes an issue where reply delivery visibility was inferred from queued admissions and then repaired in several downstream layers. Cancelled, explicitly non-visible, pre-send failed, and ambiguous post-send outcomes could therefore be collapsed or reconstructed inconsistently.
Why This Change Was Made
The reply dispatcher now publishes one settled receipt after its delivery chain drains. Each reply kind records
delivered,deliveredNotVisible,cancelled,failedBeforeSend, andfailedAfterSend, plus the terminalanyVisibleDeliveredfact. Channel turns and fallback decisions consume that receipt directly; the old subtraction and multi-signal count reconstruction paths are removed.The deprecated inbound-reply-dispatch Plugin SDK shim retains its existing count-shaped contract by deriving legacy fields from the receipt at that compatibility boundary only.
User Impact
Reply visibility, no-visible-reply fallback behavior, status reactions, and delivery logs now use transport settlement facts instead of queue admission guesses. Explicitly non-visible sends no longer need lifecycle subtraction, while post-send ambiguity remains conservatively distinguishable from failures proven to occur before I/O.
Evidence
{ visibleReplySent: false }returned no settlement fact; the new boundary test now recordsdeliveredNotVisible: 1andanyVisibleDelivered: false.pnpm check:changed: all core/extension type, lint, SDK surface, dead-code, schema, import-cycle, and architecture guards passed. Run: https://github.com/openclaw/openclaw/actions/runs/31966661637