Skip to content

fix(discord): report the messages actually delivered - #128575

Merged
steipete merged 1 commit into
mainfrom
codex/discord-actual-delivery-receipts-20260824
Aug 24, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/discord-actual-delivery-receipts-20260824

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Discord delivery receipts incorrectly reported the kind of messages users actually received. Rejected uploads that fell back to explanatory text were marked as delivered media, later plain-text chunks after an attachment were marked as media, and follow-up text after interactive content was marked as another card.

Why This Change Was Made

The Discord sender already knows the authoritative type and reply target of each successfully delivered platform message, and forum sends already aggregate those concrete results correctly. Reuse one delivery-result collector for both forum and normal channel sends, then build each final receipt from the real delivered results instead of reconstructing every part from the original request.

User Impact

Discord message receipts now accurately reflect text-only upload fallbacks, mixed media/text messages, interactive card/text messages, message ordering, and per-message reply references. Downstream delivery tracking sees what Discord actually accepted rather than what the sender originally attempted.

Evidence

  • Extended existing sender regressions instead of adding duplicate fixtures. Four assertions fail against current main: upload fallback reports media instead of text, card-plus-text reports card, card, and both media reply scopes report media, media.
  • Run node scripts/run-vitest.mjs extensions/discord/src/send.sends-basic-channel-messages.test.ts extensions/discord/src/outbound-adapter.test.ts extensions/discord/src/outbound-adapter.interactive-order.test.ts: 137 tests passed, including real local Discord REST loopback HTTP requests, forum thread receipts, both reply scopes, upload fallback, and adapter delivery.
  • Run node scripts/run-tsgo.mjs -p extensions/discord/tsconfig.json --noEmit --incremental --tsBuildInfoFile /private/tmp/openclaw-discord-plugin.tsbuildinfo: the complete touched Discord plugin type-checks successfully.
  • Run node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/discord/src/send.outbound.ts extensions/discord/src/send.sends-basic-channel-messages.test.ts, targeted oxfmt --check, and git diff --check.
  • Broad local all-plugin production/test type checks are currently blocked by pre-existing unrelated extensions/acpx type errors from the shared installed dependency cache; the isolated Discord package is clean, and exact-head hosted CI provides the clean-environment gate.
  • Independent read-only local review covers the actual outbound caller, ordinary and forum owners, concrete REST result kinds, starter/thread metadata, first/all reply references, optional progress ordering, and error behavior: CLEAN, with no actionable findings.
  • Production delta is exactly neutral: +21/-21. The change removes one duplicate progress callback and the request-based guessed-kind branch without touching authentication, configuration, persistent state, public plugin contracts, external API behavior, or protocol.
  • Real HTTP loopback evidence is included in the existing sender suite. A live operator-owned Discord channel was not used because it would send unsolicited external messages; the disposable loopback exercises the actual Discord request serialization and response path safely.

@clawsweeper

clawsweeper Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: S maintainer Maintainer-authored PR labels Aug 24, 2026
@steipete
steipete marked this pull request as ready for review August 24, 2026 06:51
@steipete
steipete merged commit 65bcdf2 into main Aug 24, 2026
167 checks passed
@steipete
steipete deleted the codex/discord-actual-delivery-receipts-20260824 branch August 24, 2026 07:05
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

channel: discord Channel integration: discord maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant