Skip to content

chore(charts): sync SONIOX_API_KEY into backend secrets - #12298

Merged
mdmohsin7 merged 2 commits into
mainfrom
rex/soniox-secret-sync
Aug 30, 2026
Merged

mdmohsin7 merged 2 commits into
mainfrom
rex/soniox-secret-sync

Conversation

@mdmohsin7

@mdmohsin7 mdmohsin7 commented Aug 27, 2026 •

Copy link
Copy Markdown
Member

Why

SONIOX_API_KEY exists in Secret Manager (org-level key, created 2025-05-17) and
#12295 wired backend-listen to consume it, but the ExternalSecret enumerates its keys
explicitly and Soniox was not among the 34 listed. The key therefore never reaches the
cluster secret, so the binding resolves to nothing and Soniox can never be selected.

What changed

Adds the SONIOX_API_KEY → SONIOX_API_KEY mapping to the prod and dev backend
secret charts, next to MODULATE_API_KEY and DEEPGRAM_API_KEY.

Verification

The org-level key was tested against the live Soniox service before this change:
authenticated, transcribed, and returned two distinct speakers on a two-speaker
sample. It is current, not stale.

The backend-listen binding is optional: true, so pods start fine whether or not the
key is present; this change is what makes the provider actually usable.

Review in cubic

@mdmohsin7
mdmohsin7 merged commit e0924c2 into main Aug 30, 2026
39 checks passed
@mdmohsin7
mdmohsin7 deleted the rex/soniox-secret-sync branch August 30, 2026 09:55
Git-on-my-level added a commit that referenced this pull request Aug 30, 2026
…equires (#12443)

## What broke

Live-captured conversations stopped finalizing in production at
**2026-08-30T15:21:42Z** and are still failing.

The pusher had not deployed since **2026-07-01** (`2ae7f78841`). #12429
fixed the pre-Helm capacity gate that was failing the lane, and the
rollout that followed (Helm applied 15:16:28Z, complete 15:28:51Z)
carried two months of change onto a Deployment whose environment was
never extended to match.

The old pusher never ran this code. Its opcode-104 handler called
`process_conversation` directly and never touched the durable-job
architecture. Today is the **first time the pusher has ever executed
`finalize_persisted_conversation`** — cold activation of a dormant
subsystem, not a contract drift. Verified: `backend/routers/pusher.py`,
`backend/utils/listen_pusher_session.py` and
`_claim_finalization_job_txn` are byte-identical across
`6f7c57ac15..6134ebd`.

## Root cause

The pusher chart ships **68 env vars where backend-listen ships 115**,
and `MEMORY_ENABLED` is among the 50 it lacks. Confirmed against the
live cluster:

```
prod-omi-pusher          68 env vars, zero MEMORY_* vars
prod-omi-backend-listen  115 env vars, MEMORY_ENABLED=on
```

`rollout_mode_env_value()` fail-closes to `off` when the flag is unset
(`backend/config/memory_rollout.py`).
`MemoryService.ensure_canonical_mutation_ready()` — called
**unconditionally and unwrapped** by `_extract_memories_inner` for every
non-discarded conversation — then raises `HTTPException(503, "Memory
writes are globally paused")`. `finalizer.py` converts that to
`ConversationFinalizationError('processing_failed')`, and the listen
session retries roughly 4x per conversation.

Measured distribution in a clean window (23:00–23:10Z, all entries):

| Exception | Count | Share |
| --- | --- | --- |
| `HTTPException` (this bug) | 366 | 89.5% |
| `LegalHoldAuthorityUnavailable` | 43 | 10.5% |

This PR fixes the 89.5%. The remainder is a separate, older regression —
see below.

## Why nothing paged

`finalizer.py` logs only `type(error).__name__`. Production emitted
~16k/hour of bare `error=HTTPException` carrying no status code, no
detail and no traceback, so the signature read as already-known. The
listener itself stayed healthy throughout — WS connections in band, 5/5
ready pods, listen-LB 5xx at zero, every `Backend-listen` critical rule
inactive, and no client-side Sentry spike. Audio was captured and
transcribed; it simply never became a conversation.

## The fix

Set `MEMORY_ENABLED=on` for dev and prod pusher, matching
backend-listen. It is a plain literal, so it requires no key from the
pusher's ExternalSecret — deliberately avoiding the failure class from
#12298, where a chart consumed a secret key the ExternalSecret did not
enumerate.

The test asserts the **contract**, not the key: the env a chart ships
must resolve to a mode that permits memory writes, and the two co-hosts
may not disagree. Against the charts as they stood during the incident
it fails with `assert 'off' == 'write'`.

## Failure class

This reopens an existing class. Its prevention artifact,
`test_conversation_notes_v2_beta_rollout.py`, pins three named flags
across backend-listen and the Cloud Run backend. It does not generalize
to other flags, and it does not know the pusher is now a third host of
`process_conversation`.

Failure-Class: FC-rollout-flag-absent-from-a-cohost-of-its-code-path

## Deliberately not in this PR

- **The other 49 missing env vars**, including `GEMINI_API_KEY`,
`USE_VERTEX_AI`, `LISTEN_FINALIZATION_ORPHAN_STALE_SECONDS` and the
`FAIR_USE_*` set. Real exposure, but several are secret refs and
widening them under incident pressure risks the #12298 class. Needs its
own change.
- **`LegalHoldAuthorityUnavailable`** (10.5% of failures) —
`current_destructive_operation_token()` at
`backend/database/legal_holds.py:403`, reached from
`canonical_memory_adapter.py:2029`, requires an active
`destructive_operation_gate(...)` context that this call site never
enters. Introduced by #12084, first seen in prod 2026-08-28T01:51:36Z
and firing continuously for ~2.5 days on
`/v1/conversations/from-segments`. Independent of this bug and of
today's deploy.
- **`/v1/embeddings` 404s at the LLM gateway.** `prod-omi-llm-gateway`
runs image `c61d815` (2026-08-20), which predates #12337's gateway
embeddings route; `gcp_llm_gateway.yml` is dispatch-only and was never
run after that merge. Swallowed at `vector_db.py`, so not user-visible
as an error — but `save_structured_vector` has been failing silently
since ~13:44Z, meaning **no conversation created since then has a
summary vector in Pinecone**, and it will not self-heal without a
backfill. Fix is to deploy the gateway, not to change code.


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/12443?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. -->
pull Bot pushed a commit to codingwatching/omi that referenced this pull request Aug 31, 2026
…equires

Every conversation stopped finalizing in prod at 2026-08-30T15:21:42Z. The
pusher had not deployed since 2026-07-01; BasedHardware#12429 fixed the pre-Helm capacity
gate blocking the lane, and the 15:16:28Z rollout brought two months of code
onto a Deployment whose env was never extended to match. The pusher chart
ships 68 env vars where backend-listen ships 115, and MEMORY_ENABLED is among
the 50 it lacks.

rollout_mode_env_value() fail-closes to `off` when the flag is unset, so
MemoryService.ensure_canonical_mutation_ready() -- called unconditionally by
_extract_memories_inner for every non-discarded conversation -- raised
HTTPException(503). finalizer.py catches it and logs only
type(error).__name__, so prod showed ~16k/hour of bare `error=HTTPException`
carrying no status, no detail and no traceback, which is why the signature
looked already-known and nothing paged on it.

Set MEMORY_ENABLED=on for dev and prod pusher, matching backend-listen. It is
a plain literal, so it needs no key from the pusher ExternalSecret.

The test asserts the contract rather than the key: the env the chart ships
must resolve to a mode that permits memory writes. It fails with
`assert 'off' == 'write'` against the charts as they stood during the incident.

This reopens FC-rollout-flag-absent-from-a-cohost-of-its-code-path. Its
prevention artifact, test_conversation_notes_v2_beta_rollout.py, pins three
named flags across backend-listen and Cloud Run backend; it does not
generalize to other flags or to the pusher as a third host of
process_conversation.

The remaining 49-var gap between the two charts is real and not addressed
here; widening it under incident pressure risks the ExternalSecret failure
class from BasedHardware#12298.

Failure-Class: FC-rollout-flag-absent-from-a-cohost-of-its-code-path

Co-Authored-By: Claude Opus 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.

2 participants