Repository navigation
chore(listen): roll out routing off on prod backend-listen - #22195
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Retain duplicate-settlement coverage, alert on positive per-instance accounting gaps above one-hour carry-in for 15m, and aggregate exhausted-chain watch operands before division.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a4b16a715
ℹ️ 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".
|
|
||
| ## Production routing-off rollout (2026-10-18) | ||
|
|
||
| Prod backend-listen uses `STT_ROUTING_MODE=off`, the independent canary's only |
There was a problem hiding this comment.
Reconcile the canonical production routing settings
When an operator consults the routing documentation after this rollout, the new off contract conflicts with this same runbook's opening assertion that production uses shadow/0 (backend/docs/runbooks/live-stt-routing.md:5), backend/docs/transcription-architecture.md:51 still reports on/100, and backend/utils/stt/ARCHITECTURE.md:559-560 still reports shadow/0. These mutually exclusive production settings can cause a subsequent rollout or incident response to restore the wrong mode, so update the existing canonical assertions together with this new section.
Useful? React with 👍 / 👎.
| "summary": "Live STT - sustained new managed leg settlement gap", | ||
| "user_impact": "A sustained new settlement accounting gap may omit routing evidence; compare serving outcomes before any rollback.", | ||
| "scope": "Per instance and target: opened minus settled minus currently open, above the nonnegative same-series carry-in one hour earlier. Live legs are subtracted; unchanged control debt does not page.", | ||
| "verification": "Hermetic rule contract checked; no production Prometheus evaluation or notification delivery performed.", |
There was a problem hiding this comment.
Backtest the changed alert expressions on live history
Before this unpaused rule is imported and added to the release gate, its exact PromQL needs to be evaluated against real known-bad and known-good periods. The annotation explicitly says that no production Prometheus evaluation occurred, while the repository's FC-alert-never-provably-fired contract requires that evidence; the tests instead inject already-computed counter tuples and therefore cannot prove that the offset/vector matching works against the exposed labels. With noDataState: OK, a mismatched expression would silently appear healthy, while an unmeasured threshold could page on normal fleet behavior. The repurposed omi-stt-leg-lifecycle-gap expression has the same unvalidated annotation, so validate and record real values for both changed rules before enabling them.
Useful? React with 👍 / 👎.
| | Watch | Baseline and post-deploy measure | | ||
| |---|---| | ||
| | Exhausted chains | `sum(increase(omi_stt_chain_exhausted_total[15m])) / sum(increase(omi_listen_accepted_total[15m]))` (repeat with `[30m]`) | | ||
| | Terminal after text | `increase(omi_live_session_terminal_after_text_total)` / accepted sessions | |
There was a problem hiding this comment.
Make the terminal-after-text watch executable
During the required post-deploy watch, this expression cannot be run as written because PromQL increase() requires a range selector. Moreover, simply supplying [15m] still leaves the numerator labeled by provider/demand_cohort, while omi_listen_accepted_total is labeled by transcription source, platform, and build, so a direct division produces no matching series. The query pack contains only the grouped terminal numerator, not the promised ratio; provide an exact query that separately sum(increase(...[15m]))s both operands (and its 30-minute form), otherwise operators cannot collect the rollback signal this section requires.
Useful? React with 👍 / 👎.
…22222) ## Summary Restore `STT_ROUTING_MODE=on` for prod backend-listen in Helm values, the prod overlay, and the regenerated runtime manifest. Dev stays `shadow`; no UID or cohort was added. The alert, runbook, and documentation changes from #22195 remain intact; the generated feature-flag registry now reflects prod `on`. ## Rollback evidence The rollback is recorded in [backend-listen workflow run 39161774715](https://github.com/BasedHardware/omi/actions/runs/39161774715) and `data/run-2026-10-18-live-stt-exhaustion/canary/luna-routing-off-watch.md`. At +60m, the watch recorded first-text p95 at 28.61s (153.69 observations) versus a 14.50s matched baseline, terminal-after-text at 3.75% over 15m and 4.01% over 30m, and transcript success at 96.54% versus 99.38% (176.04 classified outcomes; a 2.85pp decline). ## Validation - `python3 backend/deploy/compose_runtime_env.py --check` - `python3 scripts/render_feature_flag_registry.py --as-of 2026-10-18` - Targeted runtime environment/render tests: 244 passed; feature-flag registry tests: 26 passed. - Prod/dev backend-listen Helm lint and template renders passed; rendered routing modes are `on` / `shadow`. - `git diff --check` ## Product invariants affected - `INV-MEM-4` — the generated runtime manifest path is covered; no memory settings changed. Failure-Class: none <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/22222?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="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/22222?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F22222&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
Prod backend-listen currently uses cost routing even though the independent routing-off canary had better aggregate outcome rates. Set only
STT_ROUTING_MODE=offin prod listen values and the prod runtime overlay, regenerate the runtime manifest, and keep dev unchanged. Static selection, fallback/recovery, capacity rescue and account quarantine remain enforced. No UID or account cohort is added; cohort work is separate (#22075 / existing private operator mechanism).The rollout config is commit
d8caeef8ae5; lifecycle guard corrections are a separate commit. No merge or deployment is part of this PR.Evidence and decision
Lead decision, 2026-10-18 16:08Z: proceed on pooled runs 4b+5b, same image/config, 173 classified canary outcomes; rollback routing on. Image:
gcr.io/based-hardware/backend@sha256:be7f0fc660261f428b87fcd07f2b70f7ce63c78ac4f5e48bdf37e97d4e7a12f2. The canary override is exactlySTT_ROUTING_MODE=off.Values below are canary routing off / simultaneous control routing on. Rates use accepted sessions except transcript success, which excludes too_short. Earlier runs provide context; only 4b+5b supply the approved pooled qualification.
Canary totals are raw counters; control denominators/counts are Prometheus extrapolated estimates. The pooled control success is weighted from the reported trial estimates. p95 values cannot be averaged or pooled without merging histograms; 4b/5b had 57/62 canary first-text observations. First-text is Parakeet-window only, not fleet-wide Modulate/Soniox timing. Exhaustion and terminal counters are event proxies, not deduplicated user failure rates. Completion lags acceptance. The overflow query was empty, so no zero-overflow claim is made. These observations are not a randomized/provider-specific causal proof. Run 3 latency was worse; the approved pool's outcome rates and per-run first-text p95 beat control. Run 5b POST p95 was 0.667s versus 0.648s control.
Run 5b replay:
29 opened - 24 settled - 4 open = 1. The same old guard fired on routing-on MAIN 11 times: canary 1/279 opened legs (0.358%) versus MAIN 11/~4303 (0.256%); three MAIN discrepancies predated the trial by >8h. Transport release and settlement are independent. A released pending leg produces +1; a settled transport still open produces -1. The missing settlement's exact owner/session remains unproven. The lead classified this abort as ARTIFACT, not evidence of a routing-off serving regression.The duplicate-settlement alert retains its stable UID and
settled > openedinvariant with Grafanafor: 2m. The additionalomi-stt-leg-settlement-omissionwarning evaluatesopened - settled - currently_openper instance/target. It requires a positive gap above the nonnegative same-series carry-in one hour earlier for 15 minutes. Run 5b(29, 24, 4)fires above a zero baseline; ordinary in-flight legs, negative gaps, unchanged positive control carry-in and shorter transients remain clear. Missing current components reset pending via the existing no-data policy; new instances without hour-old samples use a label-matched zero baseline.The rolling one-hour baseline detects new debt and eventually ages unchanged debt out of the alert. Keep the discrepancy recorded for investigation after the warning resolves. This accounting warning means HOLD/investigation, never automatic serving rollback. Direct released-AND-unsettled counts/oldest age and pending ownership are still needed for complete omission detection. Existing real outcome, latency, readiness and coverage guards remain.
Merged
origin/main(merge commit, no rebase), preserving both the routing paragraph and projection-discovery section. The exhausted-chain watch now sums each side before dividing, including an exact scoped query in the query pack. The new warning is in both exports and the existing import/coverage allowlists; the query inventory was regenerated with the repository tool. The prod runtime diff remains onlySTT_ROUTING_MODEon to off.Rollback
Set
STT_ROUTING_MODE=onin prod listen values and prod runtime overlay, runpython3 backend/deploy/compose_runtime_env.py, then deploy through the normal prod listen Helm workflow with the same image. Alternatively revert config-only commitd8caeef8ae5and deploy. This rolls/drains WebSockets. Avoid reverting an old entire Helm revision and losing capacity fixes. The same one-line rollback is in the ops runbook.Post-deploy watch
Before deploy pin the serving release SHA/image and exact main pods; save a 30-minute pre-deploy baseline. After deploy verify the running artifact's release identity, routing-off on all main pods, Ready/public NEG/scrape coverage. Compare matched 15m and 30m windows against that baseline through >=60 minutes and >=150 classified outcomes:
Investigate any outcome-rate regression immediately and roll routing on for sustained serving regression. Missing series are HOLD. Inspect language/provider mix, fallback/exhaustion, scrape health and accounting separately. Exact queries and rollback are in
backend/docs/runbooks/live-stt-routing.mdandlisten-stt-canary-queries.promql.Validation
All tests and Helm checks ran through
omi-heavyatnice -n 19in the dedicated product worktree.backend/scripts/pre-deploy-check.sh: 320 passed, plus runtime/workflow, frame storage and source-admission checks.helm lintand prod/devhelm template: passed with an explicit render tag; prod was also rendered using the exact canary digest. Source checks confirm only the prod routing mode changed.These are local source/config/fixture checks, not production deployment or notification delivery. No GCP tier was used for this PR task and no production account data was read. The canary execution evidence above came from the recorded prod-operator runs.
Invariants: INV-MEM-4 — memory admission/promotion behavior is preserved; the broad runtime manifest path selects this citation.
Failure-Class: FC-lifecycle-close-classified-by-transport-phase
The same contract applies at the alert boundary: expected transport lifecycle state must not be classified as a serving fault. The prevention artifact is
backend/tests/unit/test_live_stt_alert_behavior.py, covering expected pending/open states alongside a true settlement invariant violation. The sustained arithmetic warning is an accounting HOLD/investigation signal, not a serving-loss classifier.UI-Evidence: none -- backend deployment configuration and aggregate alert logic only.