Repository navigation
fix(deploy): keep prod LLM-gateway serving off until the gateway exists - #9922
Merged
Merged
Conversation
The 2026-07-17 prod deploy (first successful since 07-14) shipped OMI_LLM_GATEWAY_FEATURE_MODE=gateway to every prod backend service, but the llm-gateway was never deployed in prod: the Cloud Run URL http://172.16.160.108 is a RESERVED static IP with no forwarding rule (prod-omi-self-hosted-llm-ip-address), and the GKE URL points at prod-omi-llm-gateway.prod-omi-backend.svc.cluster.local which has no helm release. Every omi:auto:* LLM call hung through connect timeouts and openai-client retries before falling back, driving POST /v2/messages from 3-10s to 122-560s — mobile chat read as fully down (TestFlight + prod App Store builds). Flip the five prod FEATURE_MODE entries (backend, backend-sync, backend-sync-backfill via anchor, backend-integration, gke backend-listen) to 'off', matching the live mitigation already applied to prod, and update the deploy contract test to encode disabled-until-deployed. Gateway URL/token wiring stays declared so re-enablement is a one-line flip once the prod gateway actually exists. Verification: - Live prod (before): POST /v2/messages latencies 122-560s on revision backend-7290a41; gateway events outcome=error/timeout for chat_agent, chat_extraction, fair_use, onboarding. - Live prod (after removing the flag): real-user POSTs 3.5-8.8s on backend-01158-lmd; authenticated real chat send as uid viUv7Gt... returned an AI reply over SSE in 3.9s. - backend: pytest tests/unit/test_llm_gateway_deploy_contract.py tests/unit/test_backend_runtime_env_validator.py -> 61 passed. - validate-backend-runtime-env.py --env dev/prod --check-workflows both pass. - helm lint charts/backend-listen -f prod values: 0 failed. Failure-Class: new Co-Authored-By: Claude Fable 5 <[email protected]>
undivisible
pushed a commit
to undivisible/omi
that referenced
this pull request
Sep 29, 2026
…ts (BasedHardware#9922) ## Summary Prod chat (mobile TestFlight + App Store) went down after today's prod backend deploy — every `POST /v2/messages` hung 122–560s (vs the normal 3–10s) until mobile clients gave up. **Root cause:** `d83e37d21a` ("feat(llm-gateway): enable production serving", merged Jul 13) turned on `OMI_LLM_GATEWAY_FEATURE_MODE=gateway` for all prod backend services, but the llm-gateway itself was never deployed to prod: - Cloud Run services point at `http://172.16.160.108` — the static IP `prod-omi-self-hosted-llm-ip-address` is **RESERVED with no forwarding rule** (TCP blackhole; audit logs show no forwarding rule ever attached). - GKE `backend-listen` points at `prod-omi-llm-gateway.prod-omi-backend.svc.cluster.local` — **no such helm release/service exists** in the prod cluster. Because prod deploys had been failing since Jul 14 (fixed by BasedHardware#9911), the flag sat unshipped until today's deploy (`backend:7290a41`, ~11:43 UTC) released it. Every `omi:auto:*` LLM call (chat_agent, chat_extraction, fair_use, onboarding) then hung through connect timeouts + openai-client retries before falling back to the direct path. **This PR** flips the five prod `OMI_LLM_GATEWAY_FEATURE_MODE` entries to `'off'` (Cloud Run backend / backend-sync / backend-sync-backfill via anchor / backend-integration, plus GKE backend-listen), matching the live mitigation already applied to prod, and updates the deploy contract test to encode "wiring declared, serving off until the gateway is actually deployed". URL/token wiring stays so re-enablement is a one-line flip once a reachable prod gateway exists. ## Live mitigation already applied (prod is healthy now) - Removed `OMI_LLM_GATEWAY_FEATURE_MODE` from Cloud Run `backend` (revision `backend-01158-lmd`, 100% traffic), `backend-sync`, `backend-sync-backfill`, `backend-integration`; same for GKE `prod-omi-backend-listen` via `kubectl set env`. - This PR makes the repo manifest match prod so the next deploy doesn't re-break chat. ## Verification - Before: real-user `POST /v2/messages` latencies 122s/248s/364s/505s on `backend-7290a41`; gateway telemetry `outcome=error reason=unexpected_error` (fair_use, onboarding) and `outcome=fallback reason=timeout` (chat_agent, chat_extraction). - After: real-user POSTs 3.5s/3.6s/8.8s 200 on `backend-01158-lmd`; authenticated end-to-end send as a real user (`viUv7Gt…`) via `https://api.omi.me/v2/messages` returned the AI reply over SSE in **3.9s**. - `pytest tests/unit/test_llm_gateway_deploy_contract.py tests/unit/test_backend_runtime_env_validator.py` → 61 passed. - `validate-backend-runtime-env.py --env dev --check-workflows` and `--env prod --check-workflows` → both pass. - `helm lint charts/backend-listen -f prod_omi_backend_listen_values.yaml` → 0 failed. - Note: `scripts/pre-deploy-check.sh` not run locally (uv cannot fetch cpython 3.11.15 on this machine right now); CI runs the same contract. ## Product invariants affected none ## Failure class (fixes) Failure-Class: new Adds `.github/failure-classes/FC-unprovisioned-rollout-target.json`: a rollout flag routing production traffic to a service endpoint must not be enabled for an environment until that endpoint is provisioned and reachable there (evidence: BasedHardware#9651). ## Follow-up - Deploy the llm-gateway to prod (helm release + ingress bound to `prod-omi-self-hosted-llm-ip-address`, service token, Vertex WI perms) before flipping FEATURE_MODE back to `gateway`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prod chat (mobile TestFlight + App Store) went down after today's prod backend deploy — every
POST /v2/messageshung 122–560s (vs the normal 3–10s) until mobile clients gave up.Root cause:
d83e37d21a("feat(llm-gateway): enable production serving", merged Jul 13) turned onOMI_LLM_GATEWAY_FEATURE_MODE=gatewayfor all prod backend services, but the llm-gateway itself was never deployed to prod:http://172.16.160.108— the static IPprod-omi-self-hosted-llm-ip-addressis RESERVED with no forwarding rule (TCP blackhole; audit logs show no forwarding rule ever attached).backend-listenpoints atprod-omi-llm-gateway.prod-omi-backend.svc.cluster.local— no such helm release/service exists in the prod cluster.Because prod deploys had been failing since Jul 14 (fixed by #9911), the flag sat unshipped until today's deploy (
backend:7290a41, ~11:43 UTC) released it. Everyomi:auto:*LLM call (chat_agent, chat_extraction, fair_use, onboarding) then hung through connect timeouts + openai-client retries before falling back to the direct path.This PR flips the five prod
OMI_LLM_GATEWAY_FEATURE_MODEentries to'off'(Cloud Run backend / backend-sync / backend-sync-backfill via anchor / backend-integration, plus GKE backend-listen), matching the live mitigation already applied to prod, and updates the deploy contract test to encode "wiring declared, serving off until the gateway is actually deployed". URL/token wiring stays so re-enablement is a one-line flip once a reachable prod gateway exists.Live mitigation already applied (prod is healthy now)
OMI_LLM_GATEWAY_FEATURE_MODEfrom Cloud Runbackend(revisionbackend-01158-lmd, 100% traffic),backend-sync,backend-sync-backfill,backend-integration; same for GKEprod-omi-backend-listenviakubectl set env.Verification
POST /v2/messageslatencies 122s/248s/364s/505s onbackend-7290a41; gateway telemetryoutcome=error reason=unexpected_error(fair_use, onboarding) andoutcome=fallback reason=timeout(chat_agent, chat_extraction).backend-01158-lmd; authenticated end-to-end send as a real user (viUv7Gt…) viahttps://api.omi.me/v2/messagesreturned the AI reply over SSE in 3.9s.pytest tests/unit/test_llm_gateway_deploy_contract.py tests/unit/test_backend_runtime_env_validator.py→ 61 passed.validate-backend-runtime-env.py --env dev --check-workflowsand--env prod --check-workflows→ both pass.helm lint charts/backend-listen -f prod_omi_backend_listen_values.yaml→ 0 failed.scripts/pre-deploy-check.shnot run locally (uv cannot fetch cpython 3.11.15 on this machine right now); CI runs the same contract.Product invariants affected
none
Failure class (fixes)
Failure-Class: new
Adds
.github/failure-classes/FC-unprovisioned-rollout-target.json: a rollout flag routing production traffic to a service endpoint must not be enabled for an environment until that endpoint is provisioned and reachable there (evidence: #9651).Follow-up
prod-omi-self-hosted-llm-ip-address, service token, Vertex WI perms) before flipping FEATURE_MODE back togateway.🤖 Generated with Claude Code