Skip to content

feat(llm-gateway): enable production serving - #9651

Merged
Git-on-my-level merged 1 commit into
mainfrom
codex/prod-llm-gateway-launch
Jul 13, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
codex/prod-llm-gateway-launch

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 13, 2026 •

Copy link
Copy Markdown
Member

Review in cubic

@mintlify

mintlify Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
omi 🟢 Ready View Preview Jul 13, 2026, 9:15 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@Git-on-my-level
Git-on-my-level merged commit 6f6db03 into main Jul 13, 2026
23 of 29 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/prod-llm-gateway-launch branch July 13, 2026 22:58
kodjima33 added a commit that referenced this pull request Jul 17, 2026
…ts (#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 #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: #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)
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 branch was successfully deployed

1 active deployment
staging - docs — d83e37d2 Deployed Jul 13, 2026 by mintlify[bot]
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