Skip to content

fix(slack): preserve dispatch custody for structured payloads - #123710

Merged
steipete merged 1 commit into
mainfrom
fix/autoqa25-slack-payload-custody
Aug 14, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/autoqa25-slack-payload-custody

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #123707

What Problem This Solves

Fixes an issue where queued Slack structured payload and presentation fanout sends could cross the Slack platform boundary without refreshing final dispatch custody. If cancellation or producer lease loss occurred after adapter entry, recovery no longer had the expected dispatch fence protecting against duplicate recipient-visible delivery.

Why This Change Was Made

The Slack lazy facade explicitly discarded onPlatformSendDispatch for payloads, and the structured fanout owner incorrectly tied callback forwarding to deliveryQueueId. The callback now follows the existing send context into every structured platform request, while deliveryQueueId remains suppressed for one-to-many fanout because exact provider reconciliation is a distinct single-message contract.

The repair also deletes the duplicate callback/queue-id override plumbing from the facade. Production code is net −19 lines (+0/-19); tests are net +34 (+37/-3). No config, protocol, storage, authentication, dependency, or public Plugin SDK surface changes.

Provenance: PR #97480 introduced the facade override/nulling shape while adding exact Slack reconciliation, and PR #104539 later coupled structured fanout callback forwarding to its single-message marker.

AI-assisted: yes. The implementation and proof were reviewed by Claude and by the repository Codex autoreview workflow.

User Impact

Slack structured messages now retain the same cancellation and delivery-lease custody as ordinary text and media sends. Multi-message structured fanout continues to avoid claiming a single exact reconciliation identifier for several Slack messages.

Evidence

  • Pre-fix regression: the focused suite failed at both affected boundaries because the facade and structured fanout delivered undefined instead of the callback.
  • Focused post-rebase proof: node scripts/run-vitest.mjs extensions/slack/src/channel.message-adapter.test.ts extensions/slack/src/outbound-payload.test.ts — 34/34 tests passed.
  • Actual changed gate: node scripts/check-changed.mjs -- extensions/slack/src/channel.ts extensions/slack/src/outbound-adapter.ts extensions/slack/src/channel.message-adapter.test.ts extensions/slack/src/outbound-payload.test.ts — passed on Blacksmith Testbox lease tbx_01m00ea864sxtas4kfgjf9g1ts; run https://github.com/openclaw/openclaw/actions/runs/31814802516.
  • Static proof: targeted oxfmt check, type-aware Oxlint, import-cycle/boundary/dead-export/type gates, and git diff --check passed.
  • Authenticated live proof: one benign structured message was sent once to a redacted Peter-owned Slack DM. The callback fired once before completion, the receipt contained one platform message, and Slack history contained exactly one deterministic marker. The send was not retried.
  • Dependency contract: inspected @slack/[email protected] request types and its chat.postMessage → apiCall transport boundary.
  • Rebase proof: stable patch ID remained 3a16cefeb280600d20f4e818d8c562155439735b; no touched-path owner overlap and no semantic or LOC drift.
  • Final branch autoreview: clean, no accepted/actionable findings, confidence 0.98.

@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 14, 2026 15:44
@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack size: S maintainer Maintainer-authored PR labels Aug 14, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 11:56 AM ET / 15:56 UTC.

ClawSweeper review

What this changes

This PR preserves the durable dispatch-custody callback for structured Slack payload sends while retaining the single-message-only delivery reconciliation marker.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking correctness finding: the patch restores the custody callback at the Slack facade and structured-fanout owner while keeping one-to-many reconciliation IDs suppressed. Keep this maintainer-labeled PR open until the queued exact-head gate completes and a maintainer lands it.

Priority: P2
Reviewed head: 6963398a780c948bc8ca5dc9c36c649757f45674

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A narrow, net-negative repair with focused boundary coverage and documented post-fix Slack evidence; pending CI is a merge gate, not a patch-quality defect.
Proof confidence 🦞 diamond lobster (5/6) Not applicable: This is a maintainer-authored PR, so the external-contributor proof gate does not apply; its body nevertheless records an authenticated post-fix Slack send.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored PR, so the external-contributor proof gate does not apply; its body nevertheless records an authenticated post-fix Slack send.
Evidence reviewed 5 items Current-main defect: Current main explicitly clears the facade callback and suppresses it for multi-message structured payloads, so the callback cannot reach those Slack sends.
Patch preserves the owner boundary: The PR removes the facade overrides so the existing context carries custody, while deliveryQueueId remains explicitly undefined for multi-message fanout.
Custody contract and request boundary: The shared outbound context defines the callback as the pre-I/O custody refresh; Slack invokes it before the repository-owned wrapper calls chat.postMessage.
Findings None None.
Security None None.

How this fits together

The bundled Slack plugin receives durable outbound delivery contexts and renders structured payloads into one or more Slack API requests. Dispatch custody must reach the request boundary before recipient-visible I/O, while provider reconciliation IDs remain limited to one-message deliveries.

flowchart LR
  A[Durable delivery queue] --> B[Slack channel facade]
  B --> C[Structured payload renderer]
  C --> D[Send context preserves custody callback]
  D --> E{Single-message reconciliation?}
  E --> F[Slack platform request]
  F --> G[Delivery receipt and recovery]
Loading

Before merge

  • Resolve merge risk (P1) - The exact-head openclaw/ci-gate is still queued; merging before it succeeds would leave a message-delivery change without the required final validation.
  • Complete next step (P2) - No repair dispatch is needed; await the queued exact-head gate and maintainer merge review for this protected message-delivery change.
Agent review details

Security

None.

PR surface

Source -19, Tests +34. Total +15 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 0 19 -19
Tests 2 37 3 +34
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 37 22 +15

Review metrics

Metric Value Why it matters
Production versus regression-test LOC production -19, tests +34 The repair deletes duplicate override plumbing while adding targeted coverage for facade propagation and multi-send custody ordering.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #123707
Summary: This PR is the concrete candidate repair for the canonical Slack dispatch-custody report.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Wait for exact-head delivery validation (recommended)
    Merge after openclaw/ci-gate succeeds for commit 6963398a780c948bc8ca5dc9c36c649757f45674, confirming the callback change across the channel boundary.
  2. Accept unverified delivery risk
    A maintainer could merge before that gate completes, but this would bypass the remaining validation for recipient-visible Slack delivery behavior.

Technical review

Best possible solution:

Land this net-negative owner-boundary repair after the exact-head delivery gate succeeds, keeping custody propagation and one-to-many marker suppression on their separate contracts.

Do we have a high-confidence way to reproduce the issue?

Yes—current-main source deterministically drops the callback in the facade and multi-segment fanout paths, and the PR adds focused boundary regressions for both cases.

Is this the best way to solve the issue?

Yes—the patch removes duplicate forwarding overrides and carries the existing context through the Slack owner, rather than adding another delivery path or weakening one-to-many reconciliation rules.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9386ac096632.

Labels

Label changes:

  • remove proof: sufficient: Current real behavior proof status is not_applicable, not sufficient.

Label justifications:

  • P2: The defect affects deterministic Slack structured-delivery integrity but is limited to a channel-specific payload path.
  • merge-risk: 🚨 message-delivery: The patch changes the final callback preceding recipient-visible Slack sends, so exact-head delivery validation remains material before merge.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-authored PR, so the external-contributor proof gate does not apply; its body nevertheless records an authenticated post-fix Slack send.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the current PR and the merged structured Slack visualization work that owns the fanout surface. (role: recent Slack structured-delivery contributor; confidence: high; commits: 934a974c296f, 37a63fbf450e; files: extensions/slack/src/channel.ts, extensions/slack/src/outbound-adapter.ts)
  • joeyfrasier: Authored the merged Slack ambiguous-send reconciliation change that established the adjacent delivery-marker path. (role: reconciliation feature contributor; confidence: medium; commits: 7e0d530e07d6; files: extensions/slack/src/channel.ts, extensions/slack/src/outbound-adapter.ts, extensions/slack/src/send.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-14T15:49:58.417Z sha 6963398 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Aug 14, 2026
@steipete
steipete merged commit 2bc1699 into main Aug 14, 2026
169 checks passed
@steipete
steipete deleted the fix/autoqa25-slack-payload-custody branch August 14, 2026 16:01
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete

Copy link
Copy Markdown
Contributor Author

Landed proof summary:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack maintainer Maintainer-authored PR merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Slack structured payloads drop final dispatch custody

1 participant