Skip to content

fix(discord): support continuous GPT Live conversations - #146289

Merged
steipete merged 5 commits into
mainfrom
codex/discord-gpt-live-voice
Sep 12, 2026
Merged

steipete merged 5 commits into
mainfrom
codex/discord-gpt-live-voice

Conversation

@steipete

@steipete steipete commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Discord users could not use the intended GPT Live voice route and could lose speech after interruption, miss short replies, or have pauses removed from queued replies. Disabling Discord's local interruption also incorrectly stopped microphone admission during playback, preventing Live from hearing spoken interruptions.

Why This Change Was Made

Discord now uses the shared Gateway-owned GPT Live bridge with the originating speaker's agent identity, tool policy, and cancellation signal. Continuous audio has its own playback lifecycle, preserves buffered pauses, and releases idle transport silence. WebSocket and WebRTC share a paced input clock. Live owns interruption; microphone admission remains open while Discord avoids local cancellation. Existing response-based providers retain their turn and wake-name policies. Unpinned Discord configurations retain the selected provider default. Live-policy freshness remains attached to admitted context through asynchronous roster enrichment and is checked before agent dispatch; transport-only RTP events do not extend speaker retention.

User Impact

Discord can use the Codex GPT Live/Cove route through ChatGPT OAuth, or the public GPT Live API with its supported voices and a Platform key. Short replies play promptly and subsequent speech remains audible after provider clears. Explicit host wake-name or forced-consult settings that Live cannot honor receive a clear startup error. Each speaker retains a separate realtime connection and shares the routed OpenClaw agent conversation.

Evidence

  • Reproduced the playback, pause-loss, delegation-wiring, and microphone-admission regressions before repair. Queued audio that incorrectly shrank from 700 ms to 200 ms now preserves its duration.
  • An 840-test broader voice/provider run passed, followed by focused receive, end-to-end, codec, pacing, and lifecycle reruns on the final changes. Both microphone-during-playback cases pass, with and without recording, without a local interruption request.
  • A synthetic live gpt-live-1 API test passed: sustained non-silent output continued more than one second after finite microphone input ended. The probe received 28,800 bytes of qualifying reply audio and closed cleanly.
  • The original implementation passed the full build, relevant changed-file checks, core/plugin typechecks, lint, and docs link audit.
  • Follow-up review fixes passed 207 focused tests and a fresh independent review through P2. These include real policy/authorization/roster lookup with access revoked while lookup is suspended (no agent dispatch), the allowed control with fresh roster context, fresh/existing unpinned model selection, and silent-RTP speaker reclamation. Follow-up static checks passed; exact-head hosted CI remains enforced by the native prepare/merge workflow. The unchanged admission cases also passed after moving into their dedicated test file.
  • Final authority proof runs runtime.agent.runCommandFromIngress through the actual agent loop and tools with a synthetic local Responses endpoint. All four cells pass: owner session-label mutation plus workspace write, guest rejection of the owner-only mutation with ordinary write retained, toolsAllow-restricted owner rejection, and cancellation of both the agent and HTTP request within five seconds with no tool effects. The existing Discord admission proof covers the upstream real policy and roster boundary, including revocation during suspended lookup. No production test seam was added.
  • Unsupported explicit Live policies fail through the voice manager join entry point with an actionable configuration error. Removing the unsupported settings permits the native Live join/delegation path; selecting GA realtime retains host wake-name/consult behavior. Unpinned fresh and existing configurations retain the prior provider default. This is an intentional explicit-configuration decision, documented in the Discord setup guide; it does not alter stored configuration.
  • Hosted CI exposed a deadline race in the queued-audio regression test: the one-second poll included asynchronous Opus startup plus 700 ms of playback. The test now synchronizes on the real final playback mark under its existing test deadline, preserves exact 100/700 ms PCM and Opus offsets, and cleans up on timeout. Production code is unchanged by this CI repair.
  • No real Discord meeting was joined. Voice transport/playback and participant authorization were tested at their isolated boundaries; account entitlement for a particular voice remains provider-controlled.

Related: #138441, which independently addresses overlapping OAuth routing and a separate cold-start auto-join issue. The auto-join change is outside this PR.

Reuse the Gateway-owned GPT Live bridge for Discord voice, preserve speaker-bound agent delegation, and let Live own interruption while microphone input remains admitted during playback. Pace input continuously, play short replies, and preserve queued speech pauses. Document model-specific voice routes and unsupported host turn policies.
@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord extensions: openai size: XL maintainer Maintainer-authored PR labels Sep 12, 2026
@steipete
steipete marked this pull request as ready for review September 12, 2026 18:24
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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. labels Sep 12, 2026
@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 12, 2026, 3:52 PM ET / 19:52 UTC (Revision 6).

ClawSweeper review

What this changes

Discord voice reuses the shared GPT-Live bridges, preserves continuous speech and microphone input during playback, and carries each speaker’s permissions and cancellation into delegated agent work.

Merge readiness

⛔ Blocked before merge - 2 items remain

The PR remains useful: current main lacks the Discord bridge wiring and continuous-playback repairs. All three prior findings are addressed, and the latest test-only change preserves the regression assertions. No new blocking defect was found.

Priority: P2
Reviewed head: 4607798e1a489a396e9e5bcb090bd0df9bdc8bbc

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent repair with meaningful production-boundary evidence, resolved prior findings, and an explicitly documented compatibility tradeoff.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured body reports a live public Gateway-bridge run with sustained non-silent output after microphone input ended, plus production agent-loop effects for owner, guest, restricted owner, and cancellation. Inspected Discord admission coverage rejects revocation during roster lookup; a real Discord meeting is expressly unclaimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body reports a live public Gateway-bridge run with sustained non-silent output after microphone input ended, plus production agent-loop effects for owner, guest, restricted owner, and cancellation. Inspected Discord admission coverage rejects revocation during roster lookup; a real Discord meeting is expressly unclaimed.
Evidence reviewed 11 items Prior findings resolved: The speaker session requests the existing provider default, excludes output_audio.rtp from activity refresh, and permits continuous microphone admission independently of local barge-in. Delegation carries policy freshness through roster enrichment and checks it before agent dispatch.
Latest revision preserves behavioral assertions: GitHub’s exact-head commit patch changes only the queued/backlogged playback test: completion follows the final playback mark, errors reject the wait, cleanup remains registered, and the exact 100 ms and 700 ms PCM/Opus assertions remain. Local comparison encountered an unavailable historical blob; the GitHub commit patch supplied the bounded comparison.
Authority proof reaches final effects: The captured PR body reports four passing production-path cells. The inspected harness calls runCommandFromIngress through the actual agent loop against a local Responses endpoint, checking session-label and workspace effects for owner, guest, restricted owner, and cancellation. The separate Discord admission test checks revocation during suspended roster lookup before dispatch.
Findings None None.
Security None None.

How this fits together

Discord voice admits microphone audio from authorized participants into separate realtime provider connections. Provider audio shares the room’s playback queue, while delegated tasks enter the routed OpenClaw agent conversation with the originating speaker’s permissions.

flowchart LR
  A[Discord microphone audio] --> B[Speaker admission]
  B --> C[Per-speaker voice bridge]
  C --> D[Continuous room playback]
  C --> E[Fresh permission check]
  E --> F[Routed agent and tools]
  F --> C
Loading

Before merge

  • Resolve merge risk (P1) - Existing explicitly pinned Live setups using requireWakeName=true or consultPolicy=always will stop joining until operators remove those settings or select a host-controlled model; this compatibility change is intentional and documented.
  • Resolve merge risk (P1) - The supplied evidence covers production boundaries and a live public API exchange, but not a real Discord meeting or account-specific OAuth voice entitlement.
Agent review details

Security

None.

PR surface

Source +275, Tests +960, Docs +119. Total +1354 across 44 files.

View PR surface stats
Area Files Added Removed Net
Source 22 442 167 +275
Tests 18 978 18 +960
Docs 4 169 50 +119
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 44 1589 235 +1354

Review metrics

Metric Value Why it matters
Production versus test growth Production +275 net lines; tests and test support +960 net lines Production growth supports shared pacing, continuous playback, and delegation wiring, with most added code devoted to regression and authority coverage.
Explicit policy restrictions 2 existing settings rejected for provider-owned Live The compatibility impact is limited to explicit wake-name enforcement and forced-consult settings.

Merge-risk options

Maintainer options:

  1. Retain the documented Live policy restriction (recommended)
    Accept the maintainer-recorded compatibility choice while keeping unpinned defaults and the actionable model-or-policy recovery guidance.

Technical review

Best possible solution:

Keep the shared bridge and capability-based playback design, preserving unpinned defaults and the explicitly accepted, documented recovery for unsupported Live policies.

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

Yes, source inspection identifies the missing Discord relay wiring and response-based playback assumptions; the supplied regression and live results support those paths. This read-only review did not execute tests.

Is this the best way to solve the issue?

Yes, reusing the existing Gateway bridges and expressing continuous audio through optional provider capabilities avoids a competing transport owner while preserving response-based defaults.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a1e5797a4268.

Labels

Label justifications:

  • P2: This repairs opt-in Discord realtime voice with a bounded user impact.
  • merge-risk: 🚨 compatibility: Explicit Live configurations requesting unsupported host turn policies now fail join with documented recovery instructions.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body reports a live public Gateway-bridge run with sustained non-silent output after microphone input ended, plus production agent-loop effects for owner, guest, restricted owner, and cancellation. Inspected Discord admission coverage rejects revocation during roster lookup; a real Discord meeting is expressly unclaimed.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body reports a live public Gateway-bridge run with sustained non-silent output after microphone input ended, plus production agent-loop effects for owner, guest, restricted owner, and cancellation. Inspected Discord admission coverage rejects revocation during roster lookup; a real Discord meeting is expressly unclaimed.

Evidence

What I checked:

  • Prior findings resolved: The speaker session requests the existing provider default, excludes output_audio.rtp from activity refresh, and permits continuous microphone admission independently of local barge-in. Delegation carries policy freshness through roster enrichment and checks it before agent dispatch. (extensions/discord/src/voice/realtime-speaker-session.ts:242, 4607798e1a48)
  • Latest revision preserves behavioral assertions: GitHub’s exact-head commit patch changes only the queued/backlogged playback test: completion follows the final playback mark, errors reject the wait, cleanup remains registered, and the exact 100 ms and 700 ms PCM/Opus assertions remain. Local comparison encountered an unavailable historical blob; the GitHub commit patch supplied the bounded comparison. (extensions/discord/src/voice/realtime-playback-pcm.integration.test.ts:103, 4607798e1a48)
  • Authority proof reaches final effects: The captured PR body reports four passing production-path cells. The inspected harness calls runCommandFromIngress through the actual agent loop against a local Responses endpoint, checking session-label and workspace effects for owner, guest, restricted owner, and cancellation. The separate Discord admission test checks revocation during suspended roster lookup before dispatch. (src/plugins/runtime/runtime-agent.ingress.integration.test.ts:228, 4607798e1a48)
  • Recorded live audio result: The supplied body records 28,800 bytes of qualifying reply audio more than one second after finite microphone input ended, followed by clean closure. The inspected live scenario exercises OpenAIQuicksilverGatewayBridge with the public API and measures non-silent output; it does not claim a real Discord meeting. (extensions/openai/realtime-quicksilver-gateway-bridge.live.test.ts:14, 4607798e1a48)
  • Explicit compatibility decision: The captured maintainer-authored body explicitly accepts rejecting unsupported Live policies and records join-entrypoint coverage, supported recovery, and fresh/existing unpinned configuration checks. Documentation explains removing requireWakeName=true or consultPolicy=always, or selecting a host-controlled model. Stored configuration is not rewritten. Public docs: docs/channels/discord/voice-channels.md. (docs/channels/discord/voice-channels.md:121, 4607798e1a48)
  • Current-main necessity: The inspected current-main resolver call lacks gateway-relay selection and native delegation wiring and still derives policy from provider-wide capabilities. This does not establish an already-implemented close. (extensions/discord/src/voice/realtime-speaker-session.ts:275, a1e5797a4268)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • zenglingbiao: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (5 earlier review cycles)
  • reviewed 2026-09-12T18:23:47.629Z sha 36c9a70 :: needs real behavior proof before merge. :: [P1] [P1] Preserve the existing model for unpinned Discord bidi sessions | [P2] [P2] Exclude silent RTP events from speaker activity | [P1] [P1] Revalidate delegation admission after roster enrichment
  • reviewed 2026-09-12T18:31:04.578Z sha 36c9a70 :: needs real behavior proof before merge. :: [P1] [P1] Preserve the existing model for unpinned Discord bidi sessions | [P1] [P1] Revalidate delegation admission after roster enrichment | [P2] [P2] Exclude silent RTP events from speaker activity
  • reviewed 2026-09-12T18:54:29.273Z sha 3150bcc :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-12T19:09:58.737Z sha f8fbdae :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-12T19:28:50.582Z sha ff62802 :: blocked before merge. :: none

Keep unpinned realtime configurations on their provider default, ignore silent RTP for speaker retention, and retain live-policy freshness through roster enrichment and agent dispatch. Cover policy revocation during the real participant lookup path, fresh and existing model defaults, and idle speaker reclamation.
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Sep 12, 2026
Keep the unchanged native delegation admission cases in a focused suite so the voice receive tests remain within the repository file-size limit.
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The three findings on 36c9a7065265 are addressed in 3150bccd3935; the final test-only commit moves the unchanged admission cases into a focused suite to satisfy the file-size limit.

  • Unpinned Discord sessions now use the selected provider's existing default. Fresh and existing configurations are tested through the real OpenAI resolver; explicit Live selection still works.
  • output_audio.rtp no longer refreshes speaker activity. The reclamation regression keeps silent RTP events arriving for all eight speakers and proves that a new speaker can connect.
  • The live policy's isCurrent guard is retained through participant enrichment and checked after the awaited roster lookup and immediately before agent dispatch. The fresh admitted context is used for the delegation.

voice-delegation-admission.test.ts enters through the native delegation callback and uses the real live-policy reader, authorization resolver, and participant lookup. It suspends the roster lookup, revokes access, and verifies rejection with zero calls to the agent ingress boundary. The allowed control verifies one dispatch with fresh roster context. The admission and roster resolvers are not mocked. These cases failed on the original code before repair.

The follow-up suites passed 207 tests. After extracting the unchanged regression, both receive/admission files passed all 52 tests, extension test typechecking, targeted lint, and a fresh independent review. The original continuous-audio live API evidence remains valid; no real Discord meeting is claimed.

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 12, 2026
@steipete
steipete merged commit a0cd0b8 into main Sep 12, 2026
316 of 318 checks passed
@steipete
steipete deleted the codex/discord-gpt-live-voice branch September 12, 2026 20:17
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 13, 2026
* feat(voice): unify Live sessions across calls and meetings

Resolve provider capabilities and interruption policy through the shared realtime voice owner. Keep meeting input isolated from virtual-microphone output, reuse native delegation for meetings and Voice Call, and preserve explicit Stop across browser and Apple relay clients.\n\nValidated with real Live API and synthetic Chromium/WebRTC proof, focused regressions, changed-file checks, and independent review. Related to #146289.

* test(voice): align capture fixtures and validation gates

Model browser audio capture in the shared meeting RPC fixtures so startup
failure tests reach the provider and verify capture cleanup. Preserve the
same relay startup behavior while simplifying duplicate lifecycle branches.

Rebalance the pre-existing 702-root platform test graph by moving security
tests beside sandbox/tool tests; keep coverage, graph counts, and limits.

* fix(meetings): preserve configured input commands

Keep explicitly configured capture/filter/mixer output as provider input on
local Chrome and paired nodes, preserving the v2026.9.4 contract. Generated
input and output-only overrides continue to use managed browser capture.

Retain Live's isolation guard and explain how to remove an input override
when selecting Live. Prove the actual PCM paths through both meeting engines
and transports, and document the preserved configuration behavior.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 13, 2026
)

* fix(discord): support continuous GPT Live conversations

Reuse the Gateway-owned GPT Live bridge for Discord voice, preserve speaker-bound agent delegation, and let Live own interruption while microphone input remains admitted during playback. Pace input continuously, play short replies, and preserve queued speech pauses. Document model-specific voice routes and unsupported host turn policies.

* fix(discord): preserve live voice admission and defaults

Keep unpinned realtime configurations on their provider default, ignore silent RTP for speaker retention, and retain live-policy freshness through roster enrichment and agent dispatch. Cover policy revocation during the real participant lookup path, fresh and existing model defaults, and idle speaker reclamation.

* test(discord): isolate delegation admission coverage

Keep the unchanged native delegation admission cases in a focused suite so the voice receive tests remain within the repository file-size limit.

* test(voice): prove delegated agent authority and cancellation

* test(discord): await continuous playback completion
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 13, 2026
* feat(voice): unify Live sessions across calls and meetings

Resolve provider capabilities and interruption policy through the shared realtime voice owner. Keep meeting input isolated from virtual-microphone output, reuse native delegation for meetings and Voice Call, and preserve explicit Stop across browser and Apple relay clients.\n\nValidated with real Live API and synthetic Chromium/WebRTC proof, focused regressions, changed-file checks, and independent review. Related to openclaw#146289.

* test(voice): align capture fixtures and validation gates

Model browser audio capture in the shared meeting RPC fixtures so startup
failure tests reach the provider and verify capture cleanup. Preserve the
same relay startup behavior while simplifying duplicate lifecycle branches.

Rebalance the pre-existing 702-root platform test graph by moving security
tests beside sandbox/tool tests; keep coverage, graph counts, and limits.

* fix(meetings): preserve configured input commands

Keep explicitly configured capture/filter/mixer output as provider input on
local Chrome and paired nodes, preserving the v2026.9.4 contract. Generated
input and output-only overrides continue to use managed browser capture.

Retain Live's isolation guard and explain how to remove an input override
when selecting Live. Prove the actual PCM paths through both meeting engines
and transports, and document the preserved configuration behavior.
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: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

1 participant