Repository navigation
proto: CLOUD_LIVE_STT_MODE (stream/when_watched/off) + local_preview capability — batch-only cloud foundation - #23498
Git-on-my-level wants to merge 1 commit into
Conversation
…ocal_preview handshake, saved-seconds metrics Dark foundation for the batch-only cloud transcription proposal. Default stream reproduces today's behavior exactly; when_watched forces the existing #21481 live-demand machinery to admit every session (no parallel switch); off opens no cloud streaming STT session at all while audio is still received and persisted (the #23388 cap_paused receive/persist shape), with BYOK custom STT never suppressed. local_preview is a client capability declaration on /v4/listen. Metrics: omi_cloud_live_stt_mode_sessions_total and omi_cloud_live_stt_saved_seconds_total.
|
Built on in #23610 (this PR's commit is carried there unchanged, plus one follow-up). Finding while doing so: |
…never drop, the cloud stream (#23610) * proto: CLOUD_LIVE_STT_MODE policy switch (stream/when_watched/off), local_preview handshake, saved-seconds metrics Dark foundation for the batch-only cloud transcription proposal. Default stream reproduces today's behavior exactly; when_watched forces the existing #21481 live-demand machinery to admit every session (no parallel switch); off opens no cloud streaming STT session at all while audio is still received and persisted (the #23388 cap_paused receive/persist shape), with BYOK custom STT never suppressed. local_preview is a client capability declaration on /v4/listen. Metrics: omi_cloud_live_stt_mode_sessions_total and omi_cloud_live_stt_saved_seconds_total. * feat(listen): mobile local-preview lane for batch-lane users; defer, never drop, the cloud stream A mobile session that declares local_preview=enabled and whose uid is on the batch record lane (allowlist or batch percent), with private cloud sync and no custom STT, is admitted to the local-preview lane: ready and every mobile_batch_admission renewal carry local_preview=true with mobile_standard_batch=true, so the client journals all pendant audio through the lossless mobile Standard batch route and renders its own on-device preview. Integrations no longer hold these sessions on the live stream (David, 2026-10-25: realtime apps/webhooks degrade). Listen defers the provider stream instead of dropping it: live segments are what keep a listen conversation alive and register it for batch, so a session with audio and no stream loses its transcript. The first socket audio opens today's stream. CLOUD_LIVE_STT_MODE=off (#23498) now uses the same deferral. Kill switch LOCAL_PREVIEW_BATCH_ENABLED, on unless set off; no separate ramp. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(listen): start demand routing once a deferred or cap-paused stream actually opens Luna r1 P2 on #23610: a deferred open that cap admission pauses creates no socket, and the later cap-recovery re-init never started the demand-routing task the session skipped. ensure_live_demand_routing() starts it exactly once whenever a stream exists (session start, deferred open, cap recovery); the deferred-open counter now counts only opens that produced a socket. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(listen): label local-preview admission outcomes through the closed reason enum CI test_reason_label_enums: outcome labels must come from a reasons.py enum via reason_label(). Adds LocalPreviewOutcome (LIVE_STT family); REASONS derives from it. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(listen): count a deferred stream once however it opens; document late routing tasks Luna r2 on #23610: a deferred open that cap admission paused, then cap recovery opened, was never counted; note_deferred_stream_opened() counts once from either path. Routing tasks started after supervise() snapshots its set are tracked and cancelled at teardown but cannot end the session; that fail-soft behaviour is intended and now documented at the call. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
|
@kodjima33 keep-or-close ping (lead2 ruling 664fd6, dropped-work audit 2026-11-09 item 7): this draft has been idle 15-17 days. Please reply with keep (and a next step) or it will be closed as not-now in 24h (after 2026-11-10 17:10Z). Closing keeps the branch; nothing is lost. |
|
Closing as part of a stale-PR cleanup David asked for on 2026-11-26 (Shipping lead agent): it is a draft with no activity for days. Nothing is lost: the branch stays, and anyone can reopen this PR if the work is still wanted. If it still matters, reopen it and refresh it against main. |
|
Hey @Git-on-my-level 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
Summary
Dark foundation for the batch-only cloud transcription proposal (David, 2026-10-24 —
proposal only, not ratified; plan:
omi-workspace omi-knowledge-base/projects/two-lane-transcription/batch-only-cloud-plan.md).No behavior changes by default; every new code path is behind a fail-safe server policy
switch that defaults to today's behavior.
CLOUD_LIVE_STT_MODE(backend/config/cloud_live_stt.py, new):stream(default) — today's behavior exactly: live provider streams open asconfigured (language/cost routing, demand routing, recovery), including the
self-hosted Parakeet window leg.
when_watched— reuses the existing live-demand machinery (feat(listen): route hidden English capture by live demand #21481) rather thanadding a parallel switch:
resolve_live_demand()admits every session, so a vendorstream runs only while the transcript is visible or a server-side real-time consumer
is active (
config/live_demand.py).off— no cloud streaming STT session opens at all (neither vendor nor the Parakeetwindow leg). Audio is still received and persisted through the ordinary listen/pusher
path — the same receive/persist shape as the fix(stt): enforce finite allowances before sync and batch cloud spend #23388 cap-paused state
(
routers/listen/receiver.py:1289), which this generalizes. BYOK custom STT is neversuppressed. Invalid values fail safe to
stream.local_previewclient capability on/v4/listen('enabled'|'disabled'queryparam →
ListenRequest.local_preview): a client declares it renders its own on-devicetranscript preview. Server-side use is telemetry-only for now.
utils/metrics.py):omi_cloud_live_stt_mode_sessions_total{mode, local_preview,client_platform}andomi_cloud_live_stt_saved_seconds_total{mode}—the would-be-saved provider stream seconds per mode (
off= all decoded audio seconds;when_watched= hidden background+foreground seconds;stream= 0). Baseline for whatoffcould remove, measured 10-24 on ro-prod: ≈1,838 vendor wire audio-hours/day.Not included (deliberately): any client-side on-device preview wiring, the sync-off
ephemeral buffer, vendor-batch routing for non-EU languages, and any rollout. Those are
gated plan phases, not this PR.
Testing
backend/tests/unit/test_cloud_live_stt_mode.py: mode resolutionfail-safe matrix (default/explicit/case/whitespace/invalid), suppression matrix
(incl. the BYOK exemption),
when_watched→ feat(listen): route hidden English capture by live demand #21481 admission mapping, off-modereceive/persist without provider selection or demand attach, lane-switch refusal while
suppressed, session counter with
local_preview, and saved-seconds accounting per mode.(
test_live_demand_policy.py,test_live_demand_consumers.py,test_stt_cap_dispatch.py) to prove the default path is untouched.backend/test.shwithBACKEND_UNIT_TEST_FILE_LISTandBACKEND_PYTEST_WORKERS=4.Failure-Class: none
(Dark feature behind a fail-safe switch; the default mode reproduces current behavior and
the change adds two counters plus one registry row.)
Do not merge or deploy: this is a prototype branch for the batch-only plan discussion.
🤖 Generated with Claude Code
Line-Count-Exception: backend/routers/listen/receiver.py | 2782 -> 2829 | prototype foundation: CLOUD_LIVE_STT_MODE session pin/suppression at the _initialize_stt seam, lane-switch refusal guard, and saved-seconds recorder; to be relocated into the listen-edge/plan-D gateway split before any non-draft use
Line-Count-Exception: backend/utils/metrics.py | 1523 -> 1535 | two new counters (omi_cloud_live_stt_mode_sessions_total, omi_cloud_live_stt_saved_seconds_total) for the batch-only foundation; single central metrics module