Skip to content

fix(android): Talk keeps beeping without replying and ignores the stt-tts voice mode - #150175

Merged
IWhatsskill merged 1 commit into
openclaw:mainfrom
guarismo:fix/android-native-talk-transcript
Sep 16, 2026
Merged

IWhatsskill merged 1 commit into
openclaw:mainfrom
guarismo:fix/android-native-talk-transcript

Conversation

@guarismo

@guarismo guarismo commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Closes #150105
Closes #150104

What Problem This Solves

Fixes: Android Talk keeps beeping and never answers when it uses on-device speech recognition, and it ignores talk.realtime.mode: "stt-tts", so a configured Talk voice can't be used.

User Impact

User impact: on Android, Talk now sends what you say and speaks the reply. Operators who set talk.realtime.mode to stt-tts get their configured Talk speech provider and voice (via talk.speak) instead of the realtime provider's voice. Talk with realtime mode (the default) is unchanged.

Why This Change Was Made

  • Recognized speech was never sent. Native Talk restarted the recognizer as soon as speech ended. Google's recognizer hands over the final hypothesis at end of speech and reports onResults only when the session closes, so the restart cancelled the session, and the cancel's ERROR_CLIENT cleared the listening state. The silence check then skipped sending. onResults/onError already restart the recognizer, so the restart at end of speech is removed.
  • stt-tts was ignored. Android always used the gateway relay, which carries only realtime sessions (the gateway requires managed-room for stt-tts). stt-tts now routes Android to native Talk: device STT, then chat.send, then talk.speak.

Production code is net zero lines (11 removed, 11 added).

Evidence

Current head validation: 1818eeae61f46be737a9d3ccb92ce6638b2fb99f passed CI run 35144123427, including Play, third-party and Wear unit tests/lint, ktlint, and the required CI gate. Independent P0–P2 review found no actionable findings. The device observations below remain contributor-provided; they were not repeated during maintainer review.

Tests

  • New TalkModeManagerTest.nativeTalkKeepsRecognitionOpenFromEndOfSpeechUntilResults fails on main with End of speech must not cancel and restart the session before its results arrive, and passes with the fix.
  • New TalkModeConfigParsingTest.routesSttTtsModeToNativeTalkEvenWhenRelayIsSupported fails on main and passes with the fix.
  • ./gradlew :app:testPlayDebugUnitTest :app:ktlintCheck passes: 3277 tests, 0 failures, before rebase. After rebasing onto 7d1c3674b60, the voice package (266 tests) and ktlint pass again.

Live on a device. OnePlus 8T (Android 14), playDebug build of this branch, gateway 2026.9.4, talk.realtime.mode: "stt-tts", and an OpenAI-compatible local TTS server as talk.provider.

  • Before the fix, with a temporary log line in the silence check, the final phrase was stored, but after the restart at end of speech every silence check was skipped:
    onEndOfSpeech → scheduleRestart delay=350
    onError error=5 (ERROR_CLIENT) listening=true → false
    checkSilence skip: not listening last='hello there how's it going'   (×3, then ×3 again after error=7)
    
    On the release app, no chat.send ever reached the gateway, and Talk looped on the recognizer start beep.
  • After the fix, 3 of 3 turns were sent and spoken, and the app chose native Talk from stt-tts alone (no gpt-live model override):
    12:42:53 chat.send ok   12:43:08 assistant text ok chars=220   12:43:27 talk.speak ok durMs=18528
    12:43:43 chat.send ok   12:44:01 assistant text ok chars=102   12:44:14 talk.speak ok durMs=12668
    12:44:23 chat.send ok   12:44:41 assistant text ok chars=315   12:45:04 talk.speak ok durMs=23371
    
    An earlier session with the restart removed (plus diagnostic logs) went 4 of 4, with 0 ERROR_CLIENT and 0 skipped silence checks.

Not covered here (pre-existing, filed separately):

The Talk button's setup readiness still reflects only the realtime provider, so a gateway with stt-tts and no realtime provider may still show Talk as needing setup. I didn't change that.

🤖 Generated with Claude Code

@clawsweeper

clawsweeper Bot commented Sep 16, 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.

@guarismo
guarismo marked this pull request as ready for review September 16, 2026 16:56
@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 Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 5:24 PM ET / 21:24 UTC (Revision 3).

ClawSweeper review

What this changes

Android Talk waits for speech recognition results before restarting and routes the configured stt-tts mode through native recognition, Gateway chat, and the configured speech provider.

Merge readiness

✅ Ready for maintainer review

This PR remains necessary: current main retains both reported defects. The focused changes and contributor-provided device logs support the fix, and no blocking introduced defect was found.

Priority: P1
Reviewed head: 1818eeae61f46be737a9d3ccb92ce6638b2fb99f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant device evidence, regression coverage, and no actionable introduced defect.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (logs): Contributor-provided Android 14 device logs exercise TalkModeManager through real recognition, chat.send, and talk.speak: three consecutive turns completed with stt-tts selecting the configured speech provider. The before-fix trace shows the cancelled recognition session; CI and regression tests supplement this device evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): Contributor-provided Android 14 device logs exercise TalkModeManager through real recognition, chat.send, and talk.speak: three consecutive turns completed with stt-tts selecting the configured speech provider. The before-fix trace shows the cancelled recognition session; CI and regression tests supplement this device evidence.
Evidence reviewed 8 items Introduced changes and current-main necessity: The complete pinned introduction contains only the Android parser, recognition callback, and two regression tests. Comparing the production files with fetched main shows that main still lacks the stt-tts guard and still schedules a restart at end of speech.
Recognition lifecycle: The full manager was inspected. End-of-speech becomes a no-op; results and errors retain restart ownership. The silence monitor finalizes a stored transcript, retires recognition before synthesis, and resumes capture after the reply. Push-to-talk already skipped the removed end-of-speech restart.
Existing native path and transport contract: The manager's startup branch already selects native Talk when relay eligibility is false. Gateway session handling rejects stt-tts outside managed-room, supporting reuse of native chat and talk.speak instead of passing stt-tts to Android's realtime relay.
Findings None None.
Security None None.

How this fits together

Android Talk turns microphone input into an agent conversation and spoken replies. Gateway configuration selects between realtime audio relay and the existing native speech-to-text/chat/text-to-speech path.

flowchart TD
  A[Gateway Talk configuration] --> B{Selected voice mode}
  B -->|Realtime eligible| C[Realtime audio relay]
  B -->|stt-tts| D[Android speech recognition]
  D --> E[Transcript after silence]
  E --> F[Gateway agent chat]
  F --> G[Configured speech synthesis]
  G --> H[Spoken reply]
  C --> H
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +47, Other 0. Total +47 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 47 0 +47
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 11 11 0
Total 4 58 11 +47

Review metrics

None.

Technical review

Best possible solution:

Keep recognition restart ownership with terminal callbacks and honor explicit stt-tts configuration through the existing native Talk pipeline.

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

Yes: the current-main restart and mode-selection paths match the reported failures, with concrete device logs and focused regression cases supplied. This read-only review did not execute Android code.

Is this the best way to solve the issue?

Yes: the patch removes a premature restart and reuses the established native speech pipeline without adding configuration or changing the default realtime selection.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: The reported Android native Talk workflow drops spoken turns before Gateway submission and never answers on the affected device.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): Contributor-provided Android 14 device logs exercise TalkModeManager through real recognition, chat.send, and talk.speak: three consecutive turns completed with stt-tts selecting the configured speech provider. The before-fix trace shows the cancelled recognition session; CI and regression tests supplement this device evidence.
  • proof: sufficient: Contributor real behavior proof is sufficient. Contributor-provided Android 14 device logs exercise TalkModeManager through real recognition, chat.send, and talk.speak: three consecutive turns completed with stt-tts selecting the configured speech provider. The before-fix trace shows the cancelled recognition session; CI and regression tests supplement this device evidence.

Evidence

What I checked:

  • Introduced changes and current-main necessity: The complete pinned introduction contains only the Android parser, recognition callback, and two regression tests. Comparing the production files with fetched main shows that main still lacks the stt-tts guard and still schedules a restart at end of speech. (apps/android/app/src/main/java/ai/openclaw/app/voice/TalkModeGatewayConfig.kt:56, afc27e774fda)
  • Recognition lifecycle: The full manager was inspected. End-of-speech becomes a no-op; results and errors retain restart ownership. The silence monitor finalizes a stored transcript, retires recognition before synthesis, and resumes capture after the reply. Push-to-talk already skipped the removed end-of-speech restart. (apps/android/app/src/main/java/ai/openclaw/app/voice/TalkModeManager.kt:3249, 1818eeae61f4)
  • Existing native path and transport contract: The manager's startup branch already selects native Talk when relay eligibility is false. Gateway session handling rejects stt-tts outside managed-room, supporting reuse of native chat and talk.speak instead of passing stt-tts to Android's realtime relay. (src/gateway/talk/handlers/session.ts:447, 1818eeae61f4)
  • Regression coverage: The added recognition test supplies a partial transcript followed by end-of-speech without immediate final results, then verifies no replacement recognition intent and one transmitted phrase. Existing neighboring coverage exercises immediate results, playback completion, retired callbacks, and push-to-talk takeover. Parser coverage retains explicit realtime and absent-mode cases. (apps/android/app/src/test/java/ai/openclaw/app/voice/TalkModeManagerTest.kt:1053, 1818eeae61f4)
  • Real Android after-fix evidence: The complete supplied PR body records a OnePlus 8T running Android 14 and a branch playDebug build against Gateway 2026.9.4. With stt-tts alone selecting native Talk, three of three turns reached chat.send, returned assistant text, and completed talk.speak through the configured local speech provider. Before-fix logs show the premature restart, ERROR_CLIENT, and skipped silence checks. These are contributor observations, not reviewer-executed tests; the captured context sourceRevision is b1ba04aefbaf1aa93819e5b18c02f4da709f602e0d8fc769e52fe90c82e90a7e.
  • Release comparison: The supplied latest release, v2026.9.4, also has the parser without mode selection. The proposed mode fix is therefore absent from both that release and fetched main. (apps/android/app/src/main/java/ai/openclaw/app/voice/TalkModeGatewayConfig.kt:53, 3a9d69db306c)

Likely related people:

  • IWhatsskill: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: 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-09-16T17:06:02.462Z sha 428474b978343702c6809bef246ae2929ae0194c :: needs maintainer review before merge. :: none
  • reviewed 2026-09-16T20:08:43.138Z sha 1818eea :: needs maintainer review before merge. :: none

… mode

Native Talk restarted the recognizer on onEndOfSpeech. Google's recognizer
delivers the final hypothesis at end of speech and reports onResults only when
the session closes, so the restart cancelled the session, and the cancel's
ERROR_CLIENT cleared listening. checkSilence then skipped finalization, so
Talk kept beeping without sending chat.send. onResults/onError already own
the restart.

Android also always used the gateway relay for Talk, ignoring
talk.realtime.mode. gateway-relay carries only realtime sessions, so
mode "stt-tts" now routes to native Talk (device STT, chat.send, talk.speak),
which uses the configured Talk speech provider and voice.

Fixes openclaw#150105
Fixes openclaw#150104

Co-Authored-By: Claude Opus 5 <[email protected]>
@guarismo
guarismo force-pushed the fix/android-native-talk-transcript branch from 428474b to 1818eea Compare September 16, 2026 20:02
@IWhatsskill

Copy link
Copy Markdown
Contributor

Final maintainer verification for 1818eeae61f46be737a9d3ccb92ce6638b2fb99f:

  • Verified the two repairs: TalkModeManager.kt:onEndOfSpeech no longer restarts recognition prematurely, and TalkModeGatewayConfig.kt:realtimeRelayModelSupported routes explicit stt-tts through native Talk and the configured speech provider.
  • Fresh independent P0–P2 autoreview found no actionable findings. Existing realtime defaults, push-to-talk handling, and retired-recognizer callback protection remain unchanged.
  • ClawSweeper reviewed this exact head on September 16, 2026, at 20:08 UTC with no actionable findings.
  • Passed scripts/pr review-validate-artifacts 150175, OPENCLAW_TESTBOX=1 scripts/pr prepare-run 150175, and scripts/pr merge-verify 150175. The prepared and remote heads are identical.
  • The PR body contains the contributor’s OnePlus 8T/Android 14 evidence, including three successful spoken turns. Device testing was not independently repeated during maintainer review; the documented pre-existing limitations remain outside this fix.
  • Exact-head CI passed, including Play, third-party and Wear unit tests/lint, ktlint, and the required CI gate: https://github.com/openclaw/openclaw/actions/runs/35144123427. Review artifacts are validated; ready for maintainer merge.

Thanks @guarismo for the fix and device verification.

@IWhatsskill
IWhatsskill merged commit c10542c into openclaw:main Sep 16, 2026
67 checks passed
@guarismo
guarismo deleted the fix/android-native-talk-transcript branch September 16, 2026 21:40
@IWhatsskill

Copy link
Copy Markdown
Contributor

Merged via squash.

Prepared head: 1818eeae61f46be737a9d3ccb92ce6638b2fb99f
Landed commit: c10542c855ead83cb9f51657f32ab892c930e513

Verified that the landed commit is on main.

threely-lab pushed a commit to threely-lab/openclaw that referenced this pull request Sep 17, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
…#150175)

Stop restarting native speech recognition at end of speech, which could
cancel the pending transcript before chat.send. Leave restart handling
with the existing result and error callbacks.

Honor talk.realtime.mode=stt-tts by selecting the existing native
recognition, Gateway chat, and talk.speak pipeline, using the configured
Talk speech provider and voice while preserving realtime defaults.

Add regression coverage for premature recognition restarts and explicit
stt-tts selection.

Fixes openclaw#150105
Fixes openclaw#150104

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

Labels

app: android App: android 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. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

2 participants