Repository navigation
fix(listen): enforce live STT model capabilities - #10023
Merged
Merged
Conversation
Failure-Class: none
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
kodjima33
approved these changes
Jul 19, 2026
kodjima33
left a comment
Collaborator
There was a problem hiding this comment.
Listen fix (enforce live STT model capabilities). Approve-only — 839-line diff, large surface.
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. -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/v4/listen→ selector → Modulate WebSocket → pusher regression, and configure the Parakeet-only listen-pusher gauntlet with an explicit English single-language fixture.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).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).