Repository navigation
fix(replies): aborted reply turns stall when delivery settlement starts after cancellation - #126582
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Contributor
Author
|
Land-ready proof for #126581 at head
AI-assisted: yes. |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers can help update the branch when needed.
Closes #126581
What Problem This Solves
Fixes an issue where aborted reply turns with a stalled delivery would remain in finalization for up to 30 seconds when cancellation happened before reply-turn settlement began.
Why This Change Was Made
Abort events are not replayed to listeners registered after cancellation. Check the existing abort state at the reply-turn ledger owner before allocating its deadline or listener and immediately return the same
abortedresult that the old path eventually produced after its 30-second timeout. The canonical dispatcher idle waiter already uses this owner-boundary pattern.The finalizer runs core fallback and exposes channel recovery eligibility only for a
settledresult, so returning the existingabortedresult sooner cannot widen fallback, replay, visibility, recipient delivery, or double-send. The outer dispatcher continues to drain deliveries and run its existing cleanup lifecycle unchanged.User Impact
Cancelled reply turns finish their own settlement promptly instead of waiting on the 30-second deadline. Operators get faster finalization and idle cleanup with no change to cancellation outcomes, fallback policy, replay ownership, configuration, protocol, persistence, or plugin contracts.
Evidence
pendingsentinel without advancing the 30-second deadline. Before:Expected: "aborted"; Received: "pending". After: the owner suite passes all 15 tests and preserves after-registration abort coverage.node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.turn-ledger.test.ts src/auto-reply/reply/dispatch-from-config.test.ts src/auto-reply/reply/dispatch-from-config.acp-abort.test.ts src/auto-reply/reply/reply-flow.test.ts extensions/telegram/src/bot-message-dispatch.fallback-topic-media.test.ts extensions/feishu/src/bot.broadcast.test.ts— 454 tests passed across six files and three Vitest shards.node scripts/check-changed.mjs -- src/auto-reply/reply/dispatch-from-config.turn-ledger.ts src/auto-reply/reply/dispatch-from-config.turn-ledger.test.ts— passed all core/coreTests format, production/test typecheck, lint, architecture, schema, storage, dependency, import-cycle, and ownership guards.git diff --checkpass. Production LOC: +3/-0; tests: +23/-0. The production growth is the necessary early owner precheck before deadline/listener allocation; removing the existing post-race check or hiding the guard would weaken cancellation ordering or clarity.eb38d5e4863a66d881c3fc1aa785ff53898088e7). Risk: low; existing outcome and all downstream contracts unchanged.