Repository navigation
fix: speech-only replies fail when models include reasoning - #164285
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 9:00 AM ET / 13:00 UTC (Revision 3). ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherThe 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +2, Tests +44, Docs +4. Total +50 across 5 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest 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. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
@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. |
|
🦞👀 Re-review progress:
|
* 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)
…#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]>
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 intoopenclawDelivery.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; intentionalNO_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.openclaw agent --agent main --session-key … --message …: reasoning + paired speech-only blockThe 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.
incomplete-turn-recovery.test.ts,incomplete-turn-resolution.test.ts,terminal-resolution.test.ts, andpayloads.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.gpt-5-mini, reasoninglow, output budget4096, 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 forparallel_tool_callswithout tools; the corrected configuration succeeded. No response rewriting. Credentials and the live container were removed.git diff --checkpassed. No release changelog changes.