Skip to content

fix(gateway): TTS audio shows as a separate "Audio reply" message until reload - #148696

Merged
obviyus merged 6 commits into
openclaw:mainfrom
LiuwqGit:feat/issue-148680-control-ui-tts-supplement-live-merge
Sep 15, 2026
Merged

obviyus merged 6 commits into
openclaw:mainfrom
LiuwqGit:feat/issue-148680-control-ui-tts-supplement-live-merge

Conversation

@LiuwqGit

@LiuwqGit LiuwqGit commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Local chat displayed generated speech as a separate “Audio reply” until reload. Closes #148680.

Why This Change Was Made

Cursor history now recognizes stored speech supplements after projecting display content, then requests the existing full-history merge. This state has one writer: the transcript owner. Speech matching stays in the full-history projection.

Production growth: history classifier +9 lines; projection export +1; cursor reset +7. Growth accepted under the owner's standing acceptance (2026-09-15).

User Impact

The original answer keeps one playable WAV during live chat and after refresh.

Evidence

A served Control UI with local speech reproduced the separate row on dc260de0ca70. The repaired browser flow preserves the text and attaches audio without reload. Playback, delayed speech after the answer cursor, reload, a second speech turn, and speech off pass.

Before (generated filename hidden):
Separate audio reply

After (generated filename hidden):
Speech attached to the answer

Compatibility

Uses existing transcript fields and the existing reset response.

Consumers

Foreground chat and background history refresh use the same Gateway reader.

Invalidation

A supplement resets the cursor; a full page applies the existing text/audio merge.

Tests

The hosted browser command now selects the speech regression. Nine focused registration and serial-ownership checks pass.

99 Gateway tests pass on the merge with main. The registered browser regression fails on main and passes on the candidate:
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-tts-supplement.real-gateway.e2e.test.ts

Evidence detail

The browser regression fails on baseline dc260de0ca7098a8880938bd79a160df3305db57: the original answer contains no audio player after speech completes. It passes on repair a4bd39cc5040a8e816ee4cb06fee7b8763f5d637, whose production code is unchanged at 57d2e52aaa79ac7198555f09fd51d324a1b499bd. Later test cleanup preserves the prompts and assertions.

The repair includes main through merge b42eb0ff31015162c150820bc2170a5513e74494, with parents 66ddf0e78e90dfe4085fb50253c88b160a14a847 and dc260de0ca7098a8880938bd79a160df3305db57. On that integrated source, 22 history-reader tests and 77 Gateway owner and sibling tests pass. The browser test runs once in ui-e2e-serial-standalone and covers delayed speech after the answer cursor, playback, reload, a second spoken turn and speech disabled.

The full-history projection remains the sole speech-to-answer matcher. Cursor history only detects when it must request that projection. The original answer retains its identity; model replay still excludes display-only attachments. No configuration, storage or public protocol changes are required.

@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

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

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S labels Sep 15, 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: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 15, 2026, 1:04 AM ET / 05:04 UTC (Revision 5).

ClawSweeper review

What this changes

The Gateway requests a full history refresh when delayed speech arrives, allowing existing projection logic to attach audio to the original answer, and adds regression coverage to browser CI.

Merge readiness

⛔ Blocked before merge - 2 items remain

This remains a useful fix for a current history-reconciliation bug, with no blocking code finding. The previously requested visual proof remains incomplete: the after screenshot still omits the original answer text.

Priority: P2
Reviewed head: 0a21c058ca9a02e36333d92eaf5b1f0afe605e3d

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused implementation and meaningful regression coverage are sound, but the outstanding visual proof request still limits merge readiness.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: The body reports a served Control UI/local-speech run and a relevant real-Gateway browser regression, but the inspected after screenshot still omits the original answer text. The changed history reader’s visible result—text and audio together before reload—therefore remains unshown in the required screenshot pair. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The body reports a served Control UI/local-speech run and a relevant real-Gateway browser regression, but the inspected after screenshot still omits the original answer text. The changed history reader’s visible result—text and audio together before reload—therefore remains unshown in the required screenshot pair. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 9 items Current main still has the gap: The fetched main reader projects appended records individually and resets for channel mirrors, commentary, and error recovery, but has no TTS-supplement reset.
Reported release remains affected: The reader at the supplied v2026.9.4 release commit also projects one transcript entry at a time without TTS reconciliation. REST source inspection succeeded after the local release blob was unavailable.
Existing projection owns reconciliation: The new classifier projects stored display content before recognizing a supplement. The existing full-history matcher retains the answer and appends non-text supplement blocks; Control UI already clears its cursor and requests a full page after a reset.
Findings None None.
Security None None.

How this fits together

The Gateway converts stored conversation records into messages displayed by Control UI. Incremental history normally appends new records; speech supplements need the earlier answer available so the existing full-history projection can combine text and audio.

flowchart TD
  A[Stored assistant answer] --> D[Full history projection]
  B[Delayed speech supplement] --> C[Incremental history reader]
  C --> E{Speech supplement detected}
  E -->|Yes| F[Reset cursor and refresh history]
  F --> D
  E -->|No| G[Append ordinary messages]
  D --> H[One answer with text and audio]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The body reports a served Control UI/local-speech run and a relevant real-Gateway browser regression, but the inspected after screenshot still omits the original answer text. The changed history reader’s visible result—text and audio together before reload—therefore remains unshown in the required screenshot pair. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Complete next step (P2) - Add the uncropped before/after screenshot pair showing text and audio together before reload, and verify delivery in the originating chat and PR. Redact private details. Update the PR body to trigger re-review; if it does not run, ask a maintainer to comment @clawsweeper re-review.
Agent review details

Security

None.

PR surface

Source +17, Tests +443, Config +1. Total +461 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 3 18 1 +17
Tests 5 443 0 +443
Docs 0 0 0 0
Config 1 1 0 +1
Generated 0 0 0 0
Other 0 0 0 0
Total 9 462 1 +461

Review metrics

Metric Value Why it matters
Production and validation growth production +17 net lines; tests/support +443; CI +1 The small production increase reuses existing matching logic; most growth exercises delayed speech and registers that regression.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #148680
Summary: This PR is the implementation candidate for the reported cursor-history reconciliation gap.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Mantis proof suggestion

A targeted Control UI capture could resolve the remaining text-and-audio visual proof gap. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis verify delayed TTS in Control UI chat and capture redacted before/after screenshots showing the complete original answer with one audio player before reload, then confirm the same result after reload.

Technical review

Best possible solution:

Keep speech matching in the existing full-history projection and use cursor invalidation to make live chat converge to the same text-and-audio result as reload.

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

Yes, from source: append a marked speech supplement after saving the answer cursor, then request incremental history; current main projects it without the earlier answer. Runtime tests were not executed in this read-only review.

Is this the best way to solve the issue?

Yes. Reusing the existing reset response and full-history matcher is a narrow repair that avoids browser-side matching, transcript rewrites, or new configuration.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This fixes a bounded chat display inconsistency with intact transcript data and a working reload workaround.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The body reports a served Control UI/local-speech run and a relevant real-Gateway browser regression, but the inspected after screenshot still omits the original answer text. The changed history reader’s visible result—text and audio together before reload—therefore remains unshown in the required screenshot pair. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The body reports a served Control UI/local-speech run and a relevant real-Gateway browser regression, but the inspected after screenshot still omits the original answer text. The changed history reader’s visible result—text and audio together before reload—therefore remains unshown in the required screenshot pair.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Provide an uncropped after screenshot showing the original answer and audio together before reload; retain the before image and verify the pair renders in the originating chat and PR.

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-09-15T02:19:25.684Z sha b84365d3a32da92020fbae36ad6e3cdd4c9377ce :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-15T02:56:46.643Z sha 66ddf0e :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-15T04:05:10.569Z sha 57d2e52 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-15T04:27:25.142Z sha 57d2e52 :: needs real behavior proof before merge. :: none

@LiuwqGit
LiuwqGit force-pushed the feat/issue-148680-control-ui-tts-supplement-live-merge branch from b84365d to 66ddf0e Compare September 15, 2026 02:50
@obviyus
obviyus marked this pull request as draft September 15, 2026 03:58
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M and removed size: S labels Sep 15, 2026
@clawsweeper clawsweeper Bot added the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Sep 15, 2026
@obviyus

obviyus commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

landpr-approve-admin-merge
pr: 148696
head: 57d2e52
scope: owner-review

@obviyus
obviyus marked this pull request as ready for review September 15, 2026 04:22
@obviyus
obviyus marked this pull request as draft September 15, 2026 04:52
@obviyus

obviyus commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

landpr-approve-admin-merge
pr: 148696
head: 0a21c05
scope: owner-review

@obviyus
obviyus marked this pull request as ready for review September 15, 2026 04:58
@obviyus

obviyus commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

landpr-approve-unrelated-red
pr: 148696
head: 0a21c05
run: 34930873561 attempt: 4
failed: checks-node-compact-large-29 job=104272776013 conclusion=failure
check: openclaw/ci-gate

@obviyus
obviyus merged commit b0769ff into openclaw:main Sep 15, 2026
865 of 877 checks passed
@obviyus

obviyus commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Thanks @LiuwqGit!

Proof: In browser chat with local speech, the original answer keeps one playable audio attachment live and after reload. Delayed speech, a second spoken turn, and speech disabled also pass.

  • Bug: Generated speech stayed in a separate “Audio reply” until reload.
  • Fix: Cursor history requests the existing full-history merge when speech supplements an earlier answer.
Before After
Text and speech appear separately during live chat. The original answer carries one playable speech attachment.

One hosted check exhausted its 8 GiB heap in agent.test.ts. This was merged past as an unrelated runner-memory failure under maintainer approval; the identical head, merge tree, and test plan passed that job in the first attempt.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 16, 2026
…il reload (openclaw#148696)

## What Problem This Solves
Local chat displayed generated speech as a separate “Audio reply” until reload. Closes openclaw#148680.

## Why This Change Was Made
Cursor history now recognizes stored speech supplements after projecting display content, then requests the existing full-history merge. This state has one writer: the transcript owner. Speech matching stays in the full-history projection.

Production growth: history classifier +9 lines; projection export +1; cursor reset +7. Growth accepted under the owner's standing acceptance (2026-09-15).

## User Impact
The original answer keeps one playable WAV during live chat and after refresh.

## Evidence
A served Control UI with local speech reproduced the separate row on `f272cd6ee9c5`. The repaired browser flow preserves the text and attaches audio without reload. Playback, delayed speech after the answer cursor, reload, a second speech turn, and speech off pass.

Before (generated filename hidden):
![Separate audio reply](https://github.com/user-attachments/assets/0fa2de8b-e279-460a-a6ee-7d62ed7eab05)

After (generated filename hidden):
![Speech attached to the answer](https://github.com/user-attachments/assets/2f12cd83-57cb-49de-8a9f-8e27caf2d906)

## Compatibility
Uses existing transcript fields and the existing reset response.

## Consumers
Foreground chat and background history refresh use the same Gateway reader.

## Invalidation
A supplement resets the cursor; a full page applies the existing text/audio merge.

## Tests
The hosted browser command now selects the speech regression. Nine focused registration and serial-ownership checks pass.

99 Gateway tests pass on the merge with main. The registered browser regression fails on main and passes on the candidate:
`node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-tts-supplement.real-gateway.e2e.test.ts`

AI-assisted.

## Evidence detail

The browser regression fails on baseline `f272cd6ee9c5c7503b90c1f604c3b523831e0517`: the original answer contains no audio player after speech completes. It passes on repair `a4bd39cc5040a8e816ee4cb06fee7b8763f5d637`, whose production code is unchanged at `57d2e52aaa79ac7198555f09fd51d324a1b499bd`. Later test cleanup preserves the prompts and assertions.

The repair includes main through merge `b42eb0ff31015162c150820bc2170a5513e74494`, with parents `66ddf0e78e90dfe4085fb50253c88b160a14a847` and `f272cd6ee9c5c7503b90c1f604c3b523831e0517`. On that integrated source, 22 history-reader tests and 77 Gateway owner and sibling tests pass. The browser test runs once in `ui-e2e-serial-standalone` and covers delayed speech after the answer cursor, playback, reload, a second spoken turn and speech disabled.

The full-history projection remains the sole speech-to-answer matcher. Cursor history only detects when it must request that projection. The original answer retains its identity; model replay still excludes display-only attachments. No configuration, storage or public protocol changes are required.

Co-authored-by: Ayaan Zaidi <[email protected]>
@LiuwqGit
LiuwqGit deleted the feat/issue-148680-control-ui-tts-supplement-live-merge branch September 22, 2026 14:47
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 gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Control UI TTS supplement does not merge with source message during live updates

2 participants