Repository navigation
ops(stt): serve all eligible live sessions on the Parakeet window path - #20340
Conversation
50% held its gates for eight hours. Raise the per-pod window session cap from 8 to 16; listen pods were overflowing at the cap every hour. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
3 issues found across 7 files
Confidence score: 4/5
windowed-live-stt.mdhas stale capacity guidance for the new 16-session limit, which could lead operators to plan the wrong production capacity. Recalculate the guidance for the current limit.- The document says production allocation is 100% but also says to keep the 5% allocation and that this PR does not change it. Make the rollout guidance consistent.
- The control table sets
PARAKEET_WINDOW_MAX_SESSIONS=16, while the Production ramp still tells operators to deploy with 8. Align the ramp instructions with the intended setting.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="backend/docs/operational/windowed-live-stt.md">
<violation number="1" location="backend/docs/operational/windowed-live-stt.md:14">
P2: The table now shows prod allocation 100, but the same document still says "Keep the merged 5% allocation for this code release" (line 68) and "This PR does not deploy or change the existing 5% allocation" (line 169), and the ramp section prescribes 25% → 50% → 100% with an observation gate at each step (line 157). Those statements now directly contradict this change and the table; this is the configuration rollout the text says has not happened. Update the ramp section so the prod state reads as the completed 100% rollout (and reconcile the pre-change value — the old table said 5, while the PR description says the prior allocation was 50).</violation>
<violation number="2" location="backend/docs/operational/windowed-live-stt.md:15">
P2: With `PARAKEET_WINDOW_MAX_SESSIONS` raised to 16, the capacity guidance in this document is stale: "Eight slots per one-process listen pod allow 216–320 concurrent window sessions", "compare the summed window active sessions against eight times the ready listen pod count", and "bounds sustained requests to eight per listen pod per 6 s, with up to 216–320 synchronized sessions fleet-wide" all describe the old 8-session cap. The ramp's saturation check (active sessions vs 8× pod count) now compares against half the real capacity, so it will misreport headroom during the 100% rollout. Update these to the 16-session cap (432–640 sessions at 27–40 pods, sixteen times the ready pod count) and the ~45 MB per-pod estimate if it is meant to cover the full 16 sessions.</violation>
<violation number="3" location="backend/docs/operational/windowed-live-stt.md:15">
P3: The control table now sets Prod listen `PARAKEET_WINDOW_MAX_SESSIONS=16`, but the Production ramp section still instructs operators to deploy listen with `PARAKEET_WINDOW_MAX_SESSIONS=8` and references `Keep the merged 5% allocation for this code release`. Read as current rollout instructions, both are now stale: the ramp has reached 100% with the cap raised to 16, and an operator re-ramping after rollback would set the wrong cap and rate. Update the ramp prose to the current prod values (`PARAKEET_WINDOW_MAX_SESSIONS=16`) or mark the ramp steps as historical/completed.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| | `PARAKEET_WINDOW_ALLOCATION_PERCENT` | `0` | `1` | `5` | | ||
| | `PARAKEET_WINDOW_MAX_SESSIONS` | `1` | `1` | `8` | | ||
| | `PARAKEET_WINDOW_ALLOCATION_PERCENT` | `0` | `1` | `100` | | ||
| | `PARAKEET_WINDOW_MAX_SESSIONS` | `1` | `1` | `16` | |
There was a problem hiding this comment.
P2: With PARAKEET_WINDOW_MAX_SESSIONS raised to 16, the capacity guidance in this document is stale: "Eight slots per one-process listen pod allow 216–320 concurrent window sessions", "compare the summed window active sessions against eight times the ready listen pod count", and "bounds sustained requests to eight per listen pod per 6 s, with up to 216–320 synchronized sessions fleet-wide" all describe the old 8-session cap. The ramp's saturation check (active sessions vs 8× pod count) now compares against half the real capacity, so it will misreport headroom during the 100% rollout. Update these to the 16-session cap (432–640 sessions at 27–40 pods, sixteen times the ready pod count) and the ~45 MB per-pod estimate if it is meant to cover the full 16 sessions.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/docs/operational/windowed-live-stt.md, line 15:
<comment>With `PARAKEET_WINDOW_MAX_SESSIONS` raised to 16, the capacity guidance in this document is stale: "Eight slots per one-process listen pod allow 216–320 concurrent window sessions", "compare the summed window active sessions against eight times the ready listen pod count", and "bounds sustained requests to eight per listen pod per 6 s, with up to 216–320 synchronized sessions fleet-wide" all describe the old 8-session cap. The ramp's saturation check (active sessions vs 8× pod count) now compares against half the real capacity, so it will misreport headroom during the 100% rollout. Update these to the 16-session cap (432–640 sessions at 27–40 pods, sixteen times the ready pod count) and the ~45 MB per-pod estimate if it is meant to cover the full 16 sessions.</comment>
<file context>
@@ -11,8 +11,8 @@ This rollout uses `/v1/transcribe`, never the RNNT `/v3/stream` path for the
-| `PARAKEET_WINDOW_ALLOCATION_PERCENT` | `0` | `1` | `5` |
-| `PARAKEET_WINDOW_MAX_SESSIONS` | `1` | `1` | `8` |
+| `PARAKEET_WINDOW_ALLOCATION_PERCENT` | `0` | `1` | `100` |
+| `PARAKEET_WINDOW_MAX_SESSIONS` | `1` | `1` | `16` |
| `PARAKEET_BATCH_PRESSURE_POOL_HOST` | empty (stand down) | `dev-omi-parakeet-headless.dev-omi-backend.svc.cluster.local` | `prod-omi-parakeet-headless.prod-omi-backend.svc.cluster.local` |
| `PARAKEET_BATCH_PRESSURE_MIN_REPLICAS` | `2` | `1` | `3` |
</file context>
| | `STT_CONNECT_ORDER_FROM_CONFIG` | `false` | `true` | `true` | | ||
| | `PARAKEET_WINDOW_ALLOCATION_PERCENT` | `0` | `1` | `5` | | ||
| | `PARAKEET_WINDOW_MAX_SESSIONS` | `1` | `1` | `8` | | ||
| | `PARAKEET_WINDOW_ALLOCATION_PERCENT` | `0` | `1` | `100` | |
There was a problem hiding this comment.
P2: The table now shows prod allocation 100, but the same document still says "Keep the merged 5% allocation for this code release" (line 68) and "This PR does not deploy or change the existing 5% allocation" (line 169), and the ramp section prescribes 25% → 50% → 100% with an observation gate at each step (line 157). Those statements now directly contradict this change and the table; this is the configuration rollout the text says has not happened. Update the ramp section so the prod state reads as the completed 100% rollout (and reconcile the pre-change value — the old table said 5, while the PR description says the prior allocation was 50).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/docs/operational/windowed-live-stt.md, line 14:
<comment>The table now shows prod allocation 100, but the same document still says "Keep the merged 5% allocation for this code release" (line 68) and "This PR does not deploy or change the existing 5% allocation" (line 169), and the ramp section prescribes 25% → 50% → 100% with an observation gate at each step (line 157). Those statements now directly contradict this change and the table; this is the configuration rollout the text says has not happened. Update the ramp section so the prod state reads as the completed 100% rollout (and reconcile the pre-change value — the old table said 5, while the PR description says the prior allocation was 50).</comment>
<file context>
@@ -11,8 +11,8 @@ This rollout uses `/v1/transcribe`, never the RNNT `/v3/stream` path for the
| `STT_CONNECT_ORDER_FROM_CONFIG` | `false` | `true` | `true` |
-| `PARAKEET_WINDOW_ALLOCATION_PERCENT` | `0` | `1` | `5` |
-| `PARAKEET_WINDOW_MAX_SESSIONS` | `1` | `1` | `8` |
+| `PARAKEET_WINDOW_ALLOCATION_PERCENT` | `0` | `1` | `100` |
+| `PARAKEET_WINDOW_MAX_SESSIONS` | `1` | `1` | `16` |
| `PARAKEET_BATCH_PRESSURE_POOL_HOST` | empty (stand down) | `dev-omi-parakeet-headless.dev-omi-backend.svc.cluster.local` | `prod-omi-parakeet-headless.prod-omi-backend.svc.cluster.local` |
</file context>
| | `PARAKEET_WINDOW_ALLOCATION_PERCENT` | `0` | `1` | `5` | | ||
| | `PARAKEET_WINDOW_MAX_SESSIONS` | `1` | `1` | `8` | | ||
| | `PARAKEET_WINDOW_ALLOCATION_PERCENT` | `0` | `1` | `100` | | ||
| | `PARAKEET_WINDOW_MAX_SESSIONS` | `1` | `1` | `16` | |
There was a problem hiding this comment.
P3: The control table now sets Prod listen PARAKEET_WINDOW_MAX_SESSIONS=16, but the Production ramp section still instructs operators to deploy listen with PARAKEET_WINDOW_MAX_SESSIONS=8 and references Keep the merged 5% allocation for this code release. Read as current rollout instructions, both are now stale: the ramp has reached 100% with the cap raised to 16, and an operator re-ramping after rollback would set the wrong cap and rate. Update the ramp prose to the current prod values (PARAKEET_WINDOW_MAX_SESSIONS=16) or mark the ramp steps as historical/completed.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/docs/operational/windowed-live-stt.md, line 15:
<comment>The control table now sets Prod listen `PARAKEET_WINDOW_MAX_SESSIONS=16`, but the Production ramp section still instructs operators to deploy listen with `PARAKEET_WINDOW_MAX_SESSIONS=8` and references `Keep the merged 5% allocation for this code release`. Read as current rollout instructions, both are now stale: the ramp has reached 100% with the cap raised to 16, and an operator re-ramping after rollback would set the wrong cap and rate. Update the ramp prose to the current prod values (`PARAKEET_WINDOW_MAX_SESSIONS=16`) or mark the ramp steps as historical/completed.</comment>
<file context>
@@ -11,8 +11,8 @@ This rollout uses `/v1/transcribe`, never the RNNT `/v3/stream` path for the
-| `PARAKEET_WINDOW_ALLOCATION_PERCENT` | `0` | `1` | `5` |
-| `PARAKEET_WINDOW_MAX_SESSIONS` | `1` | `1` | `8` |
+| `PARAKEET_WINDOW_ALLOCATION_PERCENT` | `0` | `1` | `100` |
+| `PARAKEET_WINDOW_MAX_SESSIONS` | `1` | `1` | `16` |
| `PARAKEET_BATCH_PRESSURE_POOL_HOST` | empty (stand down) | `dev-omi-parakeet-headless.dev-omi-backend.svc.cluster.local` | `prod-omi-parakeet-headless.prod-omi-backend.svc.cluster.local` |
| `PARAKEET_BATCH_PRESSURE_MIN_REPLICAS` | `2` | `1` | `3` |
</file context>
…slow (#20344) ## What `tests/unit/test_live_gate_replay.py` keeps a 10-seed sample of its two seeded sweeps in the fast unit lane and marks the remaining seeds `slow`; the file is added to `tests/slow_guardrail_manifest.txt` so the full sweep still runs in the slow guardrail lane. ## Why On CI the file takes ~298 s (`722 passed in 297.86s`), about half of unit shard 2's 600 s wall budget. Shard 2 now fails on time alone — 627 s and 614 s on two attempts for #20340, a config-only PR — with every test passing. The sweep is 200 seeds × 3 rates × 20,000 gate transitions (plus 100 day-long trial simulations). After this change (local): fast lane 62 tests in 3.9 s; slow lane 660 tests in 51 s. The module-level false-bench bounds (`0`, `<= 4`, `<= 32` per 4M sessions) are upper bounds, so they hold for the 10-seed sample and are still enforced over the remaining 190 seeds in the slow lane. No production code changes. ## Product invariants affected None — test-only change. Failure-Class: none 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/20344?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. -->
Provider health was inferred from socket liveness and teardown independently of the serving decision. That both censored early Modulate deaths and invented Soniox failures during client churn. This change makes a leg's exactly-once terminal settlement emit both the existing fallback event and router observation, with the original bounded cause frozen before transport cleanup. Liveness getters are read-only; accepted deaths need no VAD minimum; terminal-provider exhaustion is visible too. `cost-v6` gives each hashed user at most three classified votes per target/scope/five-minute Redis-time window, enforced by CAS with bounded state. Raw observations remain uncapped for emission accounting. Healthy windows have 2,048 ordinary fingerprints plus an eight-distinct-user outage reserve that resets on every classified success; eight new failures still bench after saturation without failure-only CUSUM sampling. Healthy Redis keys expire after 900 idle seconds; benches/trials persist so expiry cannot bypass staged recovery. Independent chain-opened / terminal-settled / transport-open lifecycle metrics and honestly named emission-acknowledgement/error/vote counters and an intent-to-treat router-canary transcript SLI support the runbook's 60–120 minute shadow qualification and 5→25→100 ramp. The gate remains 8%; reproducible synthetic calibration reports zero false benches in each 400,000-session healthy-floor scenario and p95 detection at 48/21/8 sessions for 40%/60%/100% failures. Production remains `STT_ROUTING_MODE=shadow`, `STT_ROUTING_ON_PERCENT=0`. Deliberate serving changes: configured fallback order becomes Parakeet window → Soniox → Modulate → Deepgram; Soniox timing/configuration, local VAD and other censored input causes no longer accumulate provider circuit failures at connect or terminal settlement; client teardown transport errors cannot start recovery or open provider circuits; local queue/loop/input failures retain non-provider causes; an active router cannot reappend a registry-withdrawn default endpoint as a legacy tail. No-text remains censored and diagnostic; the existing transcript-success alert remains the detector, with no new silent-stream rescue. #20332 merged while this lane was in progress. This branch merges that main revision and supersedes its parallel receipt writers, retaining and extending its real parser/receiver tests and preserving the new `soniox_request_timeout` label. No merge or deployment is performed by this lane. Merged origin/main again at 81a51d0 after #20340 landed. Its Parakeet allocation/capacity values are preserved exactly at 100/16; #20344 slow marks remain intact. ## Validation - Real `LiveLegSocket` + provider parser + receiver tests reconcile 120 accepted deaths, before-audio/subsecond/no-VAD paths, typed terminal causes, connect rejection, exhaustion, cancellation, and client teardown. - Fleet CAS tests cover 46 reconnects across pods, concurrent budget admission, bounded fingerprint storage and generation fencing. - Initial STT/provider/runtime regression run before the final review: **2,268 tests passed across 50 isolated files**, with `BACKEND_FAST_UNIT_FAIL_SECONDS=1.0`; two real listen-runtime parity tests also passed under the same guard with an external `--basetemp` (their capture validator intentionally rejects checkout-local roots). Type checking: zero errors. `make preflight`: all 38 selected checks passed with this PR body; normal push hooks passed. - Test command: `cd backend && BACKEND_UNIT_TEST_FILE_LIST=<selected file list> BACKEND_FAST_UNIT_FAIL_SECONDS=1.0 BACKEND_PYTEST_WORKERS=3 TMPDIR=$PWD/../.pytest-tmp bash test.sh`. Focused real-object cases also used `.venv/bin/python -m pytest -q -p no:cacheprovider <files> --durations=8`. - The separate slow lane also passed all 668 calibration tests and both files are registered in the existing slow-guardrail CI manifest; main's slow marks are retained; the fast baseline sample uses 20k sessions per rate and the full separate calibration retains 400k per scenario. Full realistic-floor calibration was run separately. Exact qualification PromQL and canary/abort conditions: `backend/docs/runbooks/live-stt-routing.md`. - Synthetic calibration: `cd backend && .venv/bin/python scripts/stt/calibrate_live_gate.py`; no user transcript/audio access or production-state writes. Production acceptance is pending coordinator deployment/shadow checks. ## Product invariants affected - INV-MEM-4: generated runtime env is touched only for the live STT order; canonical memory promotion authority and its flags are unchanged. Failure-Class: FC-decoded-outcome-discarded-before-canonical-record Line-Count-Exception: backend/routers/listen/receiver.py | 1835 -> 1844 | Wire the shared settlement and teardown fence at existing serving-owner boundaries; extracting unrelated receiver/provider logic would widen this incident fix. Line-Count-Exception: backend/utils/stt/streaming.py | 2186 -> 2188 | Wire the shared settlement and teardown fence at existing serving-owner boundaries; extracting unrelated receiver/provider logic would widen this incident fix. ## Review decisions The 30-second pending-hop bound is intentional: `degraded` means recovery was unproven by the deadline. Late successor text remains visible in leg/session and router-canary transcript SLIs; it does not emit a second fallback or change the source provider-failure vote. Waiting indefinitely for successor speech would again make outage detection depend on user audio. Review corrections include invalid-percent telemetry fail-open, a teardown recheck after awaited recovery, settlement on engine-mismatch recursion and cancelled replacement retries, aligned prod ConfigMap/inline order, and explicit censored local circuit causes. The long calibration files are now registered in the existing slow-guardrail CI manifest, while the fast lane stays below its per-test CPU budget. ## Serving behaviour changes | Location (under backend/) | Before → after; intent and accepted risk | | --- | --- | | charts/backend-listen/prod_omi_backend_listen_values.yaml:457; deploy/runtime_env/prod.overlay.yaml:39,295; regenerated deploy/runtime_env.yaml | Parakeet → Modulate → Soniox becomes Parakeet → Soniox → Modulate. Sessions unable to use Parakeet now start on Soniox: cost up, reliability up. Modulate remains in the static chain and registry, with the separate new-endpoint ramp supported. | | routers/listen/receiver.py:1741; utils/stt/live_session.py:843; utils/stt/live_failure.py:550; utils/stt/resilient_stream.py:266 | Owner teardown fences later transport symptoms before tail sends. A published death already latched before that fence is now settled as a failure even without a monitor claim; a death beginning during/after teardown is censored. Connected streaming deaths still invoke recovery. | | utils/stt/live_outcome.py:61; utils/stt/live_session.py:529 | Accepted provider deaths no longer require >=1s VAD speech; actual text counts success without VAD. This removes early-death undercounting; normal no-text stays censored. #20332 independently merged that early-death policy while this PR was in progress. | | utils/stt/live_session.py:854; utils/stt/live_failure.py:170,255 | Health settles at the serving owner, not a liveness read or transport close. Close of an already-claimed failed leg defers settlement to its hop; a 30s timer bounds that deferral and reports degraded if recovery is unproven. Terminal-provider exhaustion now emits a fallback. These change telemetry, not audio/transport actions. | | utils/stt/live_chain.py:372; utils/stt/live_failure.py:108 | Censored connect reasons release admission without accumulating circuit failures. Terminal transport reasons shrink to connection_lost/send_failed, removing vad_failed and soniox_request_timeout; separate typed account/serve-error protection stays. Repeated Soniox 408 connect rejections can therefore be retried across sessions: accepted because 408 alone cannot distinguish outage from input timing, while the same connect still falls through. Reason counters and latency/transcript SLIs support manual withdrawal if an outage is demonstrated. | | utils/stt/soniox.py:212,238; utils/stt/streaming.py:1323,1456 | Soniox publishes cause before death. Queue-full/loop misuse/invalid input retain bounded censored causes instead of connection_lost; accepted-dead connects retain their normalized cause instead of collapsing to provider_5xx. Same-session fallback remains. | | utils/stt/live_chain.py:161 | Active selection cannot reappend a registry-withdrawn/excluded default endpoint as a legacy tail; configured-order error fail-open remains. Shadow/0 does not activate this selection branch. | ## Luna final review corrections - Saturated-window + eight new-failure regression; existing UID budgets never refill. Normal capacity exceeds 10x the stated 1,800 sessions/hour; any saturation still stops rollout because normal brownout evidence is sampled; the independent outage reserve resets on successes and cannot be filled by one reconnecting user. - Death-before-teardown now counts, including the real receive_data path; errors arising during its final flush remain censored. - `omi_stt_cost_routing_emission_ack_errors_total` replaces the misleading reconciliation name. It does not prove classification, settlement coverage or Redis persistence. - Independent `omi_stt_managed_legs_opened_total - omi_stt_managed_legs_settled_total - omi_stt_managed_legs_open` is exported by target/pod. A regression deliberately suppresses settlement and verifies that this gap grows while acknowledgement errors need not change. Go/no-go rejects a nonzero gap persisting two minutes (30s deferred settlement is allowed). - Healthy fairness keys get a 900s TTL. Benches and recovery trials deliberately do not expire into healthy state; they contain no healthy-window fingerprint list. Final review-round validation: **1,614 fast tests across 50 isolated files passed with the stricter 0.30s CPU guard**, followed by **139 focused tests** covering the final overflow/CAS and lifecycle-oracle changes. Re-ran the six 400,000-session calibration scenarios: zero false benches in each; detection median/p95 remains 20/48, 13/21, 8/8 at 40/60/100%. The earlier 2,268 count predates main's additional slow split; it is not the new fast-lane count. Generated runtime env regeneration and `--check` pass. PR metadata preflight passed all 38 checks. Final type check: zero errors. The final main merge includes #20340, with 100% allocation / cap 16 retained and runtime env regenerated and checked.
What
Prod listen config only:
PARAKEET_WINDOW_ALLOCATION_PERCENT50 → 100 (all eligible live sessions start on the Parakeet window path).PARAKEET_WINDOW_MAX_SESSIONS8 → 16 (per-listen-pod admission cap).Why
Final step of the gated ramp to Parakeet-primary live STT (5 → 25 → 50 → 100) approved on 2026-09-29. 50% has been live since 2026-10-02 04:05Z. Gates over the last hour before this PR (prod Prometheus, aggregates only):
The per-pod cap is raised because listen pods reached 8 concurrent window sessions most hours at 50% (4–11 sessions per hour overflowed to the next provider). Listen pods average 0.19 CPU cores (peak 0.48); the cap is an admission bound, not a resource reservation.
Load note: 100% at the current hour is about the load 50% carries at the evening peak. Expected GPU busy at peak with 100% is ~40% per pod on 7 pods (live was ~12% of GPU audio at 25%).
Rollback
Set
PARAKEET_WINDOW_ALLOCATION_PERCENTback to 50 (or 0) and redeploy listen; chart-only, no image change.Deploy
Listen helm only, with the current image tag.
Product invariants affected
INV-MEM-4 — the runtime env manifest is a locked path; this changes one rollout percentage and one admission cap, and no memory behaviour.
Failure-Class: none
🤖 Generated with Claude Code