Skip to content

fix: speech-only replies fail when models include reasoning - #164285

Merged
obviyus merged 1 commit into
mainfrom
fix/164256-tts-only-reply
Oct 3, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/164256-tts-only-reply

Conversation

@obviyus

@obviyus obviyus commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #164256

What Problem This Solves

Fixes voice-only replies being replaced with “Agent couldn't generate a response” when the model returns provider reasoning followed by a valid [[tts:text]]...[[/tts:text]] block. Thanks to @Twilight-Networks for the report and release comparison.

User Impact

Tagged speech-only answers complete without requiring a visible text prefix. Empty replies still fail, and incomplete tool-use turns retain their existing handling. No configuration, storage, or migration changes.

Why This Change Was Made

The regression was introduced by #146361 (8416d71015827de94225d8d3a6441e8b7fbf307f), between the reported good and bad releases. Its model-state owner began applying delivery projection to the completed assistant snapshot. The speech text correctly moves into openclawDelivery.tts.text, but the reasoning-only completion and retry checks still treated the remaining blank text as missing output.

Keep projection-before-completeness and the streaming/code/attachment fixes intact. The two reasoning-only checks now recognize nonblank authored speech facts rather than requiring visible text.

Maintainer-intent check: reviewed #149642 and #162948 plus a2bbcbf40684a; intentional NO_REPLY, pending-work guards, saved-session access errors, and compact Slack previews are unchanged.

Evidence

Baseline: de1f4385dc66f31f586b79f3e274007e0e3da253. Candidate: 50dfde6d7204c29797f51932f7376d4125a8043f. Runtime proof used isolated Linux/Node 24.21 Docker containers, built Gateways, a scripted OpenAI-compatible model, and a local stub speech endpoint.

Real entry point / case Baseline Candidate
openclaw agent --agent main --session-key … --message …: reasoning + paired speech-only block Exit 1; incomplete-turn warning; one model request Exit 0; completed; one model request
Inbound QA channel: same reasoning + speech-only block Error reply; no synthesis One synthesis request; one delivered audio attachment; empty visible text
Visible prefix + speech block Success; prefix and audio on inbound channel Unchanged
Truly empty reply Fails after the existing one retry Unchanged
Malformed, unclosed speech block Existing visible-text/speech behavior Unchanged
Paired speech-only block without provider reasoning Already succeeds on current main Unchanged

The inbound proof waits for the channel processing acknowledgment and then inspects retained outbound messages, including the delivered WAV bytes. The CLI itself does not perform automatic speech synthesis; that existing behavior is unchanged. This reconciles the report's narrower transcript excerpt with the reasoning-bearing defect identified by ClawSweeper.

  • Both new regression tests fail on baseline for the intended reasons: an unnecessary visible-answer continuation and the incomplete-turn warning. The candidate passes 84 tests across incomplete-turn-recovery.test.ts, incomplete-turn-resolution.test.ts, terminal-resolution.test.ts, and payloads.delivery-recovery.test.ts. Command: pnpm test <those four paths> --maxWorkers=1; wall time 28.39 s, runner 27.64 s. Hosted CI timing remains separate.
  • Exact-head live gate passed: real gpt-5-mini, reasoning low, output budget 4096, passive proxy, utility jobs off. One successful model request produced a speech-only answer, one stub synthesis, and one delivered audio attachment with no visible text. Two real calls total: the first was a fixture request rejected for parallel_tool_calls without tools; the corrected configuration succeeded. No response rewriting. Credentials and the live container were removed.
  • Built runtime and CLI bootstrap guard passed; git diff --check passed. No release changelog changes.

@clawsweeper

clawsweeper Bot commented Oct 3, 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.

@obviyus

obviyus commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling extensions: tts-local-cli plugin: azure-speech Azure Speech plugin extensions: fish-audio Extension: fish-audio size: XS labels Oct 3, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Oct 3, 2026
@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 9:00 AM ET / 13:00 UTC (Revision 3).

ClawSweeper review

What this changes

The PR accepts speech-only answers accompanied by model reasoning, adds regressions for retry and completion handling, and documents that no visible text prefix is required.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary on current main, and no actionable patch defect remains. The unchanged head retains sufficient runtime proof, and the ready-for-review event resolves the prior draft blocker.

Priority: P1
Reviewed head: 50dfde6d7204c29797f51932f7376d4125a8043f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct repair with strong before/after runtime evidence and useful regressions; no material contributor follow-up remains.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured exact-head evidence exercises the embedded runner through CLI and inbound built-Gateway flows, showing successful completion and delivered synthesized audio where baseline failed; a real-provider run corroborates the result. No stored-data format or migration changes are introduced.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured exact-head evidence exercises the embedded runner through CLI and inbound built-Gateway flows, showing successful completion and delivered synthesized audio where baseline failed; a real-provider run corroborates the result. No stored-data format or migration changes are introduced.
Evidence reviewed 8 items Pinned introduced change: The merge-base-to-head patch adds a nonblank speech-text exclusion to each reasoning-only check, two focused regressions, and documentation. It preserves the surrounding error, replay, and unfinished-work guards.
Current main still needs the fix: Fetched main still classifies blank visible text plus reasoning as thinking-only output without consulting extracted speech. Its reasoning retry check also lacks the speech exclusion. The linked report reproduces the failure on the latest reported release, v2026.9.8; no merged replacement fixing this behavior is established.
Existing delivery owner: Model ingress projects completed assistant messages through the existing directive parser. Payload construction already recognizes nonblank stored speech and retains it as reply metadata, so the patch repairs completion decisions without adding a competing parser or synthesis path.
Findings None None.
Security None None.

How this fits together

The embedded agent runner converts model responses into channel reply payloads and decides whether an answer needs recovery. Speech directives become delivery metadata that the existing text-to-speech pipeline consumes.

flowchart TD
  A[Model response] --> B[Extract speech directives]
  B --> C[Visible text and speech facts]
  C --> D[Retry and completion checks]
  D --> E[Completed reply payload]
  D --> F[Incomplete response recovery]
  E --> G[Speech synthesis and channel delivery]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +2, Tests +44, Docs +4. Total +50 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 2 0 +2
Tests 2 44 0 +44
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 50 0 +50

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #164256
Summary: This PR is the candidate repair for the linked voice-only completion regression; the issue should remain open until the repair merges.

Members:

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

Technical review

Best possible solution:

Keep extracted speech as an authored answer within the existing completion owner while preserving empty-output recovery and incomplete tool-turn handling.

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

Yes: reasoning plus a valid speech-only block reaches both speech-unaware checks on current main. The supplied baseline/candidate runtime comparisons corroborate that path; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes: consulting existing extracted speech facts at the two incorrect checks is a narrow repair that preserves directive projection, payload construction, and recovery safeguards.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 34d374a7ec4a.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: The linked current-release regression rejects valid voice-only answers and breaks established voice-first agent workflows.
  • 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 (live_output): The captured exact-head evidence exercises the embedded runner through CLI and inbound built-Gateway flows, showing successful completion and delivered synthesized audio where baseline failed; a real-provider run corroborates the result. No stored-data format or migration changes are introduced.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured exact-head evidence exercises the embedded runner through CLI and inbound built-Gateway flows, showing successful completion and delivered synthesized audio where baseline failed; a real-provider run corroborates the result. No stored-data format or migration changes are introduced.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head patch adds a nonblank speech-text exclusion to each reasoning-only check, two focused regressions, and documentation. It preserves the surrounding error, replay, and unfinished-work guards. (src/agents/embedded-agent-runner/run/incomplete-turn-recovery.ts:168, 50dfde6d7204)
  • Current main still needs the fix: Fetched main still classifies blank visible text plus reasoning as thinking-only output without consulting extracted speech. Its reasoning retry check also lacks the speech exclusion. The linked report reproduces the failure on the latest reported release, v2026.9.8; no merged replacement fixing this behavior is established. (src/agents/embedded-agent-runner/run/incomplete-turn-resolution.ts:92, 34d374a7ec4a)
  • Existing delivery owner: Model ingress projects completed assistant messages through the existing directive parser. Payload construction already recognizes nonblank stored speech and retains it as reply metadata, so the patch repairs completion decisions without adding a competing parser or synthesis path. (src/agents/embedded-agent-runner/run/payloads.ts:278, 50dfde6d7204)
  • Actual merge result: The test merge's raw parents are the pinned base followed by the exact PR head. Comparing its result with that base preserves both narrow production additions; there is no demonstrated removal of base-only behavior. (src/agents/embedded-agent-runner/run/incomplete-turn-resolution.ts:95, 1419ea8f1bc4)
  • After-fix runtime evidence: The captured PR body records isolated built-Gateway comparisons at the exact head: CLI completion succeeds with one model request; inbound channel processing produces one synthesis request and one retained audio attachment with empty visible text. It also records a real-provider exact-head run with the same delivered result, plus unchanged empty, malformed, visible-prefix, and no-reasoning controls. Source identity is the supplied snapshot 7ecf40386ccb036591f804603c50239a1e36c90ff07daa3d7f06c11e95764a14. These are contributor-recorded observations, not tests executed by this review. (50dfde6d7204)
  • Re-review blocker resolved: The prior completed review at this same head had no findings and required only leaving draft state. The supplied ready-for-review event and live REST response confirm draft=false, the same head, an open unmerged PR, and mergeable=true. (50dfde6d7204)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • sjf-oa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (2 earlier review cycles)
  • reviewed 2026-10-03T11:58:57.204Z sha 50dfde6 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-03T12:23:58.603Z sha 50dfde6 :: needs changes before merge. :: none

@obviyus
obviyus marked this pull request as ready for review October 3, 2026 12:56
@obviyus

obviyus commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

The draft is now ready for review. The exact head remains 50dfde6; no source or proof inputs changed. This resolves the sole remaining item in the review.

@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus
obviyus merged commit b12b4b9 into main Oct 3, 2026
197 of 202 checks passed
@obviyus
obviyus deleted the fix/164256-tts-only-reply branch October 3, 2026 13:07
vincentkoc added a commit that referenced this pull request Oct 3, 2026
* origin/main:
  fix(test): restore fixture state and await async completion (#164222)
  refactor(sessions): stage and settle pending inputs in workers (#164284)
  fix: speech-only replies fail when models include reasoning (#164285)
  fix(nextcloud-talk): avoid webhook migration for unconfigured channels
  fix: guide background skill reviews through Workshop proposals (#164292)
  test(build): reject AI dependencies in retained config repairs
  refactor(channels): require canonical private-network settings (#163535)
  fix(memory): migrate embedding cache in bounded batches and record oversized rows (#164303)
  feat(state): incognito actor memory and Codex history routing (P5c, inactive) (#164224)
  refactor(synology-chat): remove unused route account ID (#164280)
  test(ui): await web push preference publications (#164295)
  perf(scripts): avoid compiler projects for runtime import parsing (#164243)
  fix(worktrees): create workspaces from nested Windows repositories (#164249)
  test(agents,channels,cli): remove low-value tests (batch d173) (#164302)
  perf(workboard): serve cards per board revision and push changes instead of polling (#164301)
  refactor(sqlite): deslop sqlite stores (#164271)
  chore(ui): refresh control ui locales (#164299)
  refactor(events): deslop listener and disposal plumbing (#164221)
  fix: canonicalize fresh worker reasoning signatures (#164287)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
…#164285)

Fixes openclaw#164256.

Since 2026.9.6, an assistant reply consisting only of a valid `[[tts:text]]...[[/tts:text]]` block failed with "Agent couldn't generate a response". openclaw#146361 (89e700b) projects completed model state before the completeness check, and that projection had no visible text, so the speech facts were not counted as content. The completeness guards now count speech facts as content. The projection order from openclaw#146361 is kept, and empty replies still fail.

Proof: a real `openclaw agent` run with a reasoning-bearing TTS-only reply failed on base and succeeded with this change. On a real inbound QA channel, base returned an error with no synthesis, and this change synthesized once and delivered one audio attachment with empty visible text. Empty reply, visible prefix, plain TTS and malformed-tag controls are unchanged. The regression tests fail on base and pass here. In a live gpt-5-mini turn, a speech-only answer was synthesized and delivered. Thanks @Twilight-Networks for the clear version-bisected report.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation extensions: fish-audio Extension: fish-audio extensions: tts-local-cli P1 High-priority user-facing bug, regression, or broken workflow. plugin: azure-speech Azure Speech plugin proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

[Bug]: TTS-only [[tts:text]] replies fail as incomplete turns starting in 2026.9.6

1 participant