Skip to content

fix(tts): normalize streamed speech and report fallbacks - #125686

Merged
steipete merged 6 commits into
mainfrom
steipete/eager-hertz-a43bdf
Aug 18, 2026
Merged

steipete merged 6 commits into
mainfrom
steipete/eager-hertz-a43bdf

Conversation

@steipete

@steipete steipete commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where streamed Discord voice replies could speak Markdown syntax and raw link destinations that buffered synthesis strips before speech. It also resolves a silent failure mode where a streaming provider error was hidden when file synthesis succeeded as a fallback.

Why This Change Was Made

The core streaming TTS path passed raw input directly into provider attempts instead of applying the canonical speech-text normalization already used by buffered synthesis. The core TTS owner now normalizes streaming text at that boundary.

Discord voice also discarded the failed streaming attempt metadata before successful file fallback, leaving the session with no recordable explanation. The Discord voice owner now carries the failed provider and closed reason code across the fallback and records the first such fallback once per voice session. This preserves successful playback without repeated warnings.

ClawSweeper identified that expected unsupported_for_streaming skips were still flowing into the warning path. That finding is addressed by selecting only the last attempt whose outcome is failed: expected capability skips remain silent during successful buffered fallback, while actual failed attempts still preserve their warning metadata.

AI-assisted maintainer repair; the implementation and focused evidence were reviewed before publication.

User Impact

Streamed Discord voice now reads cleaned speech instead of vocalizing Markdown markers or raw link destinations. When an actual streaming attempt fails but file synthesis succeeds, operators receive one useful warning per voice session naming the failed provider and reason code while playback continues normally. Buffered-only providers can use their expected file fallback without a misleading streaming-failure warning.

Evidence

  • Core regression: before the fix, the fallback stream received raw ## Keep [streaming Markdown](https://example.com) raw!!!!!; after the fix, it receives Keep streaming Markdown raw!. The focused regression passes, and src/tts/tts-runtime-models.test.ts passes 7/7.
  • Discord regression: before the fix, a streaming provider failure followed by successful file fallback emitted no warning. The focused voice runtime test now passes and records exactly one warning per session with provider=elevenlabs and reasonCode=provider_error while file fallback succeeds.
  • ClawSweeper finding regression: before the follow-up fix, a fresh voice session using a buffered-only provider played the successful file fallback but emitted a misleading streaming-failure warning. The regression now proves the file fallback plays and emits no such warning.
  • The targeted expected-skip and actual-failure tests passed, and the full Discord voice-runtime file passed 31/31. oxfmt and git diff --check are clean, and fresh Codex autoreview completed with no accepted or actionable findings.
  • Live provider proof: ElevenLabs streaming synthesis produced mp3_44100_128 audio (42,258 bytes), and ElevenLabs STT transcribed it as Status done. Read the release notes. The transcript contained no hash/hashtag/asterisk/URL/raw-URL speech.
  • Absorbed CI repair: exact-head run 32110130614, job 95627654678, exposed an unrelated Control UI reconnect-history retry test whose real 100 ms timer lost to waitForFast's wall-clock timeout on the saturated compact-large shard.
  • The test-only deterministic repair (+12/-6; production LOC 0) uses fake timers, advances the exact 100 ms retry delay, preserves the history/send ordering and outbox assertions, and restores real timers in finally. The focused test passed locally, a bounded worker loop passed 10/10, and fresh autoreview completed cleanly.
  • Absorbed CI repair: exact-head run 32117859632, job 95651522546, exposed the Markdown table test's delegated click delivery racing the assertions. The test now invokes the delegated handler directly with a targeted event while preserving exact TSV, copied-label timer, dialog-open, table-content, and focus-restoration assertions.
  • Absorbed CI repair: the same run's checks-ui-e2e failure exposed navigation and page close racing the durable composer write. The shipped-bundle E2E now waits through waitForCommittedState until the real IndexedDB composer store contains the expected text and exactly one attachment for each session, while preserving all restoration, removal, and send assertions.
  • Both focused UI files pass. Bounded repeats passed 5/5 for the Markdown test and 5/5 for the attachment E2E; the coreTests changed gate passed; formatting, diff checks, and fresh autoreview are clean. These synchronization repairs are production +0/-0 and tests +83/-3.
  • Absorbed CI repair: exact-head run 32120793258 exposed two unrelated identity assumptions: a delayed interactive hovercard could intercept the child-session menu pointer click, and the QA cleanup test checked a globally reusable process-group identity instead of its owned descendant process.
  • The sidebar repair preserves the hover opacity and pointer-event assertions, then focuses and activates the child-session menu with Enter. Bounded focused repeats passed 5/5 and the full UI E2E lane passed 11/11.
  • The QA repair asserts that the exact captured descendant PID is dead when cleanup completes. Bounded focused repeats passed 20/20 and the full QA lifecycle file passed 8/8.
  • These owner-specific repairs are production +0/-0 and tests +6/-7. The changed gate, formatting, and diff checks pass, and fresh Codex autoreview completed with no accepted or actionable findings.
  • Absorbed CI repair: exact-head run 32125741781 exposed retries an explicitly retryable send rejection while still connected observing one send attempt instead of two because its 100 ms retry lost to wall-clock polling under CI load.
  • The deterministic test-only repair uses fake timers, asserts the initial send occurred once, advances the exact 100 ms retryAfter, then verifies the second attempt reused the same idempotency key and emptied the outbox; real timers are restored in finally. The focused test passed, a bounded loop passed 10/10, and formatting, diff checks, and fresh Codex autoreview are clean. This repair is production +0/-0 and tests +16/-6.
  • Production LOC: +33/-2 (net +31). Tests and test support: +217/-72 (net +145). The production growth is the Discord session-owned once-only diagnostic state and the provider/reason-code metadata carried across successful file fallback.
  • Known local proof gap: the changed-gate wrapper ran for 55 minutes on a saturated host and passed guards, formatting, doctor contract tests, deprecated API checks, plugin boundaries, patch guard, dead-export scans, and reached core/core-test/extension/extension-test typechecks plus lint invocation with no printed failures, but it did not terminate and was stopped. This is not claimed as a completed local changed gate; exact-head pull-request CI is required.

Rebase evidence

The earlier attachment-lifecycle CI failure from run 32116923052 was already fixed on main by 6b72d65. After rebasing that fix, run 32117859632 exposed a distinct remaining durability race in the shipped-bundle lifecycle test; the new committed-state barrier covers that race without duplicating production code.

Main later advanced through #125665 with an independent raw IndexedDB draft poll in the same lifecycle test. The clean rebase retained this PR's canonical waitForCommittedState barrier and exact write-boundary calls, removed only the redundant helper overlap, and the rebased attachment lifecycle E2E passed 4/4.

Main then advanced through #125645 with a real navigator.clipboard.writeText test boundary in the Markdown table test. The clean rebase combined that boundary with this PR's direct handler invocation, preserving both fixes; the focused Markdown file passed 4/4 and the attachment lifecycle E2E passed 4/4. Fresh branch autoreview completed with no accepted or actionable findings.

@clawsweeper

clawsweeper Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 18, 2026 07:09
@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: S maintainer Maintainer-authored PR labels Aug 18, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 18, 2026
@clawsweeper

clawsweeper Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 6:37 AM ET / 10:37 UTC.

ClawSweeper review

What this changes

This PR makes streamed TTS use the same Markdown-to-speech normalization as file synthesis, records genuine streaming failures across Discord file fallback, and stabilizes related UI and QA tests.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open for maintainer review: the core normalization repair is source-proven and the fallback warning is bounded, but accepting a new once-per-voice-session operator diagnostic is a product-policy choice. The PR is also behind current main, with exact-head checks still in progress.

Priority: P2
Reviewed head: 05daeddeb4561bc4966c8d1587b2e7d339e2cd3a
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The implementation follows the existing core normalization boundary and has meaningful behavior evidence; only the diagnostic-policy decision and final-head CI remain.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR body provides after-fix live provider output with an STT transcript of normalized speech, supplemented by focused Discord fallback evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body provides after-fix live provider output with an STT transcript of normalized speech, supplemented by focused Discord fallback evidence.
Evidence reviewed 5 items Current-main defect and canonical repair: Current main passes raw text as streaming synthesis input, while buffered synthesis already calls the canonical normalizer. The PR changes the streaming owner to use that same helper.
Fallback warning is restricted to genuine failures: The Discord path selects only attempts whose outcome is failed, preserves provider and closed reason code through successful file synthesis, and emits at most one warning on the voice-session owner.
Regression coverage targets both outcomes: The voice runtime coverage asserts one warning across two failed-stream/file-fallback turns and separately asserts that an unsupported streaming capability skip remains silent.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw tts --help

Result: FAIL (partial) — step 2 expect_output Usage:: expected terminal output was not visible within 30 seconds: "Usage:"

pnpm openclaw tts --help
runner@runnervmzvulz:/tmp/clawsweeper-live-proof-125686-QOwqYT/target$ pnpm openclaw tts --help
$ node scripts/run-node.mjs tts --help
pnpm openclaw tts --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: 399.88 kB
[log]
[success] rolldown v1.2.0 Finished in 43.04 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.7s
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
───────╯

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
──────╯

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


Assertions:

  • FAIL expect_output: Usage:

How this fits together

Discord voice prepares an agent reply, attempts low-latency streamed TTS, and falls back to file synthesis when needed. Core TTS selects and invokes providers, while the Discord voice session owns playback and session-scoped diagnostics.

flowchart TD
A[Discord voice reply] --> B[Speech preparation]
B --> C[Core streaming TTS]
C --> D{Stream succeeded?}
D -->|Yes| E[Discord playback]
D -->|No| F[File TTS fallback]
F --> G[Once-per-session warning]
G --> E
Loading

Decision needed

Question Recommendation
Should Discord voice emit one operator warning per voice session when a streaming TTS attempt genuinely fails but file synthesis successfully plays? Accept the bounded diagnostic: Keep one warning for an actual failed stream attempt while preserving successful file playback and silent expected capability skips.

Why: The normalization repair follows an existing core invariant, but the new warning changes operator-facing diagnostic policy rather than repairing a mechanically required contract.

Before merge

  • Resolve merge risk (P2) - A successful file fallback will now produce one operator warning per Discord voice session after an actual stream failure; this diagnostic policy is intentional in the patch but needs maintainer acceptance.
  • Resolve merge risk (P1) - The branch is behind current main and its exact-head matrix is incomplete, so merge requires a refresh/rebase and green checks for the final head.
  • Complete next step (P2) - A maintainer must choose the new fallback-warning policy; no narrow mechanical repair is indicated by the review.
Agent review details

Security

None.

PR surface

Source +55, Tests +121. Total +176 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 7 58 3 +55
Tests 7 192 71 +121
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 14 250 74 +176

Review metrics

Metric Value Why it matters
Production versus test delta production +33/-2; tests and test support +217/-72 The production growth is limited to core normalization plus Discord session-scoped failure metadata and must be accepted as the cost of the diagnostic policy.

Stored data model

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

Merge-risk options

Maintainer options:

  1. Accept the session diagnostic (recommended)
    Approve one warning per voice session for real stream failures that recover through file synthesis, then require final-head CI before merge.
  2. Keep fallback diagnostics silent
    Remove the new warning behavior if successful file fallback should remain operator-silent.

Technical review

Best possible solution:

Retain the shared core normalizer and session-owned once-only failure fact if maintainers approve the diagnostic policy, then rebase and merge only after final-head checks pass.

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

Yes, source-reproducible: current main sends raw streaming text at src/tts/tts-streaming.ts:41 while buffered synthesis normalizes it at src/tts/tts-synthesis.ts:240. The supplied regression asserts the resulting provider input, but this read-only review did not execute it.

Is this the best way to solve the issue?

Yes for normalization: placing the existing canonical helper at the shared streaming owner matches buffered synthesis and covers every stream provider. The added warning remains conditional on maintainer approval of its operator-facing policy.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix live provider output with an STT transcript of normalized speech, supplemented by focused Discord fallback evidence.

Label justifications:

  • P2: This fixes a user-visible Discord voice quality and observability defect without evidence of a broad availability or data-loss emergency.
  • merge-risk: 🚨 other: The new once-per-session warning changes operator-facing fallback diagnostics despite successful playback.
  • 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 PR body provides after-fix live provider output with an STT transcript of normalized speech, supplemented by focused Discord fallback evidence.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix live provider output with an STT transcript of normalized speech, supplemented by focused Discord fallback evidence.

Evidence

What I checked:

  • Current-main defect and canonical repair: Current main passes raw text as streaming synthesis input, while buffered synthesis already calls the canonical normalizer. The PR changes the streaming owner to use that same helper. (src/tts/tts-streaming.ts:42, ee2027a927fa)
  • Fallback warning is restricted to genuine failures: The Discord path selects only attempts whose outcome is failed, preserves provider and closed reason code through successful file synthesis, and emits at most one warning on the voice-session owner. (extensions/discord/src/voice/tts.ts:85, 05daeddeb456)
  • Regression coverage targets both outcomes: The voice runtime coverage asserts one warning across two failed-stream/file-fallback turns and separately asserts that an unsupported streaming capability skip remains silent. (extensions/discord/src/voice/voice-runtime.e2e.test.ts:394, 05daeddeb456)
  • Live behavior proof supplied: The PR body reports an ElevenLabs streaming synthesis followed by STT transcription of cleaned speech, alongside focused Discord fallback coverage; this is positive after-fix evidence, though not an independently rerun review execution. (05daeddeb456)
  • History routing: Blame places the changed streaming owner boundary at the current PR head; this sparse checkout could not retrieve older promised objects, so ownership is kept at medium confidence. (src/tts/tts-streaming.ts:42, 05daeddeb456)

Likely related people:

  • steipete: Authored the current branch's TTS normalization and Discord fallback commits; shallow blame also attributes the nearby retained owner boundary to Peter Steinberger. (role: recent TTS and Discord voice contributor; confidence: medium; commits: 6e50a6e3bc28, 83c5bdaa59a7, 05daeddeb456; files: src/tts/tts-streaming.ts, extensions/discord/src/voice/tts.ts, extensions/discord/src/voice/segment.ts)

Rank-up moves

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

  • Explicitly accept or reject the once-per-session fallback-warning policy.
  • Rebase or refresh against current main and wait for green checks on the exact final head.

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-08-18T07:37:35.805Z sha d877045 :: found issues before merge. :: [P2] Filter non-failure stream attempts before warning
  • reviewed 2026-08-18T08:10:09.887Z sha 5bf6a80 :: needs changes before merge. :: [P2] Filter skipped stream attempts before warning
  • reviewed 2026-08-18T08:50:14.603Z sha b7830db0fdd96237213704cfb0199d5da9ba83a6 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-18T09:24:18.277Z sha 9176b8f566f335c2d68925aa9c0817ab5f0aa71e :: needs maintainer review before merge. :: none
  • reviewed 2026-08-18T10:21:23.806Z sha 12c020c6a1bcaaa2858c950d6139e2fe15a63539 :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Aug 18, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Aug 18, 2026
@steipete
steipete force-pushed the steipete/eager-hertz-a43bdf branch from af313af to b7830db Compare August 18, 2026 08:43
@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. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 18, 2026
@steipete
steipete force-pushed the steipete/eager-hertz-a43bdf branch from b7830db to 9176b8f Compare August 18, 2026 09:17
@steipete
steipete force-pushed the steipete/eager-hertz-a43bdf branch from 9176b8f to 46f57f7 Compare August 18, 2026 09:52
@steipete
steipete force-pushed the steipete/eager-hertz-a43bdf branch 2 times, most recently from 06c2787 to 12c020c Compare August 18, 2026 10:14
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Aug 18, 2026
Streamed Discord voice now strips Markdown and raw link destinations like buffered synthesis.

Record the first failed streaming provider and reason code before successful file fallback.
Drive the retry deterministically by advancing the exact 100 ms fake timer while preserving the ordering and outbox proof. Repairs CI run 32110130614 job 95627654678.
Address the ClawSweeper finding by retaining warning metadata only for actual failed attempts. Expected unsupported-for-streaming skips stay silent while real streaming failures still warn after successful file fallback.
Repairs CI run 32117859632 by invoking the markdown table handler directly with a targeted event and waiting for durable IndexedDB composer state before navigation or page close.
CI run 32120793258 exposed two owner-specific test assumptions.

Preserve the child-session hover visibility and pointer assertions, then focus and activate its menu with Enter so an unrelated delayed hovercard cannot intercept the pointer.

Assert the exact owned descendant PID is dead when QA cleanup completes instead of checking a globally reusable PGID.
CI run 32125741781 exposed the wall-clock race in the connected retry test.
@steipete
steipete force-pushed the steipete/eager-hertz-a43bdf branch from 12c020c to 05daedd Compare August 18, 2026 10:30
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Aug 18, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof

Reviewed head: 05daeddeb4561bc4966c8d1587b2e7d339e2cd3a

This is ready for the repository-native prepare/merge workflow. The fix puts streaming speech normalization in the core TTS owner and keeps the once-per-session fallback diagnostic in the Discord voice-session owner. Production LOC is +33/-2 (net +31); tests and test support are +217/-72 (net +145). The absorbed CI repairs are test-only.

Focused behavior proof

pnpm test src/tts/tts-runtime-models.test.ts
PASS 7/7

pnpm test extensions/discord/src/voice/voice-runtime.e2e.test.ts
PASS 31/31

The core regression failed before the fix because the fallback stream received raw ## Keep [streaming Markdown](https://example.com) raw!!!!!; the fixed test receives Keep streaming Markdown raw!. The Discord regression failed before the fix because a genuine failed streaming attempt followed by successful file synthesis emitted no warning; the fixed file warns exactly once per session with provider=elevenlabs and reasonCode=provider_error. The unsupported_for_streaming skip regression remains silent while file playback succeeds.

The test-only CI repairs were also exercised through their owning files:

pnpm test ui/src/pages/chat/chat-send.test.ts
PASS; deterministic 100 ms reconnect/send retry coverage, bounded repeats 10/10

pnpm test ui/src/components/markdown-tables.test.ts
PASS; direct delegated Markdown handler coverage, bounded repeats 5/5

pnpm test ui/src/e2e/chat-attachment-read-lifecycle.e2e.test.ts
PASS; committed IndexedDB draft barrier, bounded repeats 5/5 and final focused file 4/4

pnpm test ui/src/e2e/session-management.sidebar.e2e.test.ts
PASS; keyboard session-menu activation, full UI E2E lane 11/11

pnpm test extensions/qa-lab/src/test-file-scenario-command-lifecycle.test.ts
PASS 8/8; exact descendant PID cleanup, bounded repeats 20/20

scripts/pr review-validate-artifacts 125686
PASS; READY FOR /prepare-pr, findings 0

Fresh autoreviews after each code/test change reported no accepted or actionable findings.

Live and CI proof

Live ElevenLabs streaming synthesis produced mp3_44100_128 audio, 42,258 bytes. ElevenLabs STT transcribed it as Status done. Read the release notes; there were no Markdown markers or raw URL speech.

Exact-head CI run 32127109183 completed successfully for 05daeddeb4561bc4966c8d1587b2e7d339e2cd3a, including openclaw/ci-gate success.

ClawSweeper and owner decisions

The latest completed review is under 12 hours old and has no actionable findings after the skipped-attempt fix. Its prior finding is resolved by selecting only an attempt whose outcome is failed; expected unsupported_for_streaming capability skips remain silent.

The maintainer decision is to accept one operator warning per Discord voice session when a genuine streaming attempt fails and file synthesis succeeds. This preserves operator visibility without segment spam. The other rank-up move is also resolved: current-main comparison was refreshed through conflict-free rebases with stable patch IDs, and the current exact-head CI is green. A fresh current-head ClawSweeper review is queued/started, but repository policy does not block landing on the publisher; changes since the completed no-finding review are deterministic test-only CI repairs.

Known gap

The live proof used real provider audio plus real transcription rather than joining a live Discord voice channel. That is the only known proof gap; it is covered at the Discord owner boundary by the 31/31 runtime file, explicit genuine-failure and expected-skip regressions, and exact-head CI. There are no hidden proof gaps, and no docs or changelog change is required under repository policy.

@steipete
steipete merged commit 2d5334f into main Aug 18, 2026
236 checks passed
@steipete
steipete deleted the steipete/eager-hertz-a43bdf branch August 18, 2026 10:46
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 20, 2026
…5686)

* fix(tts): normalize streamed speech and report fallbacks

Streamed Discord voice now strips Markdown and raw link destinations like buffered synthesis.

Record the first failed streaming provider and reason code before successful file fallback.

* test(ui): stabilize reconnect retry timing

Drive the retry deterministically by advancing the exact 100 ms fake timer while preserving the ordering and outbox proof. Repairs CI run 32110130614 job 95627654678.

* fix(discord): ignore expected TTS stream skips

Address the ClawSweeper finding by retaining warning metadata only for actual failed attempts. Expected unsupported-for-streaming skips stay silent while real streaming failures still warn after successful file fallback.

* test(ui): settle interaction state before assertions

Repairs CI run 32117859632 by invoking the markdown table handler directly with a targeted event and waiting for durable IndexedDB composer state before navigation or page close.

* test: remove incidental UI and process identities

CI run 32120793258 exposed two owner-specific test assumptions.

Preserve the child-session hover visibility and pointer assertions, then focus and activate its menu with Enter so an unrelated delayed hovercard cannot intercept the pointer.

Assert the exact owned descendant PID is dead when QA cleanup completes instead of checking a globally reusable PGID.

* test(ui): stabilize connected send retry timing

CI run 32125741781 exposed the wall-clock race in the connected retry test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui channel: discord Channel integration: discord extensions: qa-lab maintainer Maintainer-authored PR merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. 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: M 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