Skip to content

Reconcile external-action settlement retries - #708

Merged
flyingrobots merged 7 commits into
mainfrom
task/707-idempotent-settlement-retries
Jul 30, 2026
Merged

Reconcile external-action settlement retries#708
flyingrobots merged 7 commits into
mainfrom
task/707-idempotent-settlement-retries

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Return exact already-admitted settlement evidence after acknowledgement loss without another WAL transaction or effect authority. Conflicting and malformed retries fail closed; duplicate WAL history remains an obstruction.

Closes #707.

Summary by CodeRabbit

  • New Features

    • Added reliable retry reconciliation for external action settlements when acknowledgement is lost.
    • Matching retries now return the previously recorded result without creating duplicate history.
    • Conflicting or malformed retry candidates are rejected safely.
  • Documentation

    • Clarified settlement retry, validation, conflict handling, and recovery behavior.
    • Documented that existing duplicate settlement records continue to block recovery.

@flyingrobots

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@flyingrobots

Copy link
Copy Markdown
Owner Author

@codex please review

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@flyingrobots, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9634b487-1c14-487d-b6d1-2a8655d21760

📥 Commits

Reviewing files that changed from the base of the PR and between a11c91d and b6fb6bb.

📒 Files selected for processing (1)
  • crates/warp-core/tests/external_action_protocol_tests.rs
📝 Walkthrough

Walkthrough

Adds idempotent reconciliation for retained external-action settlement candidates after acknowledgement loss. Exact durable matches return the original settlement and commit digest without WAL growth; conflicting, malformed, or missing settlements are rejected.

Changes

Settlement retry reconciliation

Layer / File(s) Summary
Retry admission and duplicate semantics
crates/warp-core/src/external_action.rs
Adds reconcile_external_action_settlement_retry, validates candidates against recovered state, returns the original admitted settlement and commit digest, and distinguishes same-commit replay from conflicting settlement records.
Protocol and recovery validation
crates/warp-core/tests/external_action_protocol_tests.rs
Tests exact retries, conflicts, malformed candidates, missing settlements, filesystem recovery, repeated retries, and unchanged WAL state.
Protocol documentation and release notes
CHANGELOG.md, docs/adr/0026-durable-external-action-settlement.md, docs/topics/ExternalActions.md
Documents retry reconciliation, validation outcomes, and the continued recovery obstruction caused by duplicated settlement records.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Adapter
  participant RetryReconciliation
  participant Coordinator
  participant WAL
  Adapter->>RetryReconciliation: Submit retained settlement candidate
  RetryReconciliation->>Coordinator: Validate and compare candidate
  Coordinator->>WAL: Read durable settlement and commit digest
  WAL-->>Coordinator: Recovered settlement state
  Coordinator-->>RetryReconciliation: Original fact or conflict
  RetryReconciliation-->>Adapter: Settlement result without new WAL commit
Loading

Possibly related PRs

  • flyingrobots/echo#704: Introduces the durable external-action settlement admission and recovery foundation used by this retry reconciliation path.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the core change: idempotent reconciliation of external-action settlement retries.
Linked Issues check ✅ Passed The changes implement exact-retry idempotence, reject conflicts and malformed candidates, avoid extra WAL writes, and preserve recovery behavior as required by #707.
Out of Scope Changes check ✅ Passed The docs, ADR, tests, and code changes all support the retry-reconciliation feature and do not show unrelated scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task/707-idempotent-settlement-retries

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: a11c91d1eb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/warp-core/tests/external_action_protocol_tests.rs`:
- Around line 1108-1151: Extend
conflicting_settlement_retry_obstructs_without_wal_growth with a separate retry
candidate using the same result bytes as the admitted settlement but
ExternalActionSettlementKindV1::Failed. Assert
reconcile_external_action_settlement_retry returns ConflictingSettlement for
this kind-only mismatch, while preserving the existing WAL/frame growth
assertions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 27c730c2-7c9d-4bc7-9b78-15ab3cd7322c

📥 Commits

Reviewing files that changed from the base of the PR and between c684ddb and a11c91d.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • crates/warp-core/src/external_action.rs
  • crates/warp-core/tests/external_action_protocol_tests.rs
  • docs/adr/0026-durable-external-action-settlement.md
  • docs/topics/ExternalActions.md

Comment thread crates/warp-core/tests/external_action_protocol_tests.rs
@flyingrobots

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@flyingrobots

Copy link
Copy Markdown
Owner Author

@codex please review

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: b6fb6bb620

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@flyingrobots

Copy link
Copy Markdown
Owner Author

Merge gate: 40/40 checks pass on b6fb6bb; zero unresolved review threads; Codex found no issues on the current head; CodeRabbit confirmed the only finding, then was rate-limited on the follow-up. Solo-maintainer operator-authorized review substitution applies.

@flyingrobots
flyingrobots merged commit 3269f06 into main Jul 30, 2026
40 checks passed
@flyingrobots
flyingrobots deleted the task/707-idempotent-settlement-retries branch July 30, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make identical external-action settlement retries idempotent

1 participant