Skip to content

stt: split local delivery deaths out of capacity_full; count breaker trip causes (P34) - #23074

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

Git-on-my-level merged 5 commits into
mainfrom
lane/soniox-telemetry

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Summary

At peak on 2026-10-21, live Soniox legs died through soniox.py _mark_dead(typed_reason='capacity_full') for three local causes — the send queue filling, replay sends stalling, a live frame's delivery deadline expiring — while the vendor closed nothing and the listen pods sat near idle; omi_fallback_total{from_mode="soniox",to_mode="parakeet",reason="capacity_full"} then read as Parakeet capacity (P32). This PR is telemetry and labels only. It splits those deaths into three typed reasons (send_queue_full, replay_send_stalled, delivery_expired) at every Soniox/Modulate-leg local site (SafeSonioxSocket, SafeModulateSocket, the ReplayTailSocket tail bound and unconfirmed write, the IdleSonioxSocket pending bound, the replay prefix wall budget), adds one bounded WARNING per such death carrying queue depth and age plus seconds since the last successful write (numbers only; no UID, no content), and adds omi_stt_provider_circuit_trip_total{provider,kind,error_class} so a Parakeet selection breaker trip names its cause. capacity_full now means destination capacity only (Parakeet admission / buffer_cap / queue_timeout, allocation).

Behavior change

None. The new tokens are censored exactly as capacity_full was (provider_observation allowlist), take the same failure phase (connection), stay outside the Soniox reconnect allowlists, and never reach record_rejection (Parakeet-only). Breaker record_failure / record_serve_failure / record_account_failure / record_account_rejection gain an optional error_class keyword consumed only by the counter; the bench they open is unchanged. Re-arming an already-open breaker does not count as a trip.

Rename recorded — how to read it

  • The split, on the series the observability lane already reads:
    sum by (reason, to_mode) (increase(omi_fallback_total{job="backend-listen-metrics",component="stt_live_session",from_mode="soniox"}[10m]))
    shows send_queue_full / replay_send_stalled / delivery_expired where it showed capacity_full.
  • Destination capacity, unchanged: ...reason="capacity_full" (Soniox/Modulate legs no longer contribute).
  • Breaker trip causes: sum by (provider, kind, error_class) (increase(omi_stt_provider_circuit_trip_total{job="backend-listen-metrics"}[10m])).
  • Death log line: Soniox local delivery death subtype=<token> queue_packets=<n> queue_age_seconds=<s> since_last_send_seconds=<s|-1> session_age_seconds=<s>.
  • omi_listen_demand_failure_detail_total records the three reasons as themselves (previously other); zero children pre-created.
  • The alert omi-stt-capacity-full-exhausted (outcome=exhausted, volume-guarded) narrows to destination capacity; Soniox/Modulate local deaths that exhaust the chain leave its scope (1 of 36 events in P32's 14:00–14:10 sample). Flagged to the observability lane; not edited here.
  • The Parakeet-window successor's replay prefix wall now latches replay_send_stalled too (review round 1), so every local wall expiry carries the same token regardless of successor type; the window's own buffer_cap / queue_timeout / admission stay capacity_full because those are the destination refusing.

Review round 1 (grok, FIX-FIRST) — what changed

  • receiver.py exhausted-recovery terminate: reports the tail socket's typed local cause (live_stt_terminal_reason(delivery, 'send_queue_full')) instead of a hard-coded capacity_full.
  • resilient_stream.py + parakeet_window.fail: the window successor's replay wall latches replay_send_stalled (above).
  • send_queue.py / soniox.py: queue_age_seconds is now the oldest still-queued packet's wait (per-item enqueue times popped as items are taken), not time since the queue first became non-empty; a session that stays one packet ahead no longer reports its session age.
  • provider_resilience.py: trip-counter zero children also cover auth and config_incomplete.
  • Not taken — replay_delivery.py residence-deadline write stall reported as connection_lost: that branch (clock() >= packet_deadline with the vendor socket alive → _local_reason unset → connection_lost → serve-failure circuit vote) is unchanged from main; this PR only renamed the token in the sibling branch. Relabelling it would stop a circuit vote that fires today, which is a behavior change outside this telemetry-only PR. Handed to the lead as a follow-up with the exact branch.

Review round 2 (grok, delta, FIX-FIRST) — what changed

The round-2 blocker was a regression I introduced in round 1's receiver fix: forwarding live_stt_terminal_reason(delivery, …) let a tail that died without a local cause (the residence-deadline stall) resolve to the generic connection_lost and vote on the serve-failure circuit from a site that never voted before. Fixed: live_failure.local_tail_terminal_reason() forwards only local-delivery tokens (else send_queue_full, the bound this site observed), so the exhausted-recovery terminate keeps exactly its pre-PR circuit semantics (never votes) while naming the local cause when the tail latched one. Pinned by test_exhausted_tail_terminate_forwards_only_local_tokens_never_a_circuit_vote. The underlying residence-deadline label (connection_lost where delivery_expired is true) remains pre-existing and with the lead (see round 1). Round cap reached; lead rules on merge.

Lane / contract

Lane soniox-telemetry (P34). Contract rows in swarm/contracts.md: omi_fallback_total local-delivery reasons; omi_stt_provider_circuit_trip_total. Owner sign-offs for other lanes' files: none needed.

Product invariants affected

none

Verification

backend/test.sh with BACKEND_UNIT_TEST_FILE_LIST (unit layer, under omi-heavy): new test_soniox_local_delivery_deaths.py (each subtype, the bounded diagnostic line and its -1 sentinel, oldest-queued age, the window-successor wall, censoring, omi_fallback_total passthrough) and test_stt_circuit_trip_causes.py (serve, threshold, half-open re-trip, account, untyped, unlabelled breaker, the live-failure→streaming funnel, zero children); existing live replay / recovery matrix / canary / shutdown-tail / evidence settlement / health reconciliation (now parametrized with the window token) / chain / resilience / fallback / cardinality / connect-fallback suites updated to the new tokens and the breaker's error_class keyword. Round-1 batch 710 passed; round-2 affected set 583 passed. Not run: the full backend suite, any live or prod check.

Rollback

Revert the PR. No flags, no data migration.

Failure-Class: none
Line-Count-Exception: backend/utils/stt/streaming.py | 2461 -> 2466 | SafeModulateSocket's three local-delivery typed reasons and the breaker cause plumbing live in this module
Line-Count-Exception: backend/utils/metrics.py | 1498 -> 1512 | omi_stt_provider_circuit_trip_total is defined beside its gauge sibling omi_stt_provider_circuit_open, where every other STT metric lives
Line-Count-Exception: backend/routers/listen/receiver.py | 2777 -> 2780 | the exhausted-recovery terminate reports the tail's typed local cause via local_tail_terminal_reason instead of a hard-coded capacity_full (review rounds 1-2)

…trip causes (P34)

Live Soniox legs at peak died through _mark_dead(typed_reason='capacity_full')
for three local causes (send queue full, replay send stalled, live delivery
expired) while the vendor closed nothing, and omi_fallback_total read that as
Parakeet capacity (P32, 2026-10-21). Telemetry and labels only:

- three typed reasons (send_queue_full, replay_send_stalled, delivery_expired)
  at every Soniox/Modulate-leg local site: SafeSonioxSocket, SafeModulateSocket,
  ReplayTailSocket (tail bound, unconfirmed write), IdleSonioxSocket pending
  bound, replay prefix wall budget; capacity_full now means destination capacity
- one bounded WARNING per local delivery death: subtype, queue packets, queue
  age, seconds since the last successful write, session age (no UID, no content)
- omi_stt_provider_circuit_trip_total{provider,kind,error_class}: one count per
  real closed/half-open->open transition, labeled with the serve-death or
  connect-failure reason; breaker record_* methods take an optional error_class
  that never changes which bench opens

Censoring, failure phase, reconnect allowlists and record_rejection are
untouched for the new tokens. Vocabulary, demand-detail reasons, connect error
classes and zero baselines extended; ARCHITECTURE.md row updated.
@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-21T18:44:18.523998Z 4602f25 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.

@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: 63db9a9c77

ℹ️ 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 thread backend/utils/stt/resilient_stream.py Outdated
Comment on lines +548 to +550
# The replay prefix did not deliver within its wall budget;
# the socket's own local bound, not vendor capacity.
mark('replay wall budget exhausted', typed_reason=LOCAL_DELIVERY_REPLAY_SEND_STALLED)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Relabel managed replay-wall failures too

When managed recovery is enabled, the socket passed from receiver._pump_replacement() is a LiveLegSocket (or a delegating wrapper), which exposes fail(). Therefore the preceding branch still executes fail('capacity_full'), and this newly typed _mark_dead branch is reached only for legacy/raw sockets. Replay-prefix wall exhaustion on managed Soniox and Modulate legs will consequently continue polluting the destination-capacity series instead of reporting replay_send_stalled; pass the new reason through the fail() path as well, retaining the documented Parakeet-window exception explicitly if necessary.

Useful? React with 👍 / 👎.

Comment on lines 747 to +751
if clock() < packet_deadline and not self.connection.is_connection_dead:
self._local_reason = 'capacity_full'
# The write was still inside its deadline when it
# failed to confirm: the tail's bound, not the
# destination's capacity.
self._local_reason = LOCAL_DELIVERY_EXPIRED

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Classify the short write wait as a replay stall

For initial paid legs, receiver.py constructs this wrapper with write_wait_seconds=socket_replay_limits(...).queue_wait_seconds, normally about two seconds, while packet_deadline is the much longer absolute residence deadline. Thus await_frozen_writes() can time out while clock() < packet_deadline is true—the exact condition here—and this labels an ordinary queue/write stall as delivery_expired. That contradicts the new reason definitions and moves stalled sends into the wrong telemetry bucket; this branch should use replay_send_stalled, reserving delivery_expired for expiration of the absolute packet deadline.

Useful? React with 👍 / 👎.

Comment on lines +27 to +31
_CIRCUIT_TRIP_CLASSES: Final = (
'capacity_full',
'connection_lost',
'modulate_serve_error',
'provider_429',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Pre-create every trip cause emitted by callers

This zero-baseline list omits bounded causes that the changed call sites can actually use to open a breaker, notably auth and config_incomplete in connect_stt_socket_with_fallback() and auth in configured-chain account failures. On a fresh process, the first trip for any omitted cause creates its Prometheus series at value 1, so the intended increase(...) query does not observe that opening burst—the exact problem this initializer is meant to prevent. Initialize every admissible emitted cause (for example from the closed live-reason vocabulary plus untyped) rather than this partial subset.

Useful? React with 👍 / 👎.

Comment on lines 1614 to +1617
try:
self._send_queue.put_nowait(queued_data)
except asyncio.QueueFull:
self._mark_dead('send queue full', typed_reason='capacity_full')
self._mark_dead('send queue full', typed_reason=LOCAL_DELIVERY_SEND_QUEUE_FULL)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Emit diagnostics for every newly typed local death

Only SafeSonioxSocket._mark_dead() emits the new bounded local-delivery diagnostic. In the Modulate paths changed here, _mark_dead() merely latches fields, while ReplayTailSocket.mark_tail_full() and IdleSonioxSocket.send() also set their local reasons directly, so queue overflow, replay stall, and deadline-expiry events on those paths never report queue depth, age, or time since the last write. This leaves a substantial portion of the newly split events without the diagnostic intended to explain them; route all of these local-death sites through a shared bounded logger or add equivalent logging to each owner.

Useful? React with 👍 / 👎.

Comment thread backend/utils/stt/soniox.py Outdated
Comment on lines +357 to +359
def _note_enqueued(self) -> None:
if self._queued_at is None:
self._queued_at = time.monotonic()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Track the current oldest queued packet

When the writer continuously drains a nonempty queue, _queued_at is set for the first packet and is not advanced as that packet and later packets are written; it is cleared only after the queue becomes completely empty. A later queue-full death can therefore report queue_age_seconds equal to the age of the whole busy period—potentially minutes or hours—even though the oldest packet still present is recent. Since this field is meant to distinguish an old stalled queue from a fresh burst, track enqueue timestamps per packet or advance the oldest timestamp on dequeue instead of retaining a single episode-start timestamp.

Useful? React with 👍 / 👎.

Comment on lines 852 to +854
circuit.record_failure()
else:
circuit.record_serve_failure()
circuit.record_serve_failure(error_class=reason)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Count trips from endpoint-scoped circuits

For a configured routing target with a custom endpoint, record_target_death() obtains the endpoint-specific circuit from live_router.target_circuit(), whose ProviderCircuitBreaker is constructed without a provider_label. The new _note_trip() explicitly returns for such breakers, so passing error_class here produces no omi_stt_provider_circuit_trip_total sample for either serving or account failures on custom Modulate targets; default targets take a different path through the labeled family circuit. Emit the provider-level trip counter for endpoint circuits as well without making their independent state gauges overwrite one another.

Useful? React with 👍 / 👎.

Comment on lines 518 to +521
self._account_cooldown = max(1, cooldown_seconds)
self._opened_by_serve_error = False
self._remaining_successes_to_close = 1
self._note_trip(error_class, kind='account', was_open=was_open)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Count transitions from selection to account benches

If an account rejection is observed while the selection breaker is already open, this call changes the active bench from selection to account and turns on the account-kind gauge, but was_open is true and _note_trip() suppresses the account trip. This can occur on legacy fallback legs because candidate selection deliberately ignores selection benches while honoring only account cooldowns. The resulting account breaker has no kind="account",error_class="quota" trip explaining why it appeared; suppress repeated re-arms of the same kind, but count a transition between breaker kinds.

Useful? React with 👍 / 👎.

…all token, true queue age

- receiver.py: the exhausted-recovery terminate reports the tail socket's typed
  local cause (live_stt_terminal_reason(delivery, 'send_queue_full')) instead of
  a hard-coded capacity_full; the same funnel, phase and circuit outcome
- resilient_stream.py + parakeet_window.fail: a successor that implements
  fail() (the Parakeet window) latches replay_send_stalled on the replay prefix
  wall, like the socket-level branch; its own buffer_cap/queue_timeout/admission
  stay capacity_full because there the destination refused
- send_queue.py: AudioSendQueue records each item's enqueue time and pops it as
  items are taken; soniox.py reads oldest_queued_age so queue_age_seconds is the
  oldest still-queued packet's wait, not time since the queue first filled
- provider_resilience.py: trip-counter zero children also cover auth and
  config_incomplete, which record_failure / record_account_failure emit

Not taken: the replay_delivery residence-deadline stall that surfaces as
connection_lost is unchanged from main and relabelling it would stop a circuit
vote; handed to the lead as a follow-up.
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Review round 1 response (grok, FIX-FIRST) — thank you, sharp catches.

  • P1 replay_delivery.py:747 (residence-deadline stall → connection_lost) — agreed it's a real mislabel, but it is unchanged from main (the guard and its connection_lost outcome predate this PR; the diff only renamed the token in the sibling clock() < packet_deadline branch). Relabelling it means _local_reason = delivery_expired where connection_lost fires today, which stops a serve-failure circuit vote and fleet-health attribution — a behavior change outside this telemetry-only PR. Handed to the lead as a follow-up with the one-line guard fix; not taken here.
  • P1 resilient_stream.py:544 (window successor keeps capacity_full on the wall) — fixed: fail(LOCAL_DELIVERY_REPLAY_SEND_STALLED) and parakeet_window.fail latches the token in its typed allowlist. The window's own buffer_cap / queue_timeout / admission remain capacity_full (destination refusing). Test: test_window_successor_replay_wall_expiry_is_replay_send_stalled and the real-window latch parametrize.
  • P1 receiver.py:2008 (hard-coded capacity_full at the exhausted terminate) — fixed: reason=live_stt_terminal_reason(delivery, LOCAL_DELIVERY_SEND_QUEUE_FULL); same funnel, phase, and circuit outcome.
  • P2 soniox.py:357 (queue age = session age when the queue never empties) — fixed at the source: AudioSendQueue now records each item's enqueue time and pops it as items are taken (oldest_queued_age), so the age is the oldest still-queued packet's wait. Test pins the one-packet-ahead case.
  • P2 provider_resilience.py:27 (zero children miss auth / config_incomplete) — fixed; both are pre-created and probed in the zero-children test.

Round-2 delta: 9 files, 583 tests green on the affected suites (backend/test.sh with BACKEND_UNIT_TEST_FILE_LIST), formatting clean.

…local tokens

Round 1's receiver fix forwarded live_stt_terminal_reason(delivery, ...), which
let a tail that died without latching a local cause (a residence-deadline write
stall with the vendor socket open) resolve to the generic connection_lost and
vote on the serve-failure circuit from a site that had never voted. New
live_failure.local_tail_terminal_reason() forwards a local-delivery token when
the tail latched one and send_queue_full otherwise, so this site keeps its
pre-PR circuit semantics exactly while naming the local cause. Pinned by a
test; the residence-deadline label itself stays with the lead (pre-existing).
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Review round 2 response (grok, delta, FIX-FIRST).

Correct catch, and it was a regression of mine from round 1, not the pre-existing issue: forwarding live_stt_terminal_reason(delivery, …) at the receiver's exhausted-recovery terminate let a tail that died with no local cause (the residence-deadline stall, vendor socket open) resolve to the generic connection_lost and open the selection circuit from a site that had never voted (it hard-coded a local token before this PR).

Fixed in 1856256f3d..HEAD: live_failure.local_tail_terminal_reason() forwards only local-delivery tokens (send_queue_full / replay_send_stalled / delivery_expired) and otherwise send_queue_full, the bound this site observed — so the site keeps exactly its pre-PR circuit semantics (never votes) while naming the local cause when the tail latched one. Provider deaths keep their attribution through the death monitor, as before. Pinned by test_exhausted_tail_terminate_forwards_only_local_tokens_never_a_circuit_vote, which also asserts none of the local tokens are serve-failure or circuit-opening reasons.

The underlying mislabel — the residence-deadline stall latching nothing and reading as connection_lost through the generic funnel — is unchanged from main and its fix (drop the clock() < packet_deadline half of the guard at replay_delivery.py:747) would stop a circuit vote that fires today. That is a behavior change outside this telemetry-only PR; it is with the lead as a follow-up (debt c3e1dd). Review round cap reached; the lead rules on merge.

test_parakeet_window_live's serve-failure spy and test_live_routing_health's
SimpleNamespace stub took no arguments, so the trip-counter cause plumbing
(error_class=...) raised inside them and CI shards 2 and 4 failed with the spy
counting zero serve failures. Stubs now accept and forward the keyword; the
counting spy keeps calling through to the real breaker.
…ents

The SimpleNamespace fake circuit in test_live_router_hardening took zero
arguments for record_failure and one positional for record_account_failure,
so the trip-counter cause plumbing (error_class=..., keyword-only) raised
inside the fake and CI shard 4 failed on the endpoint-isolation and
saturated-target tests. The fakes now accept and ignore the keywords; a
sweep found no other zero-argument record_* stubs in the suite.
@Git-on-my-level
Git-on-my-level merged commit 34ce402 into main Oct 21, 2026
56 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/soniox-telemetry branch October 21, 2026 18:57
Git-on-my-level added a commit that referenced this pull request Oct 21, 2026
…gible_reason label (P34 follow-up) (#23087)

## Summary
Two lead-ruled follow-ups to #23074 (P34). (1) `replay_delivery.py`: a
live tail whose write is still blocked when the frame's residence
deadline passes — the unpaced-initial-leg case, where a blocked
`ws.send` never raises `AudioDeliveryExpired` — previously latched no
local reason and fell to the default `connection_lost`, which votes on
the provider's serve-failure circuit and counts as provider failure
while the vendor socket stayed open (review of #23074, lead ruling
603b95: "local stall must not vote the circuit or count as provider
failure"). The `clock() < packet_deadline` half of the guard is dropped;
any unconfirmed write with the connection alive latches
`delivery_expired`. (2) Lead ruling f12e4a:
`omi_listen_demand_exhausted_sessions_total` gains a bounded
`ineligible_reason` label — the first failing admission condition
(`recovery_off` / `unmanaged_chain` / `onboarding` / `phone_call` /
`language_unqualified` / `no_profile`, `none` for the eligible cohorts)
— because ~300/10m ineligible sessions are the only cohort hitting
`chain_exhausted` and the cohort alone cannot say which exclusion they
share.

## Behavior change
Deliberate and lead-ruled, scoped to one branch: the residence-deadline
tail stall now reports `delivery_expired` (censored, no circuit vote, no
provider-failure attribution) where it reported `connection_lost`
(attributable, circuit-opening). The label change is telemetry-only:
`capture_demand_admission`'s eligibility conjunction is untouched;
`ineligible_reason` only names why a session already judged ineligible
is in that cohort.

## How to read it
- The stall: `sum by (reason)
(increase(omi_fallback_total{job="backend-listen-metrics",component="stt_live_session"}[10m]))`
— the residence-deadline case now lands in `delivery_expired` instead of
`connection_lost`.
- The exclusion split: `sum by (ineligible_reason, outcome)
(increase(omi_listen_demand_exhausted_sessions_total{job="backend-listen-metrics",demand_cohort="ineligible"}[10m]))`
(outcome=yes means the session also exhausted its selection/recovery
hop).
- Zero children exist for every reason from pod start.

## Lane / contract
Lane soniox-telemetry (P34 follow-up; rulings 603b95 + f12e4a). Contract
row in `swarm/contracts.md`: `omi_listen_demand_exhausted_sessions_total
ineligible_reason`. Owner sign-offs for other lanes' files: none needed.

## Product invariants affected
none

## Verification
`backend/test.sh` with `BACKEND_UNIT_TEST_FILE_LIST` (13 files, unit
layer, under `omi-heavy`, 4 workers): new
`test_unpaced_tail_write_blocked_through_residence_deadline_is_local_not_provider_death`
(reproduced the reviewer's scenario failing before the fix:
`typed_death_reason` was None with the vendor alive), the
demand-telemetry suite extended (first-failing-condition mapping incl.
`no_profile`, bounded labels, zero children, `finish()` carries the
reason). Not run: the full backend suite, any live or prod check.

## Rollback
Revert the PR. No flags, no data migration.

Failure-Class: none


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/23087?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/23087?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F23087&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. -->
Git-on-my-level added a commit that referenced this pull request Oct 21, 2026
…ls.observability (M3 final merge)

routers.chat -> utils.stt.provider_resilience -> utils.stt.live_reason now imports
utils.observability.reasons (main #23074 x integration's reason enums). The chat router
harness stubs utils.observability as a plain module, so ~60 chat/messaging tests failed
with 'utils.observability is not a package'. Load reasons.py once per process (it
registers omi_reason_total) and install it under the stub.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ZhaZhaBei pushed a commit to ZhaZhaBei/omi that referenced this pull request Oct 22, 2026
Main moved 108 commits past the M3 prep merge (b859b78); one conflict:
- backend/utils/stt/live_reason.py: keep integration's LiveSttReason-backed sets and add
  main's BasedHardware#23074 local-delivery death reasons (send_queue_full, replay_send_stalled,
  delivery_expired) as LiveSttReason members plus main's LOCAL_DELIVERY_* constants.
Label-debt ratchet: +2 rows (BasedHardware#23074 breaker trip causes), for lane 14.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ZhaZhaBei pushed a commit to ZhaZhaBei/omi that referenced this pull request Oct 22, 2026
… in the integration enums; break the live_reason import cycle (M3 final merge)

- FallbackReason gains send_queue_full, replay_send_stalled, delivery_expired (already in
  LiveSttReason), so record_fallback keeps them instead of 'other'.
- fallback.initialize_live_stt_exhausted_children builds the live failure set from the
  LiveSttReason enum: it runs at import, and importing utils.stt.live_reason there cycles
  when live_reason loads first (main's provider_resilience import order).
- test_reason_label_enums: the live vocabulary is 36 with BasedHardware#23074.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Oct 22, 2026
…r budget (#23271)

## Why
- **Local delivery deaths are no longer covered.** P34 (#23074, train P
2026-10-21 22:24Z) moved Soniox/Modulate local delivery deaths off
`reason="capacity_full"`. `omi-stt-capacity-full-exhausted` therefore no
longer sees sessions exhausted by our own send path.
- **Vendor out-of-credits paged nothing purpose-built.** Modulate's 429
"Insufficient credits" (2026-10-22 from ~02:00Z) was only caught ~1h
late, by the generic sync failure-rate rules. #23234 now types it
`provider_budget_exhausted` on `omi_sync_transcription_job_total`.

## What
| Rule | Severity / for | Condition |
|---|---|---|
| `omi-stt-local-delivery-exhausted` (Live STT) | warning / 30m |
`omi_fallback_total{component="stt_live_session",reason=~"send_queue_full\|replay_send_stalled\|delivery_expired",outcome="exhausted"}`
/ listen-accepted > 0.03, with >= 100 accepted per 15m |
| `omi-sync-provider-budget-exhausted` (Backend-sync, gmp-cloud-run) |
critical / 5m | `sum by (namespace)
increase(omi_sync_transcription_job_total{outcome="provider_budget_exhausted"}[15m])
>= 3` on backend-sync and backfill |

- **Where the rules live:** in `alert-rules.json` and the split exports
(`alerts/live-stt.json`, `alerts/backend-sync.json`).
- **Supporting changes:**
- the live-STT rule is added to the pusher live-alert import allowlist
(`live-alert-gate.json`, `verify_pusher_live_alert_route.py`);
  - the GMP inventory is regenerated;
  - a contract test is added.

## Verification
- **Backtest of the local-delivery rule** (prod Prometheus, 15m steps):

  | Window | p50 | max | Result |
  |---|---|---|---|
| Post-P34, pre-#23147 (10-21 22:40Z to 10-22 03:10Z, replay-pacing bug
live) | 0.039 | 0.060 | fires |
  | Post-#23147 (10-22 03:40Z to 08:00Z) | 0.000 | 0.012 | silent |

Thresholds were set off-peak; I'll revisit after the 10-22 14–16Z peak
read.
- **Budget rule:** the outcome is new, so there is no history. It stays
silent until #23234 is deployed to Cloud Run.
- **Tests:** `BACKEND_UNIT_TEST_FILE_LIST` covering all 25 monitoring,
alert and GMP unit files passes.

Review: infra rollout lead before merge.

🤖 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/23271?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/23271?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F23271&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. -->
Dimank92 pushed a commit to Dimank92/omi that referenced this pull request Oct 22, 2026
…r budget

P34 (BasedHardware#23074) moved Soniox/Modulate local delivery deaths off capacity_full, so
omi-stt-capacity-full-exhausted no longer sees them. Add
omi-stt-local-delivery-exhausted (warning, >3% of accepted sessions exhausted
on send_queue_full|replay_send_stalled|delivery_expired, >=100 accepted/15m,
for 30m). Backtest: fires through the pre-BasedHardware#23147 pacing bug (p50 0.039, max
0.060), silent after BasedHardware#23147 (max 0.012).

Modulate's 429 "Insufficient credits" (10-22 from ~02:00Z) paged nothing
purpose-built. BasedHardware#23234 types it provider_budget_exhausted on sync jobs; add
omi-sync-provider-budget-exhausted (critical, >=3 jobs/15m on backend-sync or
backfill via gmp-cloud-run, for 5m).

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