Skip to content

chore(backend): disable hosted Deepgram serving - #9936

Merged
Git-on-my-level merged 6 commits into
mainfrom
codex/disable-deepgram-serving
Jul 18, 2026
Merged

Git-on-my-level merged 6 commits into
mainfrom
codex/disable-deepgram-serving

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Summary

  • Disable hosted Deepgram for all real-traffic STT surfaces; deployment preferences cannot reactivate it.
  • Keep the self-hosted Deepgram Helm chart, its production dg.omi.me endpoint, and explicit self-hosted credential configuration.
  • Make provider/surface availability code-owned: hosted Deepgram is disabled, while self-hosted Deepgram is explicit streaming-only; default streaming, prerecorded, and PTT traffic uses Parakeet or Modulate.
  • Preserve the follow-up PTT stereo rejection and its E2E fake adjustment.

Verification

  • 325 focused backend unit tests passed, covering provider policy, hosted-Deepgram rejection, prerecorded routing, streaming backoff, deployment references, runtime-env validation, and the PTT follow-up.
  • validate-backend-runtime-env.py --env dev --check-workflows --check-rendered-cloud-run passed.
  • validate-backend-runtime-env.py --env prod --check-workflows --check-rendered-cloud-run passed.
  • make preflight passed (24 deterministic checks).
  • Final Luna review approved the combined branch: zero net self-hosted-chart diff, hosted Deepgram blocked from real traffic, and the PTT follow-up retained.

Local environment note

  • Attempted backend/testing/e2e/test_listen_stt.py; all 11 cases were blocked before app setup by an installed google-auth / google_auth_httplib2 API mismatch (google.auth.transport.Response missing), not by an application assertion.

Scope note

This verifies checked-in deployment source and rendered manifests. No live Kubernetes or Cloud Run inspection was possible because this environment has no cluster context or gcloud access.

Failure-Class: none

@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: 2bf82335d7

ℹ️ 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/routers/chat.py Resolved
Comment thread backend/routers/listen/receiver.py Resolved
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Monitor follow-up: PTT stereo rejection + e2e STT fake fix

Addressed both Codex P2 review threads on this Deepgram serving retirement PR.

Thread 1 — chat.py:1170 (preserve provider channel contract):
Deepgram was the only PTT provider that accepted stereo. The Parakeet/Modulate replacements wire a mono PCM path (process_audio_modulate hard-codes num_channels=1; ParakeetWebSocketSocket ignores the channels arg). A channels=2 PTT request would be billed as two channels while being transcribed as mono, corrupting timing and quality. The endpoint now rejects channels != 1 explicitly with WS close 1008 instead of silently downmixing or double-billing. Regression test: test_ws_rejects_stereo_after_deepgram_retirement.

Thread 2 — receiver.py:133 (update e2e STT fake for enabled providers):
The hermetic E2E harness still monkeypatched listen_receiver.process_audio_dg (removed by this PR) and forced STTService.deepgram (now raises RuntimeError). This broke 4 test_listen_stt e2e tests — the direct cause of the failing Hermetic Backend E2E check. The fake now patches the enabled provider entry points (process_audio_parakeet/process_audio_modulate) and returns STTService.parakeet; the failure-status provider assertion was updated from deepgram to parakeet.

Verification (local, in worktree venv):

  • tests/unit/test_desktop_transcribe.py::TestTranscribeStreamWebSocket: 13 passed (incl. the new stereo rejection test).
  • testing/e2e/test_listen_stt.py: 11 passed (the 4 previously failing tests now pass).
  • testing/e2e/test_listen_pusher_wire_contract.py: 6 passed.
  • pyright routers/chat.py: 0 errors. py_compile clean on all touched files.
  • Product-file line-count ratchet baseline for chat.py raised 1571→1580 with justification.

Both review threads resolved. CI has not registered new runs for this push yet (the branch is 50 commits behind main and in CONFLICTING state); the previously-failing Hermetic Backend E2E tests are verified green locally.

@mintlify

mintlify Bot commented Jul 17, 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 17, 2026, 11:40 PM

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

@Git-on-my-level Git-on-my-level changed the title chore(backend): retire Deepgram serving path chore(backend): disable hosted Deepgram serving Jul 17, 2026
@Git-on-my-level
Git-on-my-level force-pushed the codex/disable-deepgram-serving branch from bc496da to 15437fe Compare July 18, 2026 02:52
CI and others added 5 commits July 17, 2026 23:07
… providers

Addresses two Codex P2 review comments on the Deepgram serving retirement:

1. Preserve provider channel contract (chat.py:1170): Deepgram was the only
   PTT provider that accepted stereo. The Parakeet/Modulate replacements wire
   a mono PCM path, so a channels=2 PTT request would be billed as two
   channels while being transcribed as mono, corrupting timing and quality.
   Reject channels != 1 explicitly with WS close 1008 instead of silently
   downmixing or double-billing.

2. Update listen e2e STT fake for enabled providers (receiver.py:133): the
   hermetic E2E harness still monkeypatched listen_receiver.process_audio_dg
   (removed by this PR) and forced STTService.deepgram (now raises). This
   broke 4 listen_stt e2e tests in the Hermetic Backend E2E CI check. Point
   the fake at the enabled provider entry points (parakeet/modulate) and
   return STTService.parakeet, and update the failure-status provider
   assertion accordingly.

Verification:
- tests/unit/test_desktop_transcribe.py::TestTranscribeStreamWebSocket:
  13 passed (including the new test_ws_rejects_stereo_after_deepgram_retirement).
- testing/e2e/test_listen_stt.py: 11 passed (the 4 previously failing tests now pass).
- testing/e2e/test_listen_pusher_wire_contract.py: 6 passed.
- py_compile clean on all touched files.
Two CI checks were failing on this branch:

1. Backend unit suite: test_dg_start_guard.py expected connect_to_deepgram
   to be reachable with hosted Deepgram, but the retirement makes the path
   self-hosted-only (_deepgram_client_for_request raises unless
   is_dg_self_hosted). Patch is_dg_self_hosted=True so the start() guard
   behavior is still exercised.

2. Formatting (dart): a merge of origin/main dragged in 8 unrelated app/
   dart files with stale formatting. Revert them to main; this backend
   chore does not touch app/ code.

Failure-Class: none

Verification:
- backend/.venv pytest tests/unit/test_dg_start_guard.py
  tests/unit/test_deepgram_serving_disabled.py
  tests/unit/test_stt_provider_policy.py -> 13 passed
@Git-on-my-level

Copy link
Copy Markdown
Member Author

@cursor address merge conflict

@cursor

cursor Bot commented Jul 18, 2026 •

Copy link
Copy Markdown

Merge conflict resolved and pushed.

What conflicted: Only one file — .github/scripts/product_file_line_count_ratchet_baseline/backend-other.json. Both branches raised the line-count cap for validate-backend-runtime-env.py with different values and justifications:

  • Branch: 1906 lines (serving STT retirement)
  • main: 1790 lines (shared forbidden-env guard)

Resolution: After merging main, the validator is 1831 lines. The ratchet requires the baseline to match the actual line count exactly, so I set it to 1831 with a combined justification covering both changes.

Verification:

  • Line-count ratchet check passed
  • 105 focused post-merge unit tests passed (runtime env validator, render, workflow contracts, LLM gateway deploy contract)

Pushed: 66f22c5bd9 on codex/disable-deepgram-serving. The PR should no longer be in a conflicting state; CI can run on the updated branch.

Open in Web Open in Cursor 

Reconcile the backend-other line-count ratchet for
validate-backend-runtime-env.py at the post-merge count of 1831 lines,
combining the serving STT retirement and forbidden-env guard justifications.

Co-authored-by: David Zhang <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit d44fdcd into main Jul 18, 2026
37 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/disable-deepgram-serving branch July 18, 2026 04:25
undivisible pushed a commit to undivisible/omi that referenced this pull request Sep 29, 2026
## Summary
- Disable hosted Deepgram for all real-traffic STT surfaces; deployment
preferences cannot reactivate it.
- Keep the self-hosted Deepgram Helm chart, its production `dg.omi.me`
endpoint, and explicit self-hosted credential configuration.
- Make provider/surface availability code-owned: hosted Deepgram is
disabled, while self-hosted Deepgram is explicit streaming-only; default
streaming, prerecorded, and PTT traffic uses Parakeet or Modulate.
- Preserve the follow-up PTT stereo rejection and its E2E fake
adjustment.

## Verification
- 325 focused backend unit tests passed, covering provider policy,
hosted-Deepgram rejection, prerecorded routing, streaming backoff,
deployment references, runtime-env validation, and the PTT follow-up.
- `validate-backend-runtime-env.py --env dev --check-workflows
--check-rendered-cloud-run` passed.
- `validate-backend-runtime-env.py --env prod --check-workflows
--check-rendered-cloud-run` passed.
- `make preflight` passed (24 deterministic checks).
- Final Luna review approved the combined branch: zero net
self-hosted-chart diff, hosted Deepgram blocked from real traffic, and
the PTT follow-up retained.

## Local environment note
- Attempted `backend/testing/e2e/test_listen_stt.py`; all 11 cases were
blocked before app setup by an installed `google-auth` /
`google_auth_httplib2` API mismatch (`google.auth.transport.Response`
missing), not by an application assertion.

## Scope note
This verifies checked-in deployment source and rendered manifests. No
live Kubernetes or Cloud Run inspection was possible because this
environment has no cluster context or gcloud access.

Failure-Class: none

This branch was successfully deployed

1 active deployment
staging - docs — 66f22c5b Deployed Jul 18, 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.

2 participants