Repository navigation
feat(backend): alert on live-STT chain exhaustion and conversation fragmentation - #15189
Merged
Git-on-my-level merged 1 commit intoSep 20, 2026
Merged
Conversation
…agmentation The 2026-09-19 outage died in initialize_stt() before LiveSTTAttempt existed, so the live-STT failure-ratio alert stayed green. Watch exhausted fallbacks over listen accepts, close that blind spot, and surface sync created-vs-merged. Co-authored-by: Cursor <[email protected]>
Git-on-my-level
deleted the
feat/stt-exhaustion-and-fragmentation-alerts
branch
September 20, 2026 16:38
This was referenced Sep 20, 2026
Git-on-my-level
added a commit
that referenced
this pull request
Sep 20, 2026
…T chain Independent review (Cursor Grok) plus coordinator findings, all behind the same dark flags: - 18 s window buffer; sustained overload sheds with capacity_full and opens the pod's Parakeet circuit instead of killing sessions that still get 200s. - Last-resort dialing never bypasses an account-state cooldown and never forces a shedding TDT leg. - Fail-closed/forced-active VAD only for the windowed leg; other legs on the configured chain keep today's fail-open gate and honour VAD_GATE_MODE / client override. - Excluded session shapes drop only the parakeet-window token. - Non-terminal leg skips/failures emit degraded + leg-attempt metric; exhausted is emitted once per terminal chain so the #15189 pages stay truthful with the flag on. - Remove the init-terminal critical rule (it would fire immediately in today's prod). - Drain releases admission at once; malformed 200/413/semaphore-queue timeouts are session-local; only 5xx/acquired-POST timeouts feed the serve-error circuit. - Pass window_uid only when the managed chain is on (legacy selector call shape while dark). - Incident-history docstrings moved into utils/stt/ARCHITECTURE.md. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Git-on-my-level
added a commit
that referenced
this pull request
Sep 20, 2026
…n STT connect chain with a Soniox leg (dark in prod) (#15234) * feat(backend): rampable windowed Parakeet TDT live leg, config-driven STT connect chain with a Soniox leg, per-leg breakers Everything is dark unless STT_CONNECT_ORDER_FROM_CONFIG=true and PARAKEET_WINDOW_ALLOCATION_PERCENT>0; prod values keep both off, dev turns them on. - Connect-time fallback order derives from STT_SERVICE_MODELS, adds a Soniox leg, passes every leg from every primary branch, never re-walks a failed provider. - New `parakeet-window` streaming token: bounded 6 s windows over /v1/transcribe (TDT 0.6b v3) behind a fail-closed VAD gate, eligible on the user's requested base language, with stable per-uid allocation, a process session cap, one in-flight POST per session and clean overflow to the next leg. - Leg-level circuit breakers, long account-state cooldown (Deepgram 401/402/403, Soniox budget exhaustion), bounded half-open probes, last-resort primary dial. - Live-STT metrics and Grafana rules; stt_live_session/connection_lost join the bounded fallback vocabulary. Implemented by Codex gpt-6-astra from a coordinator plan; verified by re-running the 21-file unit selection (exit 0) outside its sandbox. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(backend): review fixes for the windowed TDT leg and configured STT chain Independent review (Cursor Grok) plus coordinator findings, all behind the same dark flags: - 18 s window buffer; sustained overload sheds with capacity_full and opens the pod's Parakeet circuit instead of killing sessions that still get 200s. - Last-resort dialing never bypasses an account-state cooldown and never forces a shedding TDT leg. - Fail-closed/forced-active VAD only for the windowed leg; other legs on the configured chain keep today's fail-open gate and honour VAD_GATE_MODE / client override. - Excluded session shapes drop only the parakeet-window token. - Non-terminal leg skips/failures emit degraded + leg-attempt metric; exhausted is emitted once per terminal chain so the #15189 pages stay truthful with the flag on. - Remove the init-terminal critical rule (it would fire immediately in today's prod). - Drain releases admission at once; malformed 200/413/semaphore-queue timeouts are session-local; only 5xx/acquired-POST timeouts feed the serve-error circuit. - Pass window_uid only when the managed chain is on (legacy selector call shape while dark). - Incident-history docstrings moved into utils/stt/ARCHITECTURE.md. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(backend): type the managed-session selector kwargs A bare dict spread into get_stt_service_for_language fails pyright; a TypedDict helper keeps the legacy call shape while the configured chain is dark. Co-Authored-By: Claude Fable 5.1 <[email protected]> --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
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/listensessions, and warn at the standing 16–25% baseline. The 2026-09-19 outage died ininitialize_stt()before aLiveSTTAttemptexisted, soomi_live_stt_terminal_total{outcome="failure"} / omi_live_stt_accepted_totalstayed green while 82–89% of accepts exhausted.omi_live_stt_accepted_totalandomi_live_stt_terminal_total{outcome="failure",phase="initialization"}without constructing aLiveSTTAttempt(no product analytics for a transcript that never started).ingest_sync_conversationrecordsomi_sync_intake_total{outcome="created|merged"}and logsomi_sync_intake outcome=…. The alert evaluates Cloud Logging because Cloud Runbackend-syncis not in the metrics exporter allowlist (backend+desktop-backendonly). Assignment continuity stays infix/sync-capture-continuity.to_moderecovers zero of ≥50stt_selectionattempts in 6h (Deepgram has been in this state since 2026-09-14). Panels 15–17 on Resilience / Fallbacks.What already existed vs what this PR adds
Already on
origin/main:omi_fallback_total/omi_fallback_eventwithcomponent="stt_selection"andoutcome="exhausted|recovered"omi_listen_accepted_totalat WebSocket accept (job=backend-listen-metricsCounter)omi-journey-live-transcription-failat 10% ofomi_live_stt_*(structurally blind toinitialize_stt()deaths)Added:
omi-stt-chain-exhausted-warn(0.35 / 10m / warning) andomi-stt-chain-exhausted-page(0.60 / 5m / critical)record_live_stt_pre_audio_failureonterminate_live_stt_sessionwhen noLiveSTTAttemptexistsomi-stt-fallback-leg-dead(warning)omi_sync_intake_total+omi-sync-intake-fragmented(Cloud Logging)Failure-Class
Failure-Class: FC-alert-never-provably-fired
New rules pin
job="backend-listen-metrics"and useincrease()on Prometheus Counters (not Stackdriver gauges). Each rule recordsevaluated_bad/evaluated_goodin its own annotations.Invariants
none —
scripts/pr-preflight --suggestreported no product-invariant path glob matches. Merge base is currentorigin/main.Evidence (Cloud Logging, project
based-hardware, backend-listen)Evidence layer is
gcloud logging readcounts ofomi_fallback_event component=stt_selection outcome=exhausted, divided by the measured 2-minute/v4/listenaccept samples. Prometheus/Grafana read-only was not reachable from this agent; exactincrease()evaluation is still owed.5m exhausted counts: tolerable 135, recovered 163, incident 1376. ~1 exhausted event per exhausted session (22
to=parakeetof 562 at 04:40Z).Provider-leg (
omi-stt-fallback-leg-dead): Deepgramoutcome=recovered= 0 in the 2026-09-18 09:00Z 5m window, the 2026-09-19 04:40Z 5m window, and the 2026-09-19 04:40–10:40Z 6h window; exhausted-to-deepgram hit the 20000 query cap in that 6h. This is why the alert is warning, not a page — the leg has been dead through both good and bad periods.Fragmentation (
omi-sync-intake-fragmented): brand-new series, no production history. Expected created share ~1.0 in a per-chunk storm (107 shards / 121 conversations for one account on 2026-09-19) versus1/Nfor an N-chunk continuous recording. Fleet-wide created/merged is unmeasured; 0.80 with ≥100 created / 30m is a provisional gap.Prometheus evaluation still owed
Whoever can query prod Prometheus/Grafana read-only should evaluate these exact expressions over 2026-09-19 04:40–16:00Z (bad) and 2026-09-18 09:00Z / 2026-09-20 14:30Z (good) and replace the log-derived annotation numbers if they differ:
sum(increase(omi_fallback_total{job="backend-listen-metrics",component="stt_selection",outcome="exhausted"}[5m])) / clamp_min(sum(increase(omi_listen_accepted_total{job="backend-listen-metrics"}[5m])), 1)sum by (to_mode) (increase(omi_fallback_total{job="backend-listen-metrics",component="stt_selection",outcome="recovered"}[6h]))vs attempts, especiallyto_mode=deepgramomi_sync_intake_totalafter deploy (no history today); Cloud Loggingomi_sync_intake outcome=after the first backend-sync revision that emits itOwner: whoever has Grafana
monitor.omi.meread access (platform / on-call). This agent must not.Test plan
BACKEND_UNIT_TEST_FILE_LIST+bash backend/test.shon Python 3.11.15 uv venv:test_transcription_outcomes.py,test_live_stt_failure.py,test_conversation_lifecycle_contract.py,test_monitoring_alert_rule_contract.py,test_journey_observability.py,test_fallback_observability.pyalerts/*.json+ combinedalert-rules.json)omi_fallback_eventratio on panel 15 during a real listen session; confirmomi_sync_intakelog lines on backend-sync🤖 Generated with Claude Code