Skip to content

fix(discord): preserve realtime voice speaker context [AI] - #123243

Merged
jacobtomlinson merged 5 commits into
openclaw:mainfrom
mmaps:fix/fix-945
Aug 19, 2026
Merged

jacobtomlinson merged 5 commits into
openclaw:mainfrom
mmaps:fix/fix-945

Conversation

@mmaps

@mmaps mmaps commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where concurrent Discord realtime voice transcripts could carry the wrong speaker ownership context when an active-run control check completed out of order.

Why This Change Was Made

The fallback talkback path now claims the Discord speaker context before awaiting active-run control, so each final transcript keeps the speaker identity from its original audio turn. The realtime tool-handoff path keeps its existing forced-consult behavior.

User Impact

Discord voice users get consistent speaker attribution during rapid overlapping final transcripts. Owner-only context is not carried over from a later speaker to an earlier utterance.

Evidence

  • node scripts/run-vitest.mjs extensions/discord/src/voice/realtime-turns.test.ts -t "keeps concurrent final transcripts bound to their original speakers"
  • node scripts/run-vitest.mjs extensions/discord/src/voice/realtime-turns.test.ts
  • pnpm format:check --no-error-on-unmatched-pattern -- extensions/discord/src/voice/realtime-consults.ts extensions/discord/src/voice/realtime-turns.test.ts
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/discord/src/voice/realtime-consults.ts extensions/discord/src/voice/realtime-turns.test.ts

Live Discord Voice Proof

Added after ClawSweeper's current-head real-setup and fault-injection proof request.

Current PR head under re-review: 50145939ad4c3b3a9a1ae4b2fba7ebe2f9febc55
Date: 2026-08-13 UTC

Local build and focused regression coverage:

  • pnpm build completed on this branch at current head before the live Discord proof run.
  • node --import tsx scripts/test-projects.mts extensions/discord/src/voice/realtime-turns.test.ts at current head 50145939ad4c -> 1 file passed, 41 tests passed.
  • git status --short was clean for the PR source files after proof extraction; only ignored local proof helpers/build artifacts under .artifacts/ and dist/ were used for the live run.

Live setup used an isolated local gateway config/state under .artifacts/auto-pr-945-live-discord/ with a real Discord app/bot, a real test guild voice channel, and OpenAI realtime. Private Discord guild/channel/user IDs are redacted from this PR text.

Fault-injection note: the live gateway used a local ignored built-output shim to delay only the first active-run control check by 30 seconds and log the delay/release. The shim did not change the PR source diff or the speaker-context capture/talkback code under review; it only made the requested delayed-control interleaving deterministic in a real Discord voice session.

Live config/run header:

Starting OpenClaw live Discord proof gateway
head=50145939ad4c3b3a9a1ae4b2fba7ebe2f9febc55
controlDelayMs=30000
2026-08-13T23:45:14.755+00:00 voice: realtime bridge ready mode=agent-proxy provider=openai model=gpt-realtime-2.1 voice=cedar

Redacted live Discord delayed non-owner / owner overlap:

2026-08-13T23:45:33.911+00:00 voice: realtime speaker turn opened guild=<test-guild> channel=<test-voice-channel> user=<non-owner-user> speaker=<non-owner-speaker> owner=false pendingTurns=1
2026-08-13T23:45:38.355+00:00 voice: realtime speaker turn closed guild=<test-guild> channel=<test-voice-channel> user=<non-owner-user> speaker=<non-owner-speaker> owner=false hasAudio=true chunks=118 elapsedMs=4464 interruptedPlayback=false
2026-08-13T23:45:38.819+00:00 voice: realtime user transcript (31 chars): Pause. Cancel that guest proof.
2026-08-13T23:45:38.821Z discord voice proof fault injection: delaying first active-run control check ms=30000 text="Pause. Cancel that guest proof."

2026-08-13T23:45:39.069+00:00 voice: realtime speaker turn opened guild=<test-guild> channel=<test-voice-channel> user=<owner-user> speaker=<owner-speaker> owner=true pendingTurns=1
2026-08-13T23:45:44.956+00:00 voice: realtime speaker turn closed guild=<test-guild> channel=<test-voice-channel> user=<owner-user> speaker=<owner-speaker> owner=true hasAudio=true chunks=180 elapsedMs=5891 interruptedPlayback=false
2026-08-13T23:45:45.562+00:00 voice: realtime user transcript (32 chars): OpenClaw, stop that owner proof.
2026-08-13T23:45:50.564+00:00 realtime agent consult: chars=32 queued=0
2026-08-13T23:45:50.567+00:00 voice: agent turn start guild=<test-guild> channel=<test-voice-channel> voiceSession=agent:main:discord:channel:<test-voice-channel> supervisorSession=agent:main:discord:channel:<test-text-channel> agent=main user=<owner-user> speaker=<owner-speaker> owner=true model=openai/gpt-5.6-sol ...
2026-08-13T23:46:00.723+00:00 voice: agent turn answer (31 chars) guild=<test-guild> channel=<test-voice-channel> agent=main: What would you like me to stop?

2026-08-13T23:46:08.822Z discord voice proof fault injection: releasing first active-run control check
2026-08-13T23:46:13.826+00:00 realtime agent consult: chars=31 queued=0
2026-08-13T23:46:13.828+00:00 voice: agent turn start guild=<test-guild> channel=<test-voice-channel> voiceSession=agent:main:discord:channel:<test-voice-channel> supervisorSession=agent:main:discord:channel:<test-text-channel> agent=main user=<non-owner-user> speaker=<non-owner-speaker> owner=false model=openai/gpt-5.6-sol ...
2026-08-13T23:46:14.202+00:00 tool policy removed 12 tool(s) via gateway sender owner-only tools.deny: automations, computer, conversations_list, conversations_send, conversations_turn, gateway, mobile_ui, nodes, openclaw, portal, sessions, terminal
2026-08-13T23:46:18.643+00:00 voice: agent turn answer (42 chars) guild=<test-guild> channel=<test-voice-channel> agent=main: What would you like me to pause or cancel?

This proves the changed boundary in a real Discord session: the non-owner control-classified transcript was accepted first and held for 30 seconds; the owner fallback talkback completed while that first control check was still delayed; when the delayed non-owner fallback resumed, the downstream agent turn still carried owner=false and owner-only tools were denied for that non-owner turn.

Agent session persistence from the isolated state DB also shows the two user turns entered the agent session under their original speaker labels, in the same out-of-order completion order:

seq=7 role=user
Voice transcript from speaker "<owner-speaker>":
OpenClaw, stop that owner proof.

seq=9 role=user
Voice transcript from speaker "<non-owner-speaker>":
Pause. Cancel that guest proof.

AI-assisted: yes.

@clawsweeper

clawsweeper Bot commented Aug 13, 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 labels Aug 13, 2026
@mmaps

mmaps commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Behavior Proof

Head: d97a155e052274837b8da4c3808a9745e564ab06

Entry point and adapter: extensions/discord/src/voice/realtime-consults.ts:211 is exercised through extensions/discord/src/voice/realtime-turns.test.ts:143 via createJoinedAgentProxyFixture. That local production adapter drives the Discord voice manager bridge callbacks through the fallback talkback runtime path changed in this PR.

Command:

timeout 300s node scripts/run-vitest.mjs extensions/discord/src/voice/realtime-turns.test.ts -t "keeps concurrent final transcripts bound to their original speakers"

Result: pass at d97a155e0522.

Artifacts:

  • .artifacts/auto-pr-945/behavior-proof-vitest.log
  • .artifacts/auto-pr-945/behavior-proof.json

Fixed protected security boundary path:
Alice starts a final voice transcript as a non-owner and the active-run control action is deliberately delayed. Bob then starts a final voice transcript as the owner and reaches fallback talkback first. After Alice's delayed control action falls through, the owner-authorized tool sink is not called for Alice: the recorded Alice call keeps senderIsOwner=false, so owner context is not exposed or leaked to the non-owner transcript.

Protected source and sink result:
The protected source is the pending Discord realtime speaker context. The protected sink is the fallback talkback agentCommand call that carries senderIsOwner. The proof shows the non-owner source did not reach the owner sink state, and the sensitive owner flag was not persisted or exposed on Alice's call.

Positive benign control succeeds:
The same run verifies intended behavior still works for an authorized owner turn: Bob's transcript reaches the fallback talkback tool request path with senderIsOwner=true while Alice's earlier non-owner control action is still pending.

Live-environment gap:
extensions/discord/package.json exposes no Discord realtime voice live command. The root package has broader live and docker lanes, but no issue-specific credentialed Discord voice harness for this overlapping-transcript path. This proof is current-head local production-adapter evidence, not a live Discord client recording.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. 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 Aug 13, 2026
@clawsweeper

clawsweeper Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 3:26 PM ET / 19:26 UTC.

ClawSweeper review

What this changes

The PR captures each Discord realtime fallback transcript’s speaker context before an asynchronous control check, preserving the original owner status during overlapping voice turns.

Regression provenance

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

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for merge review: current main still consumes FIFO speaker context after an awaited control check, which can swap owner state between overlapping voice transcripts; the branch moves that claim before the await and has focused regression and live-session evidence.

Priority: P0
Reviewed head: 1294b7a80cf11299e5d4ac707ea20d681a48d933

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is focused, source-proven, and supported by both a real delayed-control session and boundary-level regression coverage.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): A redacted live Discord voice trace demonstrates delayed non-owner control, owner completion, then resumed non-owner fallback with owner-only tools denied.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): A redacted live Discord voice trace demonstrates delayed non-owner control, owner completion, then resumed non-owner fallback with owner-only tools denied.
Evidence reviewed 8 items Current-main defect: Current main awaits the control check before consuming the next FIFO speaker context for fallback talkback, leaving overlapping transcript completions able to select another speaker’s context.
Fix at the owner boundary: The PR snapshots fallback context at lines 216-222 before awaiting control, while leaving the realtime-agent-handoff branch on its existing prepared-consult path.
Caller and authorization sink: Final user transcripts are intentionally dispatched asynchronously, and the captured senderIsOwner value reaches agentCommandFromIngress, which governs agent tool policy.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw --help

Result: PASS (completed)

runner@runnervmzvulz:/tmp/clawsweeper-live-proof-123243-QiHdlD/target$ pnpm openclaw --help
$ node scripts/run-node.mjs --help
pnpm openclaw --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 400.66 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 78.62 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.5s
node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

[tsdown-build] invocation 2/2 finished in 11.5s
[plugin-control-plane-loads] verified 36 built modules with native require and checked doctor closures
runtime-postbuild: 10 phases completed in 3410ms (slowest: built plugin control-plane loads 2681ms)

OpenClaw 2026.8.1 (1294b7a) — All your chats, one OpenClaw.

Usage: openclaw [options] [command]

Options:
  --container ‹name›   Run the CLI inside a running Podman/Docker container named ‹name› (default: env OPENCLAW_CONTAINER)
  --dev                Dev profile: isolate state under ~/.openclaw-dev, default gateway port 19001, and shift derived ports (browser/canvas)
  -h, --help           Display help for command
  --log-level ‹level›  Global log level override for file + console (silent|fatal|error|w
… output truncated …

Assertions:

  • PASS expect_output: Usage: openclaw

How this fits together

Discord realtime voice receives audio turns and final transcripts, then either controls an active run or sends a fallback request to the agent. The speaker context flowing into that agent request determines user identity and owner-only tool policy.

flowchart LR
  A[Discord speaker audio] --> B[Realtime transcript]
  B --> C[Speaker context queue]
  C --> D[Active-run control check]
  D --> E[Fallback talkback]
  E --> F[Agent request]
  F --> G[Owner-only tool policy]
  G --> H[Voice reply]
Loading

Before merge

  • Resolve merge risk (P1) - This is an authorization-boundary change: future refactors must preserve claim-before-await ordering so a later transcript cannot inherit owner-only access.
  • Complete next step (P2) - No mechanical repair remains; this PR is ready for normal maintainer merge review of the authorization-boundary change.
Agent review details

Security

None.

PR surface

Source +4, Tests +51. Total +55 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 10 6 +4
Tests 1 51 0 +51
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 61 6 +55

Review metrics

Metric Value Why it matters
Production vs test LOC production +4, tests +51 The small production increase establishes the pre-await ownership capture, with focused coverage for the concurrent ordering invariant.

Merge-risk options

Maintainer options:

  1. Land the transcript-bound authorization fix (recommended)
    Merge the focused pre-await context capture, which preserves the existing handoff behavior and prevents owner-state swaps in fallback talkback.

Technical review

Best possible solution:

Merge the focused pre-await context capture and retain the concurrent guest/owner regression as the ownership-boundary contract.

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

Yes, from source: two final callbacks run independently, while current main consumes the FIFO speaker queue only after an awaited control check; the supplied delayed-control scenario deterministically exposes the swap.

Is this the best way to solve the issue?

Yes: the immediate fallback handoff owns consumption of speaker context, and capturing it before the sole intervening await fixes the race without changing native realtime handoff behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P0: The current-main race can attach owner authorization to a non-owner Discord voice transcript.
  • merge-risk: 🚨 security-boundary: The patch carries speaker-derived ownership through an asynchronous boundary into agent tool policy.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): A redacted live Discord voice trace demonstrates delayed non-owner control, owner completion, then resumed non-owner fallback with owner-only tools denied.
  • proof: sufficient: Contributor real behavior proof is sufficient. A redacted live Discord voice trace demonstrates delayed non-owner control, owner completion, then resumed non-owner fallback with owner-only tools denied.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Authored the recent realtime voice policy refactor containing the pre-fix fallback ordering. (role: recent area contributor; confidence: medium; commits: df4e6666c6ba; files: extensions/discord/src/voice/realtime-consults.ts, extensions/discord/src/voice/realtime-turns.ts, src/talk/agent-talkback-runtime.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 (4 earlier review cycles)
  • reviewed 2026-08-13T20:13:37.492Z sha ee8c486 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-13T23:18:16.655Z sha 5014593 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-13T23:24:22.698Z sha 5014593 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-14T00:12:12.832Z sha 5014593 :: needs maintainer review before merge. :: none

@mmaps

mmaps commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Behavior Proof

Head: ee8c486b80bb5fdb37252c88940454a43c32c7d5

Entry point and adapter: extensions/discord/src/voice/realtime-consults.ts:211 is exercised through extensions/discord/src/voice/realtime-turns.test.ts:143 via createJoinedAgentProxyFixture. That local production adapter drives the Discord voice manager bridge callbacks through the fallback talkback runtime path changed in this PR.

Command:

timeout 300s node scripts/run-vitest.mjs extensions/discord/src/voice/realtime-turns.test.ts -t "keeps concurrent final transcripts bound to their original speakers"

Result: pass at ee8c486b80bb.

Artifacts:

  • .artifacts/auto-pr-945/behavior-proof-vitest.log
  • .artifacts/auto-pr-945/behavior-proof.json

Fixed protected boundary path:
Alice starts a final voice transcript as a non-owner and the active-run control action is deliberately delayed. Bob then starts a final voice transcript as the owner and reaches fallback talkback first. After Alice's delayed control action falls through, the owner-authorized tool sink is not called for Alice: the recorded Alice call keeps senderIsOwner=false, so owner context is not exposed or leaked to the non-owner transcript.

Protected source and sink result:
The protected source is the pending Discord realtime speaker context. The protected sink is the fallback talkback agentCommand call that carries senderIsOwner. The proof shows the non-owner source did not reach the owner sink state, and the sensitive owner flag was not persisted or exposed on Alice's call.

Positive benign control succeeds:
The same run verifies intended behavior still works for an authorized owner turn: Bob's transcript reaches the fallback talkback tool request path with senderIsOwner=true while Alice's earlier non-owner control action is still pending.

Live-environment gap:
extensions/discord/package.json exposes no Discord realtime voice live command. The root package has broader live and docker lanes, but no issue-specific credentialed Discord voice harness for this overlapping-transcript path. This proof is current-head local production-adapter evidence, not a live Discord client recording.

@mmaps

mmaps commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 13, 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 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. labels Aug 13, 2026
@mmaps

mmaps commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 13, 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.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 14, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 18, 2026
@jacobtomlinson
jacobtomlinson merged commit 55f6700 into openclaw:main Aug 19, 2026
102 checks passed
@jacobtomlinson

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 20, 2026
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 merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary 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.

2 participants