Skip to content

fix(discord): preserve authoritative voice-delivery outcomes - #117127

Merged
steipete merged 1 commit into
mainfrom
codex/qa300-discord-voice-replay-guard
Aug 1, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa300-discord-voice-replay-guard

Conversation

@steipete

@steipete steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Discord could post both an accepted voice reply and a duplicate text transcript when the voice-create response was lost. Same-nonce retries were already safe, but the outer payload owner treated an exhausted ambiguous failure as authorization to create a different message.

Why This Change Was Made

The existing private Discord retry owner owns one typed delivery-failure classifier and one identity-preserving, garbage-collected create-phase record. Only the actual final nonce-protected voice-message create records ambiguity; remote media downloads, attachment negotiation, CDN uploads, and transcoding never do. The fallback owner reads that recorded fact instead of guessing the phase from an error message.

User Impact

  • Never creates a second text message after an ambiguous final voice create HTTP 408/5xx, connection reset, body/socket timeout, abort, fetch failed, or another existing Discord transient-transport outcome.
  • Retains text fallback when the identical HTTP 5xx, timeout, abort, or fetch failed occurs during audio download, attachment negotiation, or CDN upload before any message can exist.
  • Preserves text fallback after an unavailable encoder, a definitive HTTP rejection, a rate-limit rejection, or a proven DNS/connect failure.
  • Preserves stable nonce-protected voice retries, non-idempotent webhook safety, gateway reconnects, reply targeting, already-visible transcripts, and durable delivery receipts.

Evidence

  • Exact baseline: 21fba83254a800843e26e1003dbc0e245ad97b27; immutable candidate: 9fb07027f2c53c248e4c15b82d33c05ce888fb33.
  • Authentic baseline: 8 original actual-owner failures and 13 additional message-only transport failures were reproduced while legitimate fallback controls passed.
  • A previous genuinely structured review found four authentic pre-create regressions; the immutable replacement first reproduced all four RED and now proves real upload/preflight 5xx/fetch failures remain unmarked while final provider create failures are marked.
  • 327 tests pass across 12 focused voice, upload, webhook, retry, delivery, draft, thread, and ordinary-message suites.
  • Real installed DiscordError and RateLimitError classes, nonce enforcement, authoritative HTTP-versus-nested-cause precedence, every existing transient-message variant, and safe FFmpeg/pre-connect/rejection controls are covered.
  • The same-nonce retry contract also stays safe when an earlier ambiguous create is followed by a final proven pre-connect failure; frozen errors and wrapped causes retain their original identity.
  • Fresh full P0–P3 structured autoreview is clean; three independent complete reviews are clean at 0.99 / 0.98 / 0.99 confidence.
  • An exclusive hosted Testbox restored the exact immutable candidate, checked its commit/tree/direct parent/index and all six file hashes, passed the complete production and extension-test TypeScript gates, and passed all 327/327 actual owner/provider tests plus formatting, lint, and channel-fetch-boundary checks. The single lease was stopped and independently confirmed completed.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: L maintainer Maintainer-authored PR labels Aug 1, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 31, 2026, 8:35 PM ET / August 1, 2026, 00:35 UTC.

ClawSweeper review

What this changes

This PR prevents Discord voice replies from falling back to a separate text message when the final nonce-protected voice-message create has an ambiguous response that may already have committed.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 4 items remain

No discrete patch defect found. The change places the ambiguity fact at the final Discord message-create owner and prevents the outer voice fallback from issuing a different-nonce text reply; current main does not yet contain it. The protected maintainer label and missing inspectable after-fix runtime evidence keep this PR open for human merge review. Likely related people: @steipete (medium confidence).

Priority: P1
Reviewed head: 9fb07027f2c53c248e4c15b82d33c05ce888fb33

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation and focused coverage are credible, but missing inspectable real Discord proof caps merge readiness.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body reports focused tests and hosted Testbox validation, but it provides no inspectable after-fix Discord runtime transcript, recording, terminal output, or redacted logs that directly show the changed delivery behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body reports focused tests and hosted Testbox validation, but it provides no inspectable after-fix Discord runtime transcript, recording, terminal output, or redacted logs that directly show the changed delivery behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 7 items Current-main comparison: The candidate commit is not an ancestor of the checked-out current main, so current main does not already contain this fix.
Authoritative create boundary: The branch marks ambiguity only when the final POST to Discord’s message endpoint throws; audio download, attachment negotiation, and CDN upload remain outside this scope.
Safe fallback decision: The outer payload path checks the recorded create ambiguity and rethrows before attempting the ordinary text fallback, which would use a different message creation path.
Findings None None.
Security None None.

How this fits together

Discord’s outbound payload adapter sends voice media through the voice-message sender, then may send text when voice preparation fails. The retry layer classifies whether the final Discord create could have committed, and the payload adapter uses that recorded result to decide whether a separate text reply is safe.

flowchart LR
  A[Outbound reply payload] --> B[Voice message sender]
  B --> C[Audio preparation and upload]
  C --> D[Final Discord message create]
  D --> E{Delivery outcome}
  E -->|Pre-create failure| F[Text fallback]
  E -->|Ambiguous create| G[Propagate failure]
  F --> H[One visible reply]
  G --> I[Avoid duplicate reply]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports focused tests and hosted Testbox validation, but it provides no inspectable after-fix Discord runtime transcript, recording, terminal output, or redacted logs that directly show the changed delivery behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The PR is behind current main and overlaps Discord files changed after its base. GitHub reports it mergeable, but the exact clean merge result should receive focused delivery validation before landing.
  • Resolve merge risk (P2) - The PR body reports focused Testbox and test validation, but it does not provide inspectable after-fix Discord runtime output that demonstrates both suppression after an ambiguous final create and retained fallback after a pre-create failure.
  • Complete next step (P2) - The protected maintainer-labeled PR needs exact-current-main validation and observable Discord proof, not an automated repair.
Agent review details

Security

None.

PR surface

Source +61, Tests +476. Total +537 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 3 109 48 +61
Tests 3 481 5 +476
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 590 53 +537

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: extensions/discord/src/voice-message.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Refresh merge and delivery proof (recommended)
    Validate the exact clean merge result on current main and add redacted Discord runtime evidence for both ambiguous final-create suppression and safe pre-create fallback.
  2. Accept test-only evidence
    Land with the focused tests only if maintainers explicitly accept that live Discord runtime proof is unnecessary for this delivery-reliability change.
  3. Pause for owner review
    Pause the PR if maintainers want a broader review of the changed Discord retry and fallback semantics before accepting the ambiguity marker.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Validate the exact clean merge result on current main, then add redacted Discord runtime proof for ambiguous final-create suppression and pre-create fallback.

Technical review

Best possible solution:

Validate the exact clean merge result on current main, then attach redacted Discord runtime evidence showing that an ambiguous final create sends no text fallback while a pre-create failure still sends one.

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

Yes. Source and focused tests establish that an ambiguous error after the final Discord message POST reaches the outer voice fallback path, where baseline behavior can attempt a separate text send; this read-only review did not execute the regression.

Is this the best way to solve the issue?

Yes. Recording the outcome at the final create owner and reading it at the fallback owner is safer than inferring the create phase from an error message; current-main merge proof and observable runtime proof remain needed.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5d6f21122c96.

Labels

Label changes:

  • add P1: A duplicate visible Discord reply is a broken channel-delivery workflow when an ambiguous voice create occurs.
  • add merge-risk: 🚨 compatibility: Existing Discord voice delivery and retry behavior changes, requiring focused validation on the current-main merge result.
  • add merge-risk: 🚨 message-delivery: The patch deliberately suppresses a fallback message after a marked final-create failure, so an incorrect classification could duplicate or omit a visible reply.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused tests and hosted Testbox validation, but it provides no inspectable after-fix Discord runtime transcript, recording, terminal output, or redacted logs that directly show the changed delivery behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P1: A duplicate visible Discord reply is a broken channel-delivery workflow when an ambiguous voice create occurs.
  • merge-risk: 🚨 message-delivery: The patch deliberately suppresses a fallback message after a marked final-create failure, so an incorrect classification could duplicate or omit a visible reply.
  • merge-risk: 🚨 compatibility: Existing Discord voice delivery and retry behavior changes, requiring focused validation on the current-main merge result.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused tests and hosted Testbox validation, but it provides no inspectable after-fix Discord runtime transcript, recording, terminal output, or redacted logs that directly show the changed delivery behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • steipete: Peter Steinberger authored both the direct baseline and this candidate change across the Discord retry, voice-message, and payload-owner surfaces. (role: recent area contributor; confidence: medium; commits: 21fba83254a8, 9fb07027f2c5; files: extensions/discord/src/retry.ts, extensions/discord/src/voice-message.ts, extensions/discord/src/outbound-payload.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach redacted Discord runtime proof showing both ambiguous-create suppression and pre-create text fallback.
  • Refresh the focused validation on the exact clean merge result against current main.

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.

@steipete
steipete merged commit a8dfd37 into main Aug 1, 2026
122 of 130 checks passed
@steipete
steipete deleted the codex/qa300-discord-voice-replay-guard branch August 1, 2026 00:40
@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit to pacocartones/openclaw that referenced this pull request Aug 1, 2026
* origin/main: (217 commits)
  fix(messages): reply actions leak citation markers and reply/poll answers draw the no-reply fallback (openclaw#116909)
  fix(slack): let durable ingress retry transient thread lookups (openclaw#117135)
  refactor(doctor): consolidate shipped state migration ownership (openclaw#117142)
  fix(ai): Codex stream shows internal parser text on a malformed frame (openclaw#116966)
  fix: guard every migrated session accessor path (openclaw#117140)
  fix(terminal): measure unicode display width consistently (openclaw#117062)
  fix(openai): clear ChatGPT SSE fallback per session (openclaw#117123)
  fix(mistral): reject incomplete streamed tool terminals (openclaw#117137)
  fix(ai): preserve structured chat content and refusals (openclaw#117136)
  fix(doctor): persist normalized agent roster (openclaw#117115)
  fix(signal): avoid replay after ambiguous quote delivery errors (openclaw#117134)
  fix(cron): reject disabled delivery accounts when scheduling (openclaw#116899)
  fix(gateway): honor HTTP If-Modified-Since media validators (openclaw#117133)
  fix(config): delete one array element per config patch delete (openclaw#116463)
  fix(plugins): report installed dependency health authoritatively (openclaw#117029)
  fix(ui): recover moving sessions across paged gateway rosters (openclaw#117016)
  fix(ui): clear hidden session selection before bulk deletion (openclaw#117015)
  fix(discord): avoid replaying ambiguous voice deliveries (openclaw#117127)
  fix(ui): scope Gateway reconnect lineage to its target (openclaw#117125)
  fix(models): expose runtime provider catalogs in browse views (openclaw#116857)
  ...
vincentkoc added a commit to yetval/openclaw that referenced this pull request Aug 1, 2026
* commit 'c41f033b87545b658215a9c3bbe03f88fbaa867d': (347 commits)
  refactor(plugins): consolidate descriptor and startup ownership (openclaw#117146)
  fix(messages): reply actions leak citation markers and reply/poll answers draw the no-reply fallback (openclaw#116909)
  fix(slack): let durable ingress retry transient thread lookups (openclaw#117135)
  refactor(doctor): consolidate shipped state migration ownership (openclaw#117142)
  fix(ai): Codex stream shows internal parser text on a malformed frame (openclaw#116966)
  fix: guard every migrated session accessor path (openclaw#117140)
  fix(terminal): measure unicode display width consistently (openclaw#117062)
  fix(openai): clear ChatGPT SSE fallback per session (openclaw#117123)
  fix(mistral): reject incomplete streamed tool terminals (openclaw#117137)
  fix(ai): preserve structured chat content and refusals (openclaw#117136)
  fix(doctor): persist normalized agent roster (openclaw#117115)
  fix(signal): avoid replay after ambiguous quote delivery errors (openclaw#117134)
  fix(cron): reject disabled delivery accounts when scheduling (openclaw#116899)
  fix(gateway): honor HTTP If-Modified-Since media validators (openclaw#117133)
  fix(config): delete one array element per config patch delete (openclaw#116463)
  fix(plugins): report installed dependency health authoritatively (openclaw#117029)
  fix(ui): recover moving sessions across paged gateway rosters (openclaw#117016)
  fix(ui): clear hidden session selection before bulk deletion (openclaw#117015)
  fix(discord): avoid replaying ambiguous voice deliveries (openclaw#117127)
  fix(ui): scope Gateway reconnect lineage to its target (openclaw#117125)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
* commit '31f24547a94a8bd74a32e42cde1783591c5804d9': (347 commits)
  refactor(plugins): consolidate descriptor and startup ownership (openclaw#117146)
  fix(messages): reply actions leak citation markers and reply/poll answers draw the no-reply fallback (openclaw#116909)
  fix(slack): let durable ingress retry transient thread lookups (openclaw#117135)
  refactor(doctor): consolidate shipped state migration ownership (openclaw#117142)
  fix(ai): Codex stream shows internal parser text on a malformed frame (openclaw#116966)
  fix: guard every migrated session accessor path (openclaw#117140)
  fix(terminal): measure unicode display width consistently (openclaw#117062)
  fix(openai): clear ChatGPT SSE fallback per session (openclaw#117123)
  fix(mistral): reject incomplete streamed tool terminals (openclaw#117137)
  fix(ai): preserve structured chat content and refusals (openclaw#117136)
  fix(doctor): persist normalized agent roster (openclaw#117115)
  fix(signal): avoid replay after ambiguous quote delivery errors (openclaw#117134)
  fix(cron): reject disabled delivery accounts when scheduling (openclaw#116899)
  fix(gateway): honor HTTP If-Modified-Since media validators (openclaw#117133)
  fix(config): delete one array element per config patch delete (openclaw#116463)
  fix(plugins): report installed dependency health authoritatively (openclaw#117029)
  fix(ui): recover moving sessions across paged gateway rosters (openclaw#117016)
  fix(ui): clear hidden session selection before bulk deletion (openclaw#117015)
  fix(discord): avoid replaying ambiguous voice deliveries (openclaw#117127)
  fix(ui): scope Gateway reconnect lineage to its target (openclaw#117125)
  ...
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 merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant