Skip to content

fix(app): keep Omi control text frames off audio-only custom STT sockets (#24191) - #25295

Open
shubhxho wants to merge 3 commits into
BasedHardware:mainfrom
shubhxho:fix/custom-stt-text-frames-24191
Open

shubhxho wants to merge 3 commits into
BasedHardware:mainfrom
shubhxho:fix/custom-stt-text-frames-24191

Conversation

@shubhxho

@shubhxho shubhxho commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

What changed and why

Fixes #24191. With Cloud Provider → Custom (Live), the Custom STT log filled with [customLive] Unsupported message type: String. The same warning also fires for the other custom STT primaries, which are audio-only too.

Root cause: CompositeTranscriptionSocket.send used to hand every message to the custom STT primary before deciding what to forward to the Omi socket. All custom STT primaries (polling, streaming, and Gemini) accept Uint8List/List<int> and warn and drop anything else. Omi JSON control frames (capture_evidence_frame, _sendClientState, sendText, speaker assignment) therefore reached the custom STT sender and logged a warning each time.

What is already on main: David Zhang's f091e05 (merged in #25975) already keeps those text frames off the Custom Live primary, behind OMI_CUSTOM_LIVE_CAPTURE_FIX (customLiveCaptureFixEnabled, default on). It also pairs evidence with the following audio frame on the Omi socket and honors forwardRawAudioToSecondary. This PR merges current main so that work stays intact, including the flag-off path that restores sending text to the Custom Live primary.

What this PR adds on top of that flag: the same OMI_CUSTOM_LIVE_CAPTURE_FIX gate now covers the other custom STT providers (custom, geminiLive, deepgramLive, onDeviceWhisper, and any other non-Omi composite primary). They share the same audio-only contract, so a second switch would only create a split kill path. Disabling the existing flag still restores the old send-text-to-primary behavior for Custom Live and those providers together. sendEvidenceAudioFrame is unchanged: evidence never goes to the primary, and the evidence/audio pair still reaches Omi only when raw-audio forwarding is enabled.

Product invariants affected

none

How it was verified

Flutter 3.44.5 (the CI pin) on Linux. The app was set up the same way as the bootstrap in app/test.sh (local Firebase options, empty API_BASE_URL, flutter pub get). Generated envied files were reused because the env sources matched the already-bootstrapped tree.

  • flutter test test/unit/composite_transcription_socket_test.dart: 36 passed.
  • flutter test on the other files that touch the composite, PureStreamingSttSocket, or transcription_service.dart (17 files across test/services/sockets, test/services/capture, test/providers, test/spine, test/unit and test/widgets): 268 passed.
  • flutter analyze on both changed Dart files: no issues. dart format --line-length 120 --output=none --set-exit-if-changed: no changes.
  • scripts/pr-preflight --pr-body-file <this body>: passed (27 checks). Updates app/changelog/unreleased/20261114-custom-stt-log-control-frames.json.

Not verified: a device run against a real custom STT bridge, and the compile-time flag-off path (--dart-define=OMI_CUSTOM_LIVE_CAPTURE_FIX=false).

Tests

  • Existing Custom Live tests from f091e05 / fix(app): recover stalled Android Custom Live Pendant audio #25975 are kept: Omi controls stay off the Custom Live primary, and evidence follows Omi raw-audio consent.
  • New tests routes Omi controls away from the audio-only {custom,geminiLive,deepgramLive,onDeviceWhisper} primary (#24191): the same control-text rule applies to those providers under the default (flag-on) path.
  • New test sends audio to a polling custom STT primary and Omi control text only to Omi (#24191): a custom primary receives only Uint8List and List<int>; the Omi socket still receives the evidence text plus the audio.
  • New test a live custom STT WebSocket for a non-Live provider receives only binary audio (#24191): a real PureStreamingSttSocket with sttProvider=custom against a loopback dart:io WebSocket server. The server receives only the binary audio, and the Custom STT log has no Unsupported message type entry.

UI evidence

UI-Evidence: none -- socket routing change, no UI

Failure class (fixes)

Failure-Class: none

View guided diff

…ets (BasedHardware#24191)

CompositeTranscriptionSocket.send handed every message to the custom STT
primary before deciding what the Omi socket gets. Every primary (polling,
streaming, Gemini) accepts audio only, so each capture_evidence_frame,
client-state and speaker-assignment JSON frame logged 'Unsupported message
type: String' in the Custom STT log, flooding it during live capture.

Text frames now go to the Omi socket only; audio routing is unchanged.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T05:27:36.419665Z c833de3 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Git-on-my-level

Copy link
Copy Markdown
Member

Verdict: correct, minimal fix for #24191 with genuinely good regression coverage — ready for maintainer merge consideration; no blocking findings.

Per file:

  • app/lib/services/sockets/composite_transcription_socket.dart — send() now gates primarySocket.send on message is List<int> (Uint8List included). Verified this is wire-identical for providers: all three custom STT primaries (PureStreamingSttSocket.send, GeminiStreamingSttSocket.send, and the polling primary in pure_polling.dart:322) accept only Uint8List/List and drop anything else right after a log line, so the removed String sends never reached any endpoint. Omi-secondary routing, forwardRawAudioToSecondary, and degraded mode are all untouched. Current main still has the unconditional send, so this isn't already fixed.
  • app/test/unit/composite_transcription_socket_test.dart — the two new tests are the right shape: a fake-socket routing test with identity (same()) assertions, and a real loopback-WebSocket end-to-end test asserting no 'Unsupported message type' entries land in CustomSttLogService. The updated control-message expectation correctly pins the new behavior.
  • app/changelog/unreleased/20261114-custom-stt-log-control-frames.json — accurate one-line entry.

Notes:

  • UX: Custom (Live) STT users stop seeing their diagnostic log flooded during recording; transcription behavior itself is unchanged.
  • Overlap: open PR fix(android): stabilize Custom Live Pendant capture #23643 carries its own broader version of this routing fix plus capture-stability work — maintainers should pick which lands so the other rebases cleanly.
  • Nit (non-blocking): the polling primary logs via Logger.debug rather than CustomSttLogService.warning like the streaming/Gemini primaries, so the changelog wording slightly overstates the polling case.

USER IMPACT: Custom live transcription users no longer get their STT diagnostic log spammed with "Unsupported message type" warnings while recording — transcription itself behaves exactly as before.

Nothing further needed from my side; leaving for human maintainer review (merge decision, plus the #23643 overlap).


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution flutter flutter work labels Nov 14, 2026
Integrate David Zhang's Custom Live capture fix (f091e05, merged in
BasedHardware#25975) and later main. Conflict in CompositeTranscriptionSocket.send
and its tests is resolved in favor of main's OMI_CUSTOM_LIVE_CAPTURE_FIX
gate so Custom Live flag behavior stays intact. The broader custom-STT
rule lands in a follow-up commit on top of that flag.
…ers (BasedHardware#24191)

Main's f091e05 (merged in BasedHardware#25975) already keeps Omi control text off the
Custom Live primary, behind OMI_CUSTOM_LIVE_CAPTURE_FIX. Every other custom
STT primary (polling, streaming, Gemini) is also audio-only, so the same
flag now covers them too. Disabling the flag still restores the old
send-text-to-primary path for Custom Live and those providers together.
No second switch is added.

Custom Live evidence pairing and flag-off behavior from main are unchanged.
@Git-on-my-level

Copy link
Copy Markdown
Member

Since my last review: addressed (the branch now merges current main, so the maintainer's OMI_CUSTOM_LIVE_CAPTURE_FIX work from f091e05 is preserved, and the fix was reworked from message-type gating inside send() to a provider-based _routesOmiControls gate - verified on this head) - still open (nothing from the prior review) - newly introduced (none).

Verdict: correct and minimal - no blocking findings. The production delta on this head is one widened gate, and the tests genuinely pin the behavior.

  • app/lib/services/sockets/composite_transcription_socket.dart - _routesOmiControls (line 342) becomes customLiveCaptureFixEnabled && _isAudioOnlyCustomSttPrimary; the new getter (lines 346-352) excludes only SttProvider.omi / omiParakeet. I traced both construction sites - transcription_service.dart:637 and :851 each take sttProvider from CustomSttConfig.provider, and createFromCustomConfig (line 667) short-circuits provider == omi before a composite is ever built - so the exclusions are pure defense and no real path loses controls. The send() body (lines 355-368) is unchanged from main: audio still reaches the primary, control text still always reaches the Omi secondary (line 365), and disabling the flag restores the old send-text-to-primary path for Custom Live and the other custom providers together - one kill switch, no split.
  • app/test/unit/composite_transcription_socket_test.dart - new coverage routes controls away from custom / geminiLive / deepgramLive / onDeviceWhisper primaries, checks both Uint8List and plain List audio on the polling path, and adds a real loopback-WebSocket test asserting the wire receives only binary audio and the Custom STT log ends with zero "Unsupported message type" entries - that last one directly reproduces Custom Live STT floods logs with 'Unsupported message type: String' when Omi controls reach audio-only socket #24191 and proves the fix.
  • app/changelog/unreleased/20261114-custom-stt-log-control-frames.json - accurate one-line user-facing description.

Why the widening is safe: every composite primary is an audio-only custom-STT socket (PurePollingSocket.send silently ignores non-Uint8List; streaming primaries warn-and-drop), so no provider loses behavior it ever used, and the Omi secondary path is byte-for-byte main's. No new network or data surfaces; the new test server binds loopback only.

USER IMPACT: users on a custom STT provider stop getting their Custom STT log flooded with "Unsupported message type: String" warnings during recording; transcription itself is unchanged.

Nothing further needed from me as a reviewer - ready for maintainer merge consideration.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flutter flutter work positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom Live STT floods logs with 'Unsupported message type: String' when Omi controls reach audio-only socket

2 participants