Skip to content

fix(listen): enforce live STT model capabilities - #10023

Merged
Git-on-my-level merged 3 commits into
mainfrom
codex/fix-live-stt-streaming-capability
Jul 19, 2026
Merged

Git-on-my-level merged 3 commits into
mainfrom
codex/fix-live-stt-streaming-capability

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 19, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Make live STT selection model-aware: the deployed Parakeet RNNT model is English-only, while the batch TDT model retains its broader language set.
  • Treat the client Parakeet setting as a capability-constrained preference, remove the runtime override that could bypass selection, and emit bounded fallback telemetry whenever live routing moves from Parakeet to Modulate.
  • Lock the deployment-model contract to both Parakeet charts, add a hermetic /v4/listen → selector → Modulate WebSocket → pusher regression, and configure the Parakeet-only listen-pusher gauntlet with an explicit English single-language fixture.
  • Document the live-provider boundary.

Closes #10009

Failure-Class: none

Guard rationale

The chart-to-policy test is deliberately specific rather than a shared YAML primitive: it validates the named deployed Parakeet model IDs against the provider capability policy. It would have caught the model/surface mismatch reported in #10009.

Follow-up

Verification

  • cd backend && env BACKEND_PYTEST_WORKERS=4 bash test.sh — passed (675 backend unit test files).
  • Focused selector, runtime, policy, fallback-observability, and hermetic listen-pusher wire suites — passed.
  • cd backend && .venv/bin/python -m pytest -q testing/e2e/test_listen_stt.py testing/e2e/test_listen_pusher_wire_contract.py — 18 passed.
  • bash backend/testing/e2e/run.sh -q --tb=short — 112 passed, 3 skipped.
  • npm run test:listen-pusher-stack:emulator — passed locally after the explicit single-language fixture correction.
  • cd backend && .venv/bin/python -m pytest -q tests/unit/test_streaming_deepgram_backoff.py tests/unit/test_listen_runtime_regressions.py tests/unit/test_listen_pusher_stack_ci_wiring.py — 89 passed.
  • cd backend && bash scripts/typecheck.sh — 0 errors (existing warnings only).
  • cd backend && .venv/bin/python scripts/scan_async_blockers.py --dirs routers utils — passed with 0 selected blocking findings.
  • cd backend && .venv/bin/python -m pytest -q tests/unit/test_workflow_contracts.py tests/unit/test_backend_unit_selector_output.py tests/unit/test_listen_pusher_stack_ci_wiring.py — 23 passed.
  • OMI_PR_BODY_FILE=/tmp/pr-10009-body.md make preflight — passed (19 manifest checks).

Review in cubic

@mintlify

mintlify Bot commented Jul 19, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
omi 🟢 Ready View Preview Jul 19, 2026, 7:01 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Listen fix (enforce live STT model capabilities). Approve-only — 839-line diff, large surface.

@Git-on-my-level
Git-on-my-level merged commit 12d2a8b into main Jul 19, 2026
33 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/fix-live-stt-streaming-capability branch July 19, 2026 22:51
undivisible added a commit that referenced this pull request Jul 21, 2026
#10097)

# Summary

- `PATCH /v1/users/language` now derives `single_language_mode` from the
live STT capability policy
(`config.stt_provider_policy.supports_live_multilingual_mode`) instead
of the retired Deepgram Nova-3 multi-language list.
- The client mirror (`app/lib/providers/home_provider.dart`) is updated
to the same base-code set with the same regional-variant normalization,
and documents which policy file it mirrors.
- Users whose language the live Modulate auto-detection supports but the
old 19-locale Deepgram list did not — Vietnamese, Korean, Turkish,
Arabic, Thai, and ~40 others — can now actually enter live
multi-language mode.

Fixes #10022.

# Root cause

Two stale copies of a capability decision. #10023 moved live
multi-language capability to the policy boundary
(`supports_live_multilingual_mode`, consumed by the serving path in
`utils/stt/streaming.py`), but the *preference gate* — the route that
decides `single_language_mode` when a user picks a language — still
consulted `deepgram_nova3_multi_languages`, as did its client-side
mirror. A supported user was silently locked into single-language mode
at preference-set time, before serving policy ever ran.

# Failure class

Failure-Class: none

The nearest theme is again divergent read-side policy copies rather than
mutable-state transition ownership (FC-split-mutation-authority's scope)
— same call as #10094/#10095.

# What stays untouched, and why

- `utils/stt/streaming.py`'s Deepgram runtime branch keeps
`deepgram_nova3_multi_languages`: that code selects Deepgram serving
parameters, the one place the Deepgram-specific vocabulary legitimately
lives.
- `migrations/006_auto_set_transcription_mode.py` is a historical
migration; rewriting it would change what a past migration meant.

# Product invariants affected

none (verified with `scripts/pr-preflight --suggest`)

# Validation

- New coverage extends `tests/unit/test_stt_provider_policy.py` (the
guard surface for this policy boundary): behavioral checks that the live
policy admits the newly eligible languages (`vi`, `vi-VN`, `ko`, `tr`,
`ar`, `th`, `pt-BR`, `en`) and rejects unsupported ones (`my`, `am`,
`lo`), plus a **labeled static tripwire** that the route derives
`single_language_mode` from `supports_live_multilingual_mode` and that
`deepgram_nova3_multi_languages` no longer appears in the route module.
The tripwire fails on pre-fix code by construction.
- The route wiring itself is one line; a full route-handler harness for
`routers/users.py`'s heavy import graph would have required module-scope
`sys.modules` stubbing, which the backend-module-isolation checker bans
outside the frozen legacy allowlist — hence policy-seam behavioral tests
+ tripwire, per the repo's testing guidance.
- Repo runner (file-isolated, as CI executes):
`tests/unit/test_stt_provider_policy.py` → 20 passed.
- Dart unit test (`app/test/unit/multilingual_eligibility_test.dart`)
covers the client mirror's eligibility set and normalization. **Not run
locally — this machine has no Flutter SDK**; the test is hermetic and
the app CI lane discovers `app/test/unit/`. Backend coverage of the same
decision did run locally.
- `make preflight` (local lane, this PR body) → all selected checks
pass.
- `black` clean on changed backend files.

Not exercised live: the full app→backend language-selection flow on a
device (no Flutter toolchain here). The behavior change is the
server-side gate, covered by the policy-seam tests and tripwire above.

# Out of scope, named

- The duplicated client list still exists by necessity (Dart cannot
import the Python policy); a follow-up could serve eligibility from the
backend response instead of mirroring the set. The route response
already returns `single_language_mode`, so clients that trust the server
need no list at all — the mirror only affects optimistic local state.

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/10097?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: live transcription fails and does not detect multiple languages

2 participants