fix+cleanup(desktop): remove dead Deepgram proxy code, deprecate Rust endpoints, fix the critical bug on the env var fallback on deployment#6305
Conversation
…ervice Remove batchTranscribeFull (stereo batch via Rust proxy), legacy TranscriptSegment type, TranscriptHandler callback, proxyBaseURL, deepgramBaseURL, BatchResponse models, and missingAPIKey error case. All STT now goes through Python backend endpoints. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace start(onTranscript:) with start(onSegments:onEvent:) and update handleTranscript to accept BackendSegment[] directly, removing the intermediate TranscriptSegment conversion layer. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deepgram key is no longer needed client-side — all STT goes through Python backend which manages its own DG credentials. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Both /v1/proxy/deepgram/v1/listen (REST) and /v1/proxy/deepgram/ws/v1/listen (WS) now return 410 Gone after 2026-04-05 05:00 UTC. Until then they continue proxying to Deepgram for any old clients. Replacement endpoints are on the Python backend: POST /v2/voice-message/transcribe and WS /v2/voice-message/transcribe-stream. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Greptile SummaryThis PR removes dead Swift code related to the legacy Deepgram proxy path ( Key findings:
Confidence Score: 3/5Mostly safe to merge; the Swift dead-code removal is clean, but the Rust deprecation timestamp is off by ~49 hours — fix before merging if the April 5 cutoff matters. The Swift side of this PR is a straightforward, well-scoped dead-code removal with no risky logic changes. The one concrete bug is the hardcoded Unix timestamp in proxy.rs that mismatches its own comment by ~49 hours, making the "24h grace period" effectively ~73 hours. Since the deprecation is a one-way door (returns 410 after the cutoff, no rollback path), an incorrect timestamp means the proxy silently keeps forwarding to Deepgram longer than intended. This is a meaningful correctness issue even if the practical impact is limited to extra Deepgram usage for a couple of extra days. desktop/Backend-Rust/src/routes/proxy.rs — the DEPRECATION_TIMESTAMP constant needs correction Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Desktop App Request] --> B{Request type?}
B -->|PTT live streaming| C[Python /v2/voice-message/transcribe-stream WS]
B -->|PTT batch| D[Python /v2/voice-message/transcribe REST]
B -->|Conversation capture| E[Python /v4/listen WS]
B -->|Legacy Deepgram proxy| F{is_deepgram_proxy_deprecated?}
F -->|false - before cutoff ~Apr 7| G[Rust → Deepgram upstream]
F -->|true - after cutoff| H[410 Gone]
C --> I[TranscriptionService onSegments callback]
D --> I
E --> I
I --> J[PushToTalkManager / AppState]
|
| // 2026-04-05 05:00:00 UTC = 1775,541,600 seconds since epoch | ||
| const DEPRECATION_TIMESTAMP: u64 = 1_775_541_600; | ||
| SystemTime::now() |
There was a problem hiding this comment.
Incorrect Unix timestamp — deprecation fires ~49 hours late
The comment states 2026-04-05 05:00:00 UTC = 1,775,541,600, but that arithmetic is wrong. Computing the correct Unix timestamp for 2026-04-05 05:00:00 UTC:
- Days from epoch to 2026-01-01: 20,454 (42 regular × 365 + 14 leap × 366)
- Days from 2026-01-01 to 2026-04-05: 31 + 28 + 31 + 4 = 94
- Total: 20,548 × 86,400 = 1,775,347,200
- Plus 5 hours (18,000 s): 1,775,365,200
1_775_541_600 is instead approximately 2026-04-07 06:00:00 UTC (≈49 hours late). The intended "24h grace period" becomes roughly 73 hours — the proxy will keep forwarding to Deepgram roughly two days longer than planned.
| // 2026-04-05 05:00:00 UTC = 1775,541,600 seconds since epoch | |
| const DEPRECATION_TIMESTAMP: u64 = 1_775_541_600; | |
| SystemTime::now() | |
| // 2026-04-05 05:00:00 UTC = 1_775_365_200 seconds since epoch | |
| const DEPRECATION_TIMESTAMP: u64 = 1_775_365_200; |
The epoch value 1_775_541_600 resolved to April 7 (49h late). Correct value for April 5 05:00 UTC is 1_775_365_200. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The full stereo batch via Rust proxy was removed in this PR. Update the class doc to reflect that. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR #6287 merged at 02:37 UTC; cutoff at 05:00 UTC is ~26h, not 24h. Timestamp value is intentional (round number), comment was inaccurate. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Validates the epoch constant matches 2026-04-05 05:00 UTC and tests before/at/after cutoff behavior. Addresses tester coverage gap. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CP9 Changed-Path Coverage ChecklistClassifications:
CP8.1 Test Detail Table
by AI for @beastoin |
OMI_API_URL points to the Rust desktop-backend (Cloud Run), which does not have /v2/voice-message/* endpoints. PTT streaming/batch was routing to the wrong service and getting 404. Now PTT always uses OMI_PYTHON_API_URL or falls back to api.omi.me directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Critical bug found during CP9A: PTT live streaming routes to wrong backendMon identified that PTT WS streaming in v0.11.223 was hitting the Rust desktop-backend ( Root cause: Fix: Removed Verification: Built on Mac Mini, This is a release blocker for all v0.11.223 desktop users — PTT live mode is completely broken until this merges and triggers a new release. by AI for @beastoin |
CP9A L1 Synthesis (Build + Run Changed Component)Changed components: Desktop Swift app + Desktop Rust backend. Rust backend (P1-P3): Desktop Swift app (P4-P8): Built on Mac Mini with
Untested at L1: Full PTT live e2e (P4) — named test bundle requires fresh auth and callback URL scheme may not redirect to Paths proven: P1 (PASS), P2 (PASS via unit test), P3 (PASS via unit test), P5 (PASS — binary verification), P6 (PASS — binary verification), P7 (PASS — build success), P8 (PASS — build success). CP9B L2 StatusL2 requires integrated desktop+backend testing. The app with this fix points PTT to Given this is a release blocker (all v0.11.223 users have broken PTT), recommending merge to unblock the fix. by AI for @beastoin |
…points (BasedHardware#6305) Closes BasedHardware#6306. Follow-up to PR BasedHardware#6287 (desktop PTT migration to Python backend). Removes all dead Deepgram client-side code from the desktop macOS app now that STT is fully routed through the Python backend. Adds a ~26h deprecation sunset to the Rust proxy Deepgram endpoints (410 Gone after 2026-04-05 05:00 UTC). ### Critical fix: PTT live streaming broken in v0.11.223 `TranscriptionService.pythonBackendBaseURL` was falling back to `OMI_API_URL` (Rust desktop-backend on Cloud Run) instead of `api.omi.me`. PTT WS streaming hit the Rust backend at `/v2/voice-message/transcribe-stream` → 404. **Fixed by removing the `OMI_API_URL` fallback** — PTT now goes to `OMI_PYTHON_API_URL` or `api.omi.me` directly. ### Changes **Desktop Swift app (-199 lines + PTT routing fix):** - `TranscriptionService.swift`: removed `batchTranscribeFull()`, `TranscriptSegment`, `TranscriptHandler`, legacy `start(onTranscript:)` wrapper, `proxyBaseURL`, `deepgramBaseURL`, `missingAPIKey` error case; **fixed `pythonBackendBaseURL` to not fall back to `OMI_API_URL`** - `PushToTalkManager.swift`: migrated from legacy `onTranscript` to `onSegments` API - `APIKeyService.swift`: removed Deepgram API key fetch/store/clear/env - `SettingsPage.swift`: removed Deepgram API key developer field - `AppState.swift`: removed `DEEPGRAM_API_KEY` from backend-served keys **Desktop Rust backend:** - `proxy.rs`: added `is_deepgram_proxy_deprecated()` with 2026-04-05 05:00 UTC cutoff; both DG endpoints return 410 Gone with migration message after cutoff; added 4 boundary tests ### Review cycle fixes - Fixed deprecation timestamp: was `1_775_541_600` (April 7, 49h late), corrected to `1_775_365_200` (April 5 05:00 UTC) - Updated stale doc comment in TranscriptionService.swift - Corrected "24h" to "~26h" in deprecation comment ### Tests - `cargo test --quiet` in Backend-Rust: 54 passed (4 new boundary tests) - `pytest backend/tests/unit/test_desktop_transcribe.py -q`: passed - Build verified on Mac Mini: app compiles, launches, binary confirms `api.omi.me` routing --- _by AI for @beastoin_
Closes #6306. Follow-up to PR #6287 (desktop PTT migration to Python backend).
Removes all dead Deepgram client-side code from the desktop macOS app now that STT is fully routed through the Python backend. Adds a ~26h deprecation sunset to the Rust proxy Deepgram endpoints (410 Gone after 2026-04-05 05:00 UTC).
Critical fix: PTT live streaming broken in v0.11.223
TranscriptionService.pythonBackendBaseURLwas falling back toOMI_API_URL(Rust desktop-backend on Cloud Run) instead ofapi.omi.me. PTT WS streaming hit the Rust backend at/v2/voice-message/transcribe-stream→ 404. Fixed by removing theOMI_API_URLfallback — PTT now goes toOMI_PYTHON_API_URLorapi.omi.medirectly.Changes
Desktop Swift app (-199 lines + PTT routing fix):
TranscriptionService.swift: removedbatchTranscribeFull(),TranscriptSegment,TranscriptHandler, legacystart(onTranscript:)wrapper,proxyBaseURL,deepgramBaseURL,missingAPIKeyerror case; fixedpythonBackendBaseURLto not fall back toOMI_API_URLPushToTalkManager.swift: migrated from legacyonTranscripttoonSegmentsAPIAPIKeyService.swift: removed Deepgram API key fetch/store/clear/envSettingsPage.swift: removed Deepgram API key developer fieldAppState.swift: removedDEEPGRAM_API_KEYfrom backend-served keysDesktop Rust backend:
proxy.rs: addedis_deepgram_proxy_deprecated()with 2026-04-05 05:00 UTC cutoff; both DG endpoints return 410 Gone with migration message after cutoff; added 4 boundary testsReview cycle fixes
1_775_541_600(April 7, 49h late), corrected to1_775_365_200(April 5 05:00 UTC)Tests
cargo test --quietin Backend-Rust: 54 passed (4 new boundary tests)pytest backend/tests/unit/test_desktop_transcribe.py -q: passedapi.omi.meroutingby AI for @beastoin