Skip to content

fix(stt): qualify unknown speech before Parakeet dispatch - #23038

Merged
Git-on-my-level merged 5 commits into
mainfrom
lane/wrong-script
Oct 21, 2026
Merged

Git-on-my-level merged 5 commits into
mainfrom
lane/wrong-script

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Unknown or multilingual batch speech could produce nonempty Latin phonetics from Parakeet and bypass empty-only recovery. Qualify unknown audio with a bounded independent language probe before choosing the recognizer: confident supported speech keeps Parakeet; unsupported or uncertain speech uses Modulate. Preserve custody and fenced multilingual recovery for pre-admitted unsafe units.

  • Default on: STT_PRERECORDED_LANGUAGE_GUARD_ENABLED; only false disables new probes/restores ordinary prerecorded selection. The worker's frozen-language proof barrier and multilingual custody remain active across rollback.
  • The existing Modulate key serves a language-only probe of at most 30 seconds, with an 8-second timeout and no retry. Sync pins the actual provider before segment dispatch/accounting; intake freezes language evidence and confidence for the GPU worker. Named supported inputs and qualified native records keep their existing provider preference.
  • Add low-cardinality detection/probe/route telemetry and seven synthetic wrong-script soak fixtures. The private ramp gate separately requires completed-unit route coverage and rejects unsafe Parakeet decisions. Missing evidence fails closed.
  • Previously pinned paid intents and qualified operator minimal redrive retain their existing contracts. No production data was read beyond aggregate counters/settings counts and sanitized serving metadata; no deployment, environment change or production write.

Validation: file-isolated backend/test.sh suites through omi-heavy: 290 focused checks passed, then 381 checks in all affected CI-file suites passed after merging current main. Coverage includes language probe/error/cap boundaries, actual provider ordering, rollback custody, all seven soak languages, two-provider recovery, sync v2, and simulation goldens without regeneration. Private fleet gate: 154 offline tests passed; first full local preflight passed 36 checks. The first CI run exposed missing language adapters/declarations in synthetic workers and fixture policy compatibility; these were fixed. Exact-head CI and Luna delta review are required before merge.

Product acceptance still requires the lead's serving-SHA multilingual soak. Tests use a synthetic corpus and mocked provider transports; no new live vendor transcription or deployed quality claim is made. First-30-second language detection can miss later code switching or a confident classifier error.

Failure-Class: new

Line-Count-Exception: backend/utils/sync/pipeline.py | 3612 -> 3644 | Keep detected provider selection and actual segment/job accounting at the existing fenced dispatch boundary; the reusable detector is extracted to its own module.

Use bounded independent audio language detection to preserve the cheap
Parakeet route for confident supported speech and send unsupported or
uncertain speech to multilingual transcription. Retain durable custody
for pre-admitted unsafe units and add synthetic wrong-script regression.

Failure-Class: new
Keep language counters in the existing batch_pipeline GMP namespace and
prove that the actual sync exporter keeps them. Capture each intake unit's
duration before its funded-probe callback crosses the executor boundary.

Failure-Class: new
Preload pure language metric modules before the shared sync dependency
stub window so test cleanup cannot orphan registered collectors.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T13:22:31.937688Z 917edd2 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.

Retain the worker proof boundary when new probes are disabled, record the
actual configured provider route, and qualify synthetic stack/simulation
fixtures through their declared English language adapters.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 917edd2d0e

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1170 to +1171
selected = select_decision(language, decision, get_prerecorded_service)
provider = get_prerecorded_provider(resolved, selected_service=selected)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Propagate the probed provider to callers

When an unknown/multilingual input is confidently detected as a supported language, this selection can replace the caller's initial Modulate choice with Parakeet, but the wrapper returns only the transcript. Voice/PTT callers in utils/chat.py and routers/chat.py call get_prerecorded_service() before transcription and retain that provisional tuple for TranscriptionAttempt, failure classification, and the REST stt_provider/stt_model response. Consequently, supported multilingual audio is executed by Parakeet while failures, telemetry, and client-visible metadata report Modulate/Velma; resolve the provider before callers establish accounting or expose the actual selection alongside the result.

Useful? React with 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit 3dd11ea into main Oct 21, 2026
62 of 64 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/wrong-script branch October 21, 2026 13:28
ZhaZhaBei pushed a commit to ZhaZhaBei/omi that referenced this pull request Oct 22, 2026
…; legacy-off probe proof (lead cfcaba)

- BasedHardware#23038's intake tests pass a real BatchUnitPolicy: integration's intake records the
  route with dataclasses.replace (contract (c)), which a SimpleNamespace cannot take.
- New test_legacy_off_keeps_language_probe_and_never_parakeet_for_unsupported: with
  legacy sync draining or dark, a declared unsupported language takes the C8 provider
  (Modulate) route and never Parakeet; unknown speech is not sent to legacy, runs the
  bounded language-ID probe on the CPU host and is frozen 'und' when uncertain.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

1 participant