Skip to content

fix(discord): prevent false voice acknowledgments and stalled replies - #136982

Merged
steipete merged 1 commit into
mainfrom
codex/discord-voice-handoff
Sep 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/discord-voice-handoff

Conversation

@steipete

@steipete steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Closes #136939

What Problem This Solves

Fixes an issue where Discord voice acknowledges ordinary conversation without answering, or stops delivering later answers after an interrupted or rejected speech response.

Why This Change Was Made

The early wake-name path used a sliding transcript tail and fuzzy matching on unfinished words, so its acknowledgment could disagree with the final admission decision. It now retains the original prefix and reserves fuzzy matching for final transcripts.

Voice output ownership now survives audio clearing, encoder errors, and Discord's synchronous error-to-Idle transition until the provider response terminates. Already-completed buffered audio releases immediately. OpenAI speech-request rejection goes through the existing terminal response owner, including live validation errors that omit event_id but identify the pending response field. The shared harness admits the outgoing request before response.created, so a rejection cannot disappear before an owner exists. Redundant audioStarted and duplicate rejection cleanup paths are removed.

User Impact

Ordinary words and mid-sentence names no longer trigger misleading early acknowledgments. Following answers can speak after cancellation, encoder failure, or request rejection without reconnecting; old terminal events cannot prematurely release new speech. No configuration, model selection, schema, or protocol-version changes are required.

Evidence

  • The full changed-code check passes (format, types, lint, plugin boundaries, dependency, storage, import-cycle, and authorization guards). A clean rebase onto current main preserves the exact patch.
  • 186 tests across 11 owner/sibling files pass, including Discord consults, wake-name handling, real Opus encoding/player errors, OpenAI events/tools/response control, and the shared session harness.
  • Added regressions failed before the corresponding fixes. The real Discord player reproduces error -> Idle before Node's pipeline callback; the repaired owner retains the current answer until provider completion.
  • Live OpenAI WebSocket proof: the original code received a real invalid_request_error for response.tool_choice with no event ID and emitted no terminal outcome. The candidate emitted failed then completed, received 16,000 audio bytes, matched the synthetic phrase, and kept the same connection open.
  • Compared directly with OSS Codex at 38ba8cdceb536aa55af7db132d6bc830da8c0129: response-create queue and terminal response handling. The repair follows terminal ownership and queue release while retaining OpenClaw's successful-response-only tool execution boundary.
  • Installed @discordjs/voice 0.19.2 source confirms synchronous error-to-Idle behavior. Independent autoreview found the initial Idle-ordering gap; the real-player regression and owner repair addressed it, and the final P0–P2 review is clean.

Commands:

node scripts/run-vitest.mjs extensions/discord/src/voice/realtime-consults.test.ts extensions/discord/src/voice/realtime-playback.integration.test.ts extensions/discord/src/voice/realtime-playback.test.ts extensions/discord/src/voice/realtime-transcript.test.ts extensions/discord/src/voice/realtime-turns.test.ts extensions/discord/src/voice/realtime-turns.wake-name-followup.test.ts extensions/openai/realtime-voice-bridge-events.test.ts extensions/openai/realtime-voice-bridge-tools.test.ts extensions/openai/realtime-voice-response-control.test.ts extensions/openai/realtime-voice-terminal-outcomes.test.ts src/talk/realtime-session-harness.test.ts
OPENCLAW_LIVE_TEST=1 pnpm test:live --no-quiet extensions/openai/realtime-voice-provider.live.test.ts -t 'speaks again'
node scripts/check-changed.mjs

Production LOC: +49/-39 (net +10). Tests/support: +425/-64. The growth is the live-proven optional event-ID attribution contract and admission of a request before server acceptance; duplicate terminal cleanup and playback state were removed first. Regression introduction is not established; the failures were reproduced against current-main baseline 41419be40bbb17e5eed318992c8e3bf1aee6199b.

Proof scope: live OpenAI provider plus real Discord codec/player and manager-boundary tests. A new end-to-end Discord room roundtrip is not claimed.

Keep partial wake-name matching on the original prefix, preserve response ownership through player failures and cancellation, and settle rejected OpenAI speech requests through the shared terminal owner. Proven with failing regressions, real Opus player ordering, and same-connection live OpenAI recovery. Fixes #136939.
@clawsweeper

clawsweeper Bot commented Sep 3, 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 docs Improvements or additions to documentation channel: discord Channel integration: discord extensions: openai size: L maintainer Maintainer-authored PR labels Sep 3, 2026
@steipete
steipete marked this pull request as ready for review September 3, 2026 04:20
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 3, 2026, 12:36 AM ET / 04:36 UTC.

ClawSweeper review

What this changes

This PR makes Discord realtime voice acknowledge only exact leading wake names and keeps spoken-reply ownership until the corresponding OpenAI response terminates.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open. This is a focused maintainer-owned fix for an active P1 Discord voice bug; current main and the latest release do not contain it. No blocking correctness defect was found in the introduced lifecycle repair.

Priority: P1
Reviewed head: bedda0092284e5b98c3be0f5b79c9aef1589a91a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused owner-boundary repair and regression coverage are solid, with one environment-limited upstream dependency inspection gap.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository state identifies this as a maintainer-authored PR, so the external-contributor proof gate does not apply; the introduced live OpenAI test source and supplied maintainer evidence nonetheless target same-connection rejection recovery, while the real Discord player test covers the local transport ordering.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository state identifies this as a maintainer-authored PR, so the external-contributor proof gate does not apply; the introduced live OpenAI test source and supplied maintainer evidence nonetheless target same-connection rejection recovery, while the real Discord player test covers the local transport ordering.
Evidence reviewed 8 items Discord runtime owner wiring: The Discord realtime session routes provider terminal outcomes into playback, while the shared harness finishes the Talk response before forwarding the outcome to that transport callback.
Canonical response-owner repair: The shared harness now claims a turn on client response creation, covering rejected requests that never receive response.created; its existing terminal fencing rejects stale or duplicate response outcomes.
Provider error path: OpenAI realtime invalid response-parameter errors are routed through the same terminal-outcome path, whose callback ordering keeps release and queued work centralized.
Findings None None.
Security None None.

How this fits together

Discord voice sends transcripts and exact-speech requests through an OpenAI realtime provider, then plays returned audio while queuing later replies. The shared realtime harness records response ownership so provider terminal events and Discord player state cannot retire the wrong reply.

flowchart LR
  A[Discord speech] --> B[Transcript admission]
  B --> C[Agent consult and speech request]
  C --> D[OpenAI realtime provider]
  D --> E[Shared response ownership]
  E --> F[Discord player and queued replies]
Loading

Before merge

  • Resolve merge risk (P1) - The repair changes message-release ordering on a delivery-sensitive path. The review environment lacked installed @discordjs/voice source and could not reach GitHub to independently inspect that dependency contract, so its synchronous error-to-Idle behavior is supported here by the introduced real-player test and the supplied maintainer evidence rather than an independent upstream read.
  • Resolve merge risk (P1) - Production code is net +10 lines in a bug fix; the growth is confined to canonical response admission and event-ID-less terminal attribution, for which no smaller owner boundary was found.
Agent review details

Security

None.

PR surface

Source +10, Tests +361, Docs 0. Total +371 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 5 49 39 +10
Tests 8 425 64 +361
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 14 475 104 +371

Review metrics

Metric Value Why it matters
Production versus test delta production +49/-39 (net +10); tests/support +425/-64 (net +361); docs +1/-1 The small production increase implements the shared rejection-owner boundary while the bulk of the change is focused lifecycle regression coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #136939
Summary: This PR directly implements the linked issue's false wake acknowledgement and stalled queued-reply behavior; the issue remains canonical until the PR lands.

Members:

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

Merge-risk options

Maintainer options:

  1. Retain the shared response-owner repair (recommended)
    The shared harness should continue to claim requests before server acceptance and reject stale terminal twins, leaving Discord playback to release only the matching response.

Technical review

Best possible solution:

Keep response admission and terminal fencing in the shared realtime harness, release Discord exact speech only at the corresponding provider terminal boundary, and retain exact-only partial wake acknowledgements.

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

Yes. Pre-PR source used a sliding partial-transcript tail and released exact speech on player Idle before a provider response necessarily terminated; the added focused regressions encode both orderings.

Is this the best way to solve the issue?

Yes. The repair places request admission and stale-terminal fencing in the shared lifecycle owner, rather than adding Discord-only retries or an early player-state release.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 4e106e66581f.

Labels

Label justifications:

  • P1: The reported behavior can leave Discord voice users with a misleading acknowledgement or a later spoken reply that never delivers.
  • merge-risk: 🚨 message-delivery: The changed terminal ordering determines when queued Discord speech is released after cancellation, playback failure, or provider rejection.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository state identifies this as a maintainer-authored PR, so the external-contributor proof gate does not apply; the introduced live OpenAI test source and supplied maintainer evidence nonetheless target same-connection rejection recovery, while the real Discord player test covers the local transport ordering.

Evidence

What I checked:

  • Discord runtime owner wiring: The Discord realtime session routes provider terminal outcomes into playback, while the shared harness finishes the Talk response before forwarding the outcome to that transport callback. (extensions/discord/src/voice/realtime-session.runtime.ts:381, bedda0092284)
  • Canonical response-owner repair: The shared harness now claims a turn on client response creation, covering rejected requests that never receive response.created; its existing terminal fencing rejects stale or duplicate response outcomes. (src/talk/realtime-session-harness.ts:201, bedda0092284)
  • Provider error path: OpenAI realtime invalid response-parameter errors are routed through the same terminal-outcome path, whose callback ordering keeps release and queued work centralized. (extensions/openai/realtime-voice-events.ts:153, bedda0092284)
  • Wake-name admission and documentation: Partial transcript accumulation now preserves the leading prefix, and early acknowledgement requires an exact leading match; the Discord docs state the same behavior. (extensions/discord/src/voice/realtime-turns.ts:126, bedda0092284)
  • Focused boundary coverage: Added coverage exercises the real Discord player error-to-Idle ordering, both provider-completion orderings, cleared-audio paths, event-ID-less rejection handling, and the shared terminal fence; the live test source connects to the real OpenAI provider and verifies recovery on the same connection. (extensions/discord/src/voice/realtime-playback.integration.test.ts:172, bedda0092284)
  • Current-main and release check: Current main has no change to the affected paths since this PR's base and does not contain the PR head; no release tag contains the head, so the fix remains unmerged and unshipped. (4e106e66581f)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • dwc1997: Raw commit 2ebf042 adds extensions/discord/src/voice/realtime-transcript.ts:11 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2ebf0422dbfd; files: extensions/discord/src/voice/realtime-transcript.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-09-03T04:28:23.531Z sha bedda00 :: blocked before merge. :: none

@steipete

steipete commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Maintainer decision: merge this focused repair. The user requested investigation, fixes, and landing; the current-head CI run is now green: 33714707042, head bedda0092284e5b98c3be0f5b79c9aef1589a91a.

Addressing the latest ClawSweeper review's merge-risk and decision items: the net +10 production lines are needed for two concrete ownership boundaries: claiming an outgoing request before server acceptance and attributing the live-proven optional-event-ID validation error to the single in-flight request. Explicit stale IDs, unrelated errors, duplicate terminals, and reentrant queue drainage have regression coverage. Removing redundant playback state and duplicate terminal cleanup absorbs the rest of the repair. No configuration or schema surface was added.

Validation is complete: 186 focused owner/sibling tests pass, the full changed-code check passes, and final independent autoreview has no actionable P0–P2 findings. The real Discord AudioPlayer regression proves error-to-Idle ordering; the live OpenAI test proves rejected-request recovery followed by spoken audio on the same connection. A new Discord room microphone roundtrip is not claimed. The PR body records the commands and direct OSS Codex source comparison. Proceeding through native prepare and merge.

The refreshed review's dependency-inspection gap is covered by my direct inspection of the installed @discordjs/voice 0.19.2 implementation: dist/index.js:415–453 emits the state transition synchronously, :470–487 sets Idle from the play-stream error handler, and :562–579 handles forced stop. The real-player regression exercises that implementation and reproduced the original premature release. The native workflow subsequently merged the verified head as 01cf9f25bde3e5bc1f377109d6e6c8421e7f3228.

@steipete
steipete merged commit 01cf9f2 into main Sep 3, 2026
283 checks passed
@steipete
steipete deleted the codex/discord-voice-handoff branch September 3, 2026 04:45
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 3, 2026
…openclaw#136982)

Keep partial wake-name matching on the original prefix, preserve response ownership through player failures and cancellation, and settle rejected OpenAI speech requests through the shared terminal owner. Proven with failing regressions, real Opus player ordering, and same-connection live OpenAI recovery. Fixes openclaw#136939.
steipete added a commit that referenced this pull request Sep 3, 2026
* fix(discord): preserve realtime speaker and playback ownership

Bind provider connections to one Discord principal so delayed transcripts
and native consultations cannot inherit another speaker's authority.
Keep the shared agent route and serialize response-owned audio on one
room player, preserving continuations and recovery after playback gaps.

Admit host-requested responses before dispatch and map Google Live turn
completion to canonical terminal outcomes so queued speech can finish.

Closes #137349
Related: #136982, #123243
Follow-up: #137417

* test(discord): preserve room capture across speaker recovery
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 4, 2026
…law#137433)

* fix(discord): preserve realtime speaker and playback ownership

Bind provider connections to one Discord principal so delayed transcripts
and native consultations cannot inherit another speaker's authority.
Keep the shared agent route and serialize response-owned audio on one
room player, preserving continuations and recovery after playback gaps.

Admit host-requested responses before dispatch and map Google Live turn
completion to canonical terminal outcomes so queued speech can finish.

Closes openclaw#137349
Related: openclaw#136982, openclaw#123243
Follow-up: openclaw#137417

* test(discord): preserve room capture across speaker recovery
RomneyDa added a commit that referenced this pull request Sep 19, 2026
* feat(meta): add Muse Spark 1.3 models (#136553)

* feat(meta): add Muse Spark 1.3 models

* docs(meta): cite Muse Spark 1.3 recommendation

Co-authored-by: Tharun Tej Tammineni <[email protected]>

---------

Co-authored-by: Dallin Romney <[email protected]>
(cherry picked from commit 194b7f2)

* feat(anthropic): support Fable 5.1 from shared model metadata (#135638)

* feat(anthropic): support Fable 5.1 from shared model metadata

* test(anthropic): keep alias coverage within the file limit

* fix(media): decouple image limits from catalog augmentation

(cherry picked from commit 0a9b08c)

* feat(openai): support GPT Image 2.5 variants (#143068)

* feat(openai): support GPT Image 2.5 variants

* docs(openai): correct GPT Image 2.5 section link

(cherry picked from commit f93881f)

* feat(fal): support GPT Image 2.5 variants (#143069)

* feat(fal): support GPT Image 2.5 variants

* test(agents): restore Windows media fixture isolation

(cherry picked from commit a57c799)

* fix(bedrock): preserve images returned by tools (#149336)

## What Problem This Solves
Tool-returned images make the next request fail with `ValidationException` on affected Bedrock routes. Fixes #149332.

## Why This Change Was Made
The serializer generates image labels from each tool-call ID; input images need no labels. All consecutive tool results come first, followed by image groups in the same tool order. Request state has one writer. `stream.runtime.ts`: +28/−1 for this conversion.

Growth accepted under the owner's standing acceptance (2026-09-15).

## User Impact
Image-reading turns can finish without losing image bytes, tool associations, or error status.

## Evidence
Authenticated `chat.send` → registered `read` on a synthetic PNG: main sent a nested image and failed; candidate sent a sibling image and completed with the scripted “Red square; blue circle.” Our run used a recording HTTP transport.

The [contributor's real two-tool run](#149336 (comment)) confirms image interpretation and association.

## Compatibility
Concrete route identities select the conversion. Opaque aliases keep their layout. The general schema permits nested images for some routes; this repair addresses the affected route’s observed rejection. No config or public interface changes.

## Consumers
All clients use the existing Bedrock serializer.

## Invalidation
Conversion is request-local. Stored transcript rows and original image bytes remain unchanged.

## Tests
`node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-providers.config.ts extensions/amazon-bedrock`: 289 tests across 12 files passed on a fresh merge with main. Types, lint, formatting, file-size and assertion limits, and unused-export checks passed.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 115522a)

* fix: preserve Ultra across model runtime boundaries (#135397)

* fix: preserve Ultra across model runtime boundaries

Keep native Codex Ultra as a runtime mode instead of clamping it against
physical Responses effort tiers. Share the selected collaboration effort
between turn fields and remove the redundant forwarding wrapper.

Carry the active parent thinking level through existing spawn context so
one-shot overrides reach native subagents without changing saved preferences.
Keep explicit child overrides and configured child defaults authoritative.

Scope Control UI thinking catalog fallback to the selected runtime, sharing
one prepared entry for picker options and the inherited default. Document
the native orchestration/budget boundary and active-turn inheritance.

* refactor: simplify Ultra reasoning fixtures

* fix: preserve active thinking across shared tool contexts

* docs: clarify Off thinking for side questions

(cherry picked from commit ee9e22b)

* fix(anthropic): Fable 5.1 sessions lose reasoning after model switches and runtime events (#136782)

* fix(anthropic): keep Fable 5.1 thinking valid across model switches and runtime context

Claude Fable 5.1 binds each thinking block to the producing model and to the
exact request prefix that preceded it. Three harness behaviors conflicted with
that contract on Anthropic-family routes:

- Moving a session onto Fable 5.1 (from Opus 5, Sonnet 5, Opus 4.8, Fable 5)
  dropped readable reasoning client-side; the replay contract now preserves it
  while leaving Fable 5.1 still drops.
- The per-turn runtime-context carrier was injected transiently after the
  active user turn, stripped on the next request, relocated inside tool loops,
  and removed by the context-engine assembly. It is now persisted right after
  its user turn and replayed in place; inline inbound metadata stays in place
  too, and consecutive user turns are no longer merged at load for the
  Messages API because the merged form lost the second turn's timestamp stamp.
- Direct API-key requests with adaptive thinking send the
  thinking-binding-controls beta with prefix_mismatch_behavior=drop_block, so
  a residual mismatch degrades to a server-side unbilled drop with a warning
  listing the dropped paths instead of a 400, a duplicate request, and a
  transcript-wide thinking wipe. OAuth, proxies, Bedrock, Vertex, and Foundry
  keep the existing strip-and-retry recovery.

Live-verified against api.anthropic.com: nine-request Fable/Opus/Fable session
with tool loops and carriers reports input_transformations: [] on every
request with four retained thinking blocks; a /think change on the direct API
yields a logged server-side drop and no retry.

* fix(anthropic): limit the preserved-thinking replay target to Fable 5.1

Mythos 5.1 is not registered in the bundled catalog and has no cross-model
replay proof, so unregistered Mythos targets keep the existing drop path.

(cherry picked from commit 30837ae)

* feat(openai): support GPT-6 Astra (#137550)

* feat(openai): support GPT-6 Astra

* fix(models): preserve declared pricing tiers during catalog refresh

(cherry picked from commit eb72093)

* fix(openai): require discovery before offering Astra for OAuth (#137561)

(cherry picked from commit 8b1add5)

* fix(diagnostics-prometheus): reject unauthorized metric scrapes (#140903)

* fix(diagnostics-prometheus): require operator.read for metric scrapes

The Prometheus scrape route registers under the trusted-operator runtime
scope surface, so the Gateway authenticates the caller and applies its
named-role scope ceiling before dispatch. The handler never consulted
those scopes, so an authenticated identity whose role grants no operator
scopes still received the full diagnostics document with 200, while the
same caller was correctly refused on equivalent read operations.

Check the runtime request scopes inside the handler and fail closed with
403 "missing scope: operator.read" unless the caller holds operator.read,
operator.write, or operator.admin, mirroring the Gateway read implication
set. The guard runs before rendering so HEAD probes cannot disclose the
document size either.

* test(diagnostics-prometheus): prove role-limited scrape denial

(cherry picked from commit 0c9330b)

* fix(discord): enforce sender media policy on guild asset uploads (#140334)

The Discord emoji-upload, sticker-upload, and event-create branches dropped
the sender-scoped media access options before dispatching the action, so the
guild runtime loaded the requested host-local path with only a byte limit. A
sender permitted to run those actions could therefore place bytes from a file
outside their allowed media roots into an outbound Discord emoji, sticker, or
event-cover request.

Forward the resolved action options from all three branches, carry
mediaAccess/mediaLocalRoots/mediaReadFile through the guild runtime, and load
upload sources through buildOutboundMediaLoadOptions like every other outbound
Discord media path. Adds regression coverage that a source outside the sender
roots is rejected before any request is issued, with an in-roots control.

(cherry picked from commit e5e7764)

* fix(discord): preserve realtime speaker and playback ownership (#137433)

* fix(discord): preserve realtime speaker and playback ownership

Bind provider connections to one Discord principal so delayed transcripts
and native consultations cannot inherit another speaker's authority.
Keep the shared agent route and serialize response-owned audio on one
room player, preserving continuations and recovery after playback gaps.

Admit host-requested responses before dispatch and map Google Live turn
completion to canonical terminal outcomes so queued speech can finish.

Closes #137349
Related: #136982, #123243
Follow-up: #137417

* test(discord): preserve room capture across speaker recovery

(cherry picked from commit 85d510c)

* fix(doctor): preserve enabled skills during automatic updates (#138730)

Use runtime-repair approval for optional skill disabling. Keep standalone explicit repair and required config migrations unchanged.

(cherry picked from commit acc9a65)

* fix: generated images disappear after failed tool calls (#131226)

## What Problem This Solves

WebChat drops generated media when a later tool failure is the turn's only reply payload.

## Root cause

The embedded-run terminal projection assigned successful tool media to the first non-reasoning payload. A later error warning could become that owner. Gateway error projection then discarded the attached media.

## Fix

- Attach tool media only to a successful, non-reasoning reply.
- Emit a separate media-only payload when the turn has no successful reply.
- Preserve the newer host-owned and automatic-delivery media paths from current `main`.
- Keep regression coverage at the payload owner and physical-delivery boundaries.
- Remove the mocked browser test that manually inserted its expected result.

## Evidence

- Baseline: current `main` at `8544aed05a5dbffb871483be781f71351203319e`.
- Real path: branch-built Control UI → real Gateway → mock OpenAI Responses provider → successful image tool → later failing tool → terminal WebChat event.
- Red: current `main` rendered zero generated images.
- Green: `d2a10d40c633bfe796ad4ab19222aa831184a327` rendered one generated image.
- Anti-cheat: the proof recorded `image-success` before `later-failure` and verified that Chromium loaded the exact Gateway-served asset from the branch build.

## Validation

- Focused unit and integration tests: 19 passed across 2 Vitest shards.
- Real Gateway and built Control UI proof: passed on current `main` and the candidate head with opposite image assertions.
- Targeted format, Oxlint, conflict-marker, max-lines, assertion-safety, and diff checks passed.
- Type checks run in continuous integration because repository policy forbids them on this host.

Production change: `+3/-3`, net zero. Test change: `+23/-1`, net `+22`.

Co-authored-by: A28Hui <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 88be1b8)

* fix(matrix): refresh verification status before reporting device trust (#136226)

* fix(matrix): refresh verification status before reporting device trust

Refresh own-device keys after crypto preparation and before the authoritative trust read. Keep the missing-device preflight and use the Matrix SDK’s existing query contract.

* test(slack): remove core-coupled threading duplicate

---------

Co-authored-by: Dallin Romney <[email protected]>
(cherry picked from commit a812054)

* chore(release): prepare extended-stable 2026.8.33

* fix(release): integrate model and Discord security backports

* docs(release): clarify extended-stable workflow baseline

* fix(release): complete stable-line backport integration

* fix(ios): restore dependency resolution with WebRTC 152 (#134942)

* fix(release): repair frozen validation inputs

* fix(discord): stop error replies after voice consult cancellation (#135380)

* fix(discord): stop error replies after voice consult cancellation

Treat host-cancelled Discord realtime consults as terminal cancellation, preserve late-call dedupe, and wait for every native delivery before returning forced playback ownership. Timeouts and genuine errors retain their normal handling.

Closes #135340. Related phone cancellation helper: #134924.

* test(acp): run CLI lifecycle checks against prepared runtime

* test(cli): cover selective runtime build admission

* test(ci): account for ACP runtime preparation

* fix(release): complete Discord cancellation backport

* test(release): keep candidate fixtures current

* test(update): isolate frozen release version

---------

Co-authored-by: tharuntejmeta <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: dclosefuturex <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: Pavan Kumar Gondhi <[email protected]>
Co-authored-by: Jason (Json) <[email protected]>
Co-authored-by: CGlashu <[email protected]>
Co-authored-by: A28Hui <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord docs Improvements or additions to documentation extensions: openai maintainer Maintainer-authored PR merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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.

Discord voice acknowledges ignored speech and can stall later answers

1 participant