Skip to content

fix(tts): deliver voice-only replies when speech runtime is cold - #128394

Merged
steipete merged 1 commit into
mainfrom
codex/tts-cold-channel-delivery-qa
Aug 23, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/tts-cold-channel-delivery-qa

Conversation

@steipete

@steipete steipete commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users sending voice-only replies would receive no answer when speech support was unavailable and the channel payload contained transport metadata. The reply dispatcher incorrectly treated metadata such as Slack unfurl settings as visible content, then the channel router silently reported the reply undelivered.

Why This Change Was Made

Use one channel-aware visibility decision for both unavailable speech runtimes and failed speech synthesis. The canonical channel owner distinguishes actual visible structured blocks from transport-only metadata, so an otherwise invisible voice-only reply falls back to its original spoken text while legitimate structured content remains unchanged.

Production code decreases by three lines. No public configuration, plugin SDK contract, protocol, persistence, or speech-provider behavior changes.

User Impact

Voice-only answers are delivered as readable text when speech cannot run, including before a bundled channel plugin has activated. Existing visible messages, media attachments, and genuine channel-native cards keep their established behavior.

Evidence

  • Authentic pre-fix regression: both loaded and bundled-but-inactive Slack channel paths returned delivered: false through the real reply dispatcher and channel router when voice-only replies contained transport-only metadata.
  • Post-fix real delivery proof covers all four loaded/bundled × transport-only/visible-block combinations; genuine channel-native blocks remain visible without synthesizing or replacing their text.
  • node scripts/run-vitest.mjs src/tts/tts-runtime-fallbacks.test.ts src/auto-reply/reply/route-reply.test.ts — 81 tests passed across two suites.
  • node scripts/run-vitest.mjs test/plugins/bundled-provider-auth-literal-parity.test.ts — all 16 cases passed after rebasing onto the independently landed upstream Ollama parity repair.
  • Core and core-test TypeScript, focused formatting/lint, max-lines and assertion-safety ratchets.
  • Fresh independent source-aware in-session review: no actionable findings; verified canonical owner, warm synthesis siblings, loaded/bundled channel lookup, unchanged public contracts, and +13/-16 production LOC.

@clawsweeper

clawsweeper Bot commented Aug 23, 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 size: S maintainer Maintainer-authored PR labels Aug 23, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 23, 2026
@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 6:25 PM ET / 22:25 UTC.

ClawSweeper review

What this changes

This PR makes voice-only replies fall back to readable text when speech is unavailable and channel metadata is transport-only rather than visible content.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open for explicit maintainer handling: current main retains the silent-drop path, while this focused patch reuses the channel-owned visibility decision already used after synthesis failures. No actionable patch defect was found; required checks are still running.

Priority: P1
Reviewed head: 61f347e89ea3e1e8e6697b554ac8f57d07a67ce9
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with credible regression coverage and no actionable correctness finding; exact-head CI remains the merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-associated PR, so the external-contributor proof gate does not apply; the branch nevertheless includes dispatcher-and-router regression coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-associated PR, so the external-contributor proof gate does not apply; the branch nevertheless includes dispatcher-and-router regression coverage.
Evidence reviewed 5 items Current-main defect: Current main's cold-runtime fallback uses generic payload-content detection; nonempty transport metadata is therefore treated as content before the router can reject it as empty.
Delivery-owner contract: The router asks the channel messaging owner whether channel data is structured, then returns delivered:false when no visible reply content remains.
Canonical repair: The branch passes the channel owner's structured-content result into the shared fallback, used by both the cold-runtime and synthesis-failure exits.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs src/tts/tts-runtime-fallbacks.test.ts

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

node scripts/run-vitest.mjs src/tts/tts-runtime-fallbacks.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128394-phsDpO/target$ node scripts/run-vitest.mjs src/tts/tts-runtime-fallbacks.test.ts
node scripts/run-vitest.mjs src/tts/tts-runtime-fallbacks.test.ts
[test] starting test/vitest/vitest.unit.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-128394-phsDpO/target

 ✓  unit  src/tts/tts-runtime-fallbacks.test.ts (41 tests) 1114ms
     ✓ routes hidden speech through the actual dispatcher and channel router when 'speech provider fails'  1009ms

 Test Files  1 passed (1)
      Tests  41 passed (41)
   Start at  22:25:57
   Duration  10.23s (transform 8.11s, setup 854ms, import 7.95s, tests 1.11s, environment 0ms)

[test] passed 1 Vitest shard in 19.28s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128394-phsDpO/target$ node scripts/run-vitest.mjs src/tts/tts-runtime-fallbacks.test.ts
[test] starting test/vitest/vitest.unit.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-128394-phsDpO/target

 ✓  unit  src/tts/tts-runtime-fallbacks.test.ts (41 tests) 472ms
     ✓ routes hidden speech through the actual dispatcher and channel router when 'speech provider fails'  378ms

 Test Files  1 passed (1)
      Tests  41 passed (41)
   Start at  22:26:16
   Duration  4.66s (transform 2.63s, setup 381ms, import 3.62s, tests 472ms, environment 0ms)

[test] passed 1 Vitest shard in 13.73s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128394-phsDpO/target$




















Assertions:

  • FAIL expect_output: cold speech runtime visible fallback

How this fits together

TTS prepares a reply before the dispatcher sends it through the originating channel. The fallback must distinguish visible channel-native blocks from routing metadata so an otherwise empty reply is not suppressed by the channel router.

flowchart LR
  A[Voice-only reply] --> B[TTS payload preparation]
  B --> C{Speech available?}
  C -->|No or synthesis fails| D[Channel visibility decision]
  D --> E[Restore spoken text when metadata is transport-only]
  E --> F[Reply dispatcher]
  F --> G[Channel router and delivery]
Loading

Decision needed

Question Recommendation
Should this maintainer-labeled TTS delivery fix be merged once the required checks for its current head complete? Merge after exact-head CI: Accept the shared fallback after the current head's required checks are green.

Why: The patch is focused and source-backed, but the protected maintainer label requires explicit human handling rather than automated cleanup.

Before merge

  • Resolve merge risk (P1) - Exact-head CI is still in progress; merge should wait for the required checks on the current branch head.
  • Complete next step (P2) - No repair lane is needed: there is no actionable finding, and the maintainer label requires human merge handling after exact-head CI.
Agent review details

Security

None.

PR surface

Source -3, Tests +47. Total +44 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 13 16 -3
Tests 1 71 24 +47
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 84 40 +44

Review metrics

Metric Value Why it matters
Production versus regression coverage production -3 (13 added, 16 removed); tests +47 (71 added, 24 removed) The bug fix consolidates two fallback decisions while expanding boundary coverage across four channel-resolution/content cases.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain one shared channel-aware fallback for both cold speech runtimes and synthesis failures, then merge after exact-head checks pass.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain one shared channel-aware fallback for both cold speech runtimes and synthesis failures, then merge after exact-head checks pass.

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

Yes—current main's generic metadata check and the router's channel-aware empty-payload gate establish the silent-drop chain; the new boundary test targets that exact path, though this read-only review did not execute it.

Is this the best way to solve the issue?

Yes—the patch removes duplicated fallback logic by reusing the established channel-owned visibility decision for both unavailable-runtime and failed-synthesis paths.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P1: Current main can silently suppress a voice-only reply in a channel workflow when speech is unavailable.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-associated PR, so the external-contributor proof gate does not apply; the branch nevertheless includes dispatcher-and-router regression coverage.

Label justifications:

  • P1: Current main can silently suppress a voice-only reply in a channel workflow when speech is unavailable.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-associated PR, so the external-contributor proof gate does not apply; the branch nevertheless includes dispatcher-and-router regression coverage.

Evidence

What I checked:

  • Current-main defect: Current main's cold-runtime fallback uses generic payload-content detection; nonempty transport metadata is therefore treated as content before the router can reject it as empty. (src/tts/tts-payload.ts:91, 6669872a95f8)
  • Delivery-owner contract: The router asks the channel messaging owner whether channel data is structured, then returns delivered:false when no visible reply content remains. (src/auto-reply/reply/route-reply.ts:247, 6669872a95f8)
  • Canonical repair: The branch passes the channel owner's structured-content result into the shared fallback, used by both the cold-runtime and synthesis-failure exits. (src/tts/tts-payload.ts:92, 61f347e89ea3)
  • Boundary regression coverage: The table-driven test reaches the dispatcher and router for loaded and bundled-fallback channel resolution, covering transport metadata and genuine visible blocks. (src/tts/tts-runtime-fallbacks.test.ts:793, 61f347e89ea3)
  • Feature provenance: Blame ties the original cold-runtime fallback on current main to the TTS feature introduction; the same author has maintained the adjacent structured-reply and synthesis-failure work. (src/tts/tts-payload.ts:89, 000aea1d7a3c)

Likely related people:

  • steipete: Introduced the cold-runtime fallback and has prior merged TTS work covering structured replies and synthesis-failure fallback behavior. (role: original feature owner and recent area contributor; confidence: high; commits: 000aea1d7a3c, 7a3f40c4ac4c, bac7d6bd5d8f; files: src/tts/tts-payload.ts, src/tts/tts-runtime-fallbacks.test.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.

@steipete
steipete force-pushed the codex/tts-cold-channel-delivery-qa branch from ad88c8e to f09669e Compare August 23, 2026 23:22
@steipete
steipete merged commit d4956eb into main Aug 23, 2026
225 checks passed
@steipete
steipete deleted the codex/tts-cold-channel-delivery-qa branch August 23, 2026 23:34
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. 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.

1 participant