Skip to content

fix(tts): preserve hidden speech answers when synthesis fails - #118690

Merged
steipete merged 4 commits into
mainfrom
codex/qa0803-tts-hidden-text-fallback
Aug 3, 2026
Merged

steipete merged 4 commits into
mainfrom
codex/qa0803-tts-hidden-text-fallback

Conversation

@steipete

@steipete steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Deliver the actual answer when an audio-only TTS response cannot be synthesized or stored.
  • Preserve privacy for already deliverable rich cards, attachments, interactive content, locations, and channel-specific payloads.

Root cause and canonical owner

The existing TTS payload producer strips hidden [[tts:text]] instructions before speech generation. When the speech provider or audio-storage owner failed, it returned the stripped empty payload; the real reply dispatcher accepted an empty final, producing no useful user-visible answer. This behavior also exists in released v2026.7.2-beta.7. The TTS failure owner now consults the existing canonical hasReplyPayloadContent owner and restores clean explicit speech text only when the entire payload would otherwise be undeliverable.

Actual operator-visible proof

The identical real active plugin registry → failing speech provider → real createReplyDispatcher → actual delivery sink produced before repair:

{"accepted":true,"transportPayloads":[{"hasContent":false,"text":null}],"failedFinals":0,"networkRequests":0}

After repair, the actual dispatcher produced:

{"accepted":true,"transportPayloads":[{"hasContent":true,"text":"Your important answer is ready."}],"failedFinals":0,"networkRequests":0}

Provider failure and storage failure genuinely failed first; four independently deliverable rich payload cases additionally proved hidden speech text is never leaked when a card/interactive/location/channel payload already exists.

  • TTS owner/routing/directive suites: 70/70 passing.
  • Type-aware/type-check lint, formatting, and git diff --check: clean.
  • Fresh independent structured Sol/high review: no findings, confidence 0.95.
  • Production delta: +4 lines for the canonical visible-outcome/privacy invariant; tests +113.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 3, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

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

ClawSweeper review

What this changes

The branch restores hidden explicit TTS text after synthesis or audio storage fails, but only when the reply otherwise has no deliverable content.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for explicit maintainer review. The patch addresses a real silent-delivery path, has no actionable line-level correctness finding, and correctly reuses the channel-aware content contract; the remaining decision is whether to accept that cross-channel privacy contract once exact-head validation completes.

Priority: P1
Reviewed head: 572b2f09621ac5e9831eb18ca812665fd497f7d2
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused owner-boundary repair with direct delivery-path proof and no actionable patch finding; ordinary exact-head validation and maintainer risk acceptance remain.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body supplies an after-fix dispatcher-to-delivery transcript, and the branch contains matching focused dispatcher and channel-routing coverage for provider/storage failures and structured-payload privacy.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body supplies an after-fix dispatcher-to-delivery transcript, and the branch contains matching focused dispatcher and channel-routing coverage for provider/storage failures and structured-payload privacy.
Evidence reviewed 7 items Current empty-reply behavior: The shared channel router treats an unrecognized empty payload as a successful non-delivery, which makes a stripped hidden-TTS reply silent after audio generation fails.
Canonical content contract: The common predicate recognizes text, media, interactive and presentation payloads, locations, and a channel-provided structured-content result; the branch delegates to this contract rather than changing the downstream empty-reply guard.
Proposed TTS-owner repair: After failed synthesis, the branch resolves the relevant channel plugin and restores explicit hidden speech text only if the canonical predicate finds no deliverable payload content.
Findings None None.
Security None None.

How this fits together

TTS removes hidden speech-only directives before requesting audio from a provider and storage owner. The resulting payload goes through the shared reply dispatcher and channel router, which suppresses empty replies but delivers text, media, interactive content, locations, and channel-owned structured payloads.

flowchart LR
  A[Agent reply with hidden TTS text] --> B[TTS payload preparation]
  B --> C[Speech synthesis and audio storage]
  C -->|audio succeeds| D[Audio reply payload]
  C -->|audio fails| E[Check deliverable reply content]
  E -->|no content| F[Restore explicit speech text]
  E -->|rich content exists| G[Keep hidden text private]
  D --> H[Reply dispatcher and channel delivery]
  F --> H
  G --> H
Loading

Decision needed

Question Recommendation
Is the existing channel-level structured-payload contract sufficient to accept this visible-fallback behavior once exact-head validation is green? Accept the existing contract: Merge after required checks pass, relying on the established plugin predicate and the added activated/pre-activation coverage.

Why: The patch intentionally changes a silence-on-failure path into visible text delivery and relies on channel plugins to identify private structured content.

Before merge

  • Resolve merge risk (P2) - The fallback relies on each channel plugin accurately reporting whether its channel-specific payload is independently deliverable; an incorrect negative result could expose hidden speech text after TTS failure.
Agent review details

Security

None.

PR surface

Source +11, Tests +296. Total +307 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 12 1 +11
Tests 1 297 1 +296
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 309 2 +307

Review metrics

Metric Value Why it matters
Production versus regression coverage production +12/-1, tests +297/-1 The production growth is narrowly tied to the visible-outcome and privacy invariant, while the test expansion covers provider failure, storage failure, dispatcher routing, and structured payload handling.

Merge-risk options

Maintainer options:

  1. Accept the channel contract after checks (recommended)
    Merge once required exact-head checks pass, using the established channel predicate as the structured-content privacy boundary.
  2. Add representative channel cases first
    Require additional bundled-channel proof before merge if maintainers do not want to rely on the existing generic channel contract alone.

Technical review

Best possible solution:

Merge the focused TTS-owner fallback after exact-head checks complete, preserving the channel-owned structured-payload predicate as the privacy boundary for rich replies.

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

Yes. Current-main routing source proves that an empty final is intentionally suppressed, and the branch's focused dispatcher-and-router regression path establishes how failed hidden-TTS synthesis reaches that guard.

Is this the best way to solve the issue?

Yes. The repair belongs at the TTS failure owner and uses the shared content predicate instead of weakening the downstream empty-reply suppression behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: A user-visible channel reply can otherwise complete with no delivered answer when TTS synthesis or storage fails.
  • merge-risk: 🚨 message-delivery: The patch changes whether explicit text is delivered or remains hidden after an audio-only TTS failure.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body supplies an after-fix dispatcher-to-delivery transcript, and the branch contains matching focused dispatcher and channel-routing coverage for provider/storage failures and structured-payload privacy.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies an after-fix dispatcher-to-delivery transcript, and the branch contains matching focused dispatcher and channel-routing coverage for provider/storage failures and structured-payload privacy.

Evidence

What I checked:

  • Current empty-reply behavior: The shared channel router treats an unrecognized empty payload as a successful non-delivery, which makes a stripped hidden-TTS reply silent after audio generation fails. (src/auto-reply/reply/route-reply.ts:240, a67c52611e57)
  • Canonical content contract: The common predicate recognizes text, media, interactive and presentation payloads, locations, and a channel-provided structured-content result; the branch delegates to this contract rather than changing the downstream empty-reply guard. (src/interactive/payload.ts:1201, a67c52611e57)
  • Proposed TTS-owner repair: After failed synthesis, the branch resolves the relevant channel plugin and restores explicit hidden speech text only if the canonical predicate finds no deliverable payload content. (src/tts/tts-payload.ts:272, 572b2f09621a)
  • Dispatcher-to-routing coverage: The added regression coverage drives failed provider and storage paths through the actual reply dispatcher and route function, asserting visible fallback for empty channel metadata and privacy preservation for structured channel cards. (src/tts/tts-runtime-fallbacks.test.ts:392, 572b2f09621a)
  • Channel fallback contract: The registry resolves a loaded channel plugin first and then a bundled implementation, matching the test's activated and pre-activation channel cases. (src/channels/plugins/registry.ts:41, a67c52611e57)
  • Current owner-path provenance: Blame attributes the router's channel-aware empty-payload guard to the current-main commit that introduced these lines, connecting the repair to the existing delivery contract. (src/auto-reply/reply/route-reply.ts:240, 8d1fe4f09106)

Likely related people:

  • steipete: The PR commits are authored by this account, and current-main blame attributes the adjacent channel-aware reply-delivery guard to the same contributor identity. (role: recent area contributor and delivery-contract owner; confidence: high; commits: 8d1fe4f09106, f98e0e504283, 57ca69aadba9; files: src/tts/tts-payload.ts, src/tts/tts-runtime-fallbacks.test.ts, src/auto-reply/reply/route-reply.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-03T13:58:25.122Z sha f98e0e5 :: found issues before merge. :: [P1] Use the channel-aware structured-content predicate
  • reviewed 2026-08-03T14:07:11.148Z sha f98e0e5 :: needs real behavior proof before merge. :: [P1] Use the channel-aware structured-content predicate
  • reviewed 2026-08-03T16:42:27.945Z sha 57ca69a :: needs maintainer review before merge. :: none
  • reviewed 2026-08-03T17:30:36.826Z sha 3caf5f4 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added 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. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 3, 2026
@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: 🦪 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 3, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 3, 2026
@steipete
steipete merged commit bac7d6b into main Aug 3, 2026
122 checks passed
@steipete
steipete deleted the codex/qa0803-tts-hidden-text-fallback branch August 3, 2026 20:06
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 3, 2026
…outing-20260803

* origin/main: (34 commits)
  fix(config): reject unsupported diagnostics otel grpc (#93087)
  fix(providers): recognize configured media credentials across provider boundaries (#118761)
  refactor: delete dead post-landing plugin/hooks scaffolding (#118920)
  fix(cron): deliver child results after heartbeat-only parent responses (#118743)
  fix(ci): keep Matrix chunk tests aligned with inventory (#118917)
  fix(tts): preserve hidden speech answers when synthesis fails (#118690)
  test(gateway): add HTTP API QA coverage (#118809)
  test(qa): cover Control UI sessions and cron (#118838)
  fix(macos): preserve native command ownership and consent (#118914)
  test(qa): cover OpenClaw exec process lifecycle (#118819)
  test(ui): cover diagnostic operator flows (#118837)
  fix(search): propagate cancellation through provider-owned requests (#118895)
  test(gateway): cover loopback and LAN access (#118824)
  refactor(channels): own the lifecycle status contract in SDK patch factories (#118795)
  test(ui): add guarded config QA coverage (#118814)
  fix(feishu): fence external collaboration tool results (#118877)
  test(qa): cover Plugin SDK import topology (#118878)
  test(qa): register external app SDK proof (#118829)
  fix(gateway): expire temporal rows in cached session lists (#118875)
  test(matrix): isolate runtime state (#118892)
  ...
vincentkoc added a commit that referenced this pull request Aug 3, 2026
* commit 'efcced7207baa0b1b1db5e8e1836673a24212657':
  test(agents): prove process control roundtrip (#118843)
  test(qa): add memory redaction boundary coverage (#118916)
  fix(kilocode): model discovery overstates the usable context window (#118868)
  fix(media): isolate generated-provider text from delivery directives (#118780)
  test(gateway): add node control-plane QA coverage (#118784)
  fix(config): reject unsupported diagnostics otel grpc (#93087)
  fix(providers): recognize configured media credentials across provider boundaries (#118761)
  refactor: delete dead post-landing plugin/hooks scaffolding (#118920)
  fix(cron): deliver child results after heartbeat-only parent responses (#118743)
  fix(ci): keep Matrix chunk tests aligned with inventory (#118917)
  fix(tts): preserve hidden speech answers when synthesis fails (#118690)
vincentkoc added a commit that referenced this pull request Aug 3, 2026
…te-dry-run-no-state-mutation

* commit '682f60ce56b37c5cd3205fdcbbf25b21d48708f2': (28 commits)
  fix(config): reject unsupported diagnostics otel grpc (#93087)
  fix(providers): recognize configured media credentials across provider boundaries (#118761)
  refactor: delete dead post-landing plugin/hooks scaffolding (#118920)
  fix(cron): deliver child results after heartbeat-only parent responses (#118743)
  fix(ci): keep Matrix chunk tests aligned with inventory (#118917)
  fix(tts): preserve hidden speech answers when synthesis fails (#118690)
  test(gateway): add HTTP API QA coverage (#118809)
  test(qa): cover Control UI sessions and cron (#118838)
  fix(macos): preserve native command ownership and consent (#118914)
  test(qa): cover OpenClaw exec process lifecycle (#118819)
  test(ui): cover diagnostic operator flows (#118837)
  fix(search): propagate cancellation through provider-owned requests (#118895)
  test(gateway): cover loopback and LAN access (#118824)
  refactor(channels): own the lifecycle status contract in SDK patch factories (#118795)
  test(ui): add guarded config QA coverage (#118814)
  fix(feishu): fence external collaboration tool results (#118877)
  test(qa): cover Plugin SDK import topology (#118878)
  test(qa): register external app SDK proof (#118829)
  fix(gateway): expire temporal rows in cached session lists (#118875)
  test(matrix): isolate runtime state (#118892)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
…aw#118690)

* fix(tts): preserve hidden speech answers when synthesis fails

* fix(tts): preserve visible Slack fallback before channel activation

* test(tts): respect plugin ownership boundaries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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