Repository navigation
fix(slack): preserve accepted reply parts after later delivery failures - #127130
Merged
Merged
Conversation
steipete
marked this pull request as ready for review
August 21, 2026 09:18
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Contributor
Author
|
Land-ready verification for exact head
Live Slack credentials and real Slack calls are intentionally prohibited. The generic mock Gateway does not load the Slack plugin, so the real Slack owner + transport callback + fake Slack API + production dispatcher test is the strongest authorized changed-boundary proof. |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 22, 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.
Closes #127120
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Fixes an issue where Slack users could receive duplicate replies or attachments when an ordinary multipart reply successfully delivered an earlier attachment or text chunk but a later part failed before its own dispatch. The later operation's no-dispatch error previously made the entire logical reply look safely replayable even though Slack had already accepted visible content.
Why This Change Was Made
The existing Slack transport already reports every accepted physical upload, chunk, or Block Kit fallback part through its delivery callback. The ordinary Slack reply owner now collects those accepted results separately for each logical reply and, only when a later operation fails, wraps the original error in the existing channel partial-delivery contract with an ordered aggregate receipt. Existing successful results, first-send failures, terminal hook ownership, dispatcher behavior, retry policy, plugin boundaries, and public SDK contracts remain unchanged.
Production delta is +53/-37 (net +16): most changed lines simply move the existing sender into its logical-reply scope. The remaining growth is the unavoidable ownership boundary for retaining accepted physical-send receipts before the overall send settles; replacing the successful aggregate result with the final callback result would silently discard earlier successful receipt parts.
User Impact
Slack replies and attachments already accepted by the provider are no longer misclassified as wholly undelivered after a later multipart failure, preventing duplicate fallback/replay. Genuinely undispatched first attempts retain their original error and remain eligible for the existing recovery behavior.
Evidence
Before the fix, the focused regression failed in all three relevant places: an accepted attachment lost its receipt, an accepted internal chunk lost its receipt, and the real reply dispatcher propagated the later no-dispatch error as safely replayable.
After the fix:
node scripts/run-vitest.mjs extensions/slack/src/monitor/replies.test.ts: 51 passed, including first-attachment success followed by a real provider-shaped no-dispatch failure, original-cause identity, ordered receipts, single failure hook, internal chunk acceptance, unchanged successful multipart result/hook, unchanged first-send failure, and strict per-logical-reply isolation.failedAfterSend: 1,failedBeforeSend: 0, andanyVisibleDelivered: true, the error callback fires once, and retry propagation does not occur.node scripts/run-vitest.mjs extensions/slack: 135 files / 2,428 tests passed across the complete Slack plugin lane.node scripts/run-vitest.mjs src/auto-reply/reply/before-deliver.test.ts src/channels/turn/delivery-result.test.ts extensions/matrix/src/matrix/monitor/replies.test.ts extensions/discord/src/monitor/reply-delivery.test.ts extensions/mattermost/src/mattermost/reply-delivery.test.ts extensions/msteams/src/reply-dispatcher.test.ts extensions/telegram/src/chunk-delivery.test.ts extensions/whatsapp/src/auto-reply/deliver-reply.test.ts: eight focused dispatcher, receipt, and sibling-channel shards passed. The unchanged dispatcher fallback regression proves that attached fallback runs only after a proven invisible failure and does not run after a visible post-send failure.node scripts/check-changed.mjs -- extensions/slack/src/monitor/replies.ts extensions/slack/src/monitor/replies.test.ts: passed formatting, production/test TypeScript, strict lint, plugin-boundary checks, import-cycle checks, and all changed-file guards.git diff --check: clean. Independent structured autoreview: clean, no actionable findings.Live Slack proof is intentionally unavailable because this repair must not use Slack credentials, services, real API calls, or operator state. The existing mock-Gateway harness exercises
qa-channel, not the Slack owner; the existing Slack QA adapter requires two live Slack credential leases and real identity calls. The actual owner + actual Slack transport + fake provider API + actual dispatcher boundary above is therefore the strongest authorized changed-path proof.AI-assisted; no changelog, dependency, core, SDK, configuration, persistence, security, authentication, product, retry-policy, protocol, or public-contract changes.