Skip to content

stt: unpaced tail residence-deadline stall is delivery_expired; ineligible_reason label (P34 follow-up) - #23087

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

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

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

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

View guided diff Turn on auto-fix

…gible_reason label (P34 follow-up)

Lead rulings 603b95 and f12e4a, follow-up to the P34 local-delivery split.

- replay_delivery: a live tail write still blocked when the frame's residence
  deadline passes (the unpaced initial-leg case: a blocked ws.send never raises
  AudioDeliveryExpired) latched no local reason and fell to connection_lost,
  which votes on the provider serve-failure circuit and counts as provider
  failure while the vendor socket stayed open. Any unconfirmed write with the
  connection alive now latches delivery_expired (censored, no circuit vote).
- demand telemetry: omi_listen_demand_exhausted_sessions_total gains the bounded
  ineligible_reason label - the first failing admission condition
  (recovery_off / unmanaged_chain / onboarding / phone_call /
  language_unqualified / no_profile; none for eligible cohorts) - so the ~300/10m
  ineligible sessions hitting chain_exhausted can be split by exclusion.
  capture_demand_admission's eligibility conjunction is untouched.
@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-21T19:12:58.112336Z b8b3abd PR opened
ℹ️ 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.

…s metric

Review of the P34 follow-up (Luna, SHIP, minor): a batch preview can move an
admitted session into the ineligible cohort after admission with no exclusion
reason, so that session closes on the (ineligible, none) series; it was not
pre-initialized, so increase() would read its first burst as zero.
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Review round 1 (Luna, SHIP) — the one minor taken: the (ineligible, outcome, none) zero children are now pre-created (a batch preview can move an admitted session into the ineligible cohort after admission with no exclusion reason), and the zero-children test probes it. c1e3dba710.

@Git-on-my-level
Git-on-my-level merged commit 6ebf3da into main Oct 21, 2026
56 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/soniox-telemetry-2 branch October 21, 2026 19:35
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