Repository navigation
Remove dead Speechmatics/Soniox STT code from backend - #6118
Conversation
Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Remove STTService enum values, language sets, and process_audio functions for providers that are no longer used. Only Deepgram remains. Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Remove dead socket variables, routing branches, and cleanup code for removed providers. Change stt_service param type to Optional[str] for backward compatibility with old app clients sending 'soniox'. Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
…le.py Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
…ebhooks.py Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
…s.txt Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
…cript Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Remove remove_user_soniox_speech_profile mock. Add missing get_paid_plan_definitions stub to fix pre-existing import error. Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Greptile SummaryThis PR is a focused dead-code removal that strips all Speechmatics and Soniox STT provider code from the backend (~1,100 lines across 12 files), leaving Deepgram as the sole provider. The simplification is well-scoped: socket variables, routing branches, Redis helpers, requirements, and two entire files are cleanly deleted, and Key changes:
Confidence Score: 4/5Safe to merge after fixing the failing The production-path changes are correct and well-reasoned. The only concrete defect is a test assertion that was not updated alongside the code:
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Client WebSocket connect
stt_service: Optional str] --> B{custom STT?}
B -- yes --> C[Use app-suggested transcripts]
B -- no --> D{Multi-channel?}
D -- yes --> E[process_audio_dg
per channel]
D -- no --> F[get_stt_service_for_language]
F --> G{STT_SERVICE_MODELS}
G -- dg-nova-3 --> H[STTService.deepgram
model=nova-3]
G -- dg-nova-2 --> I[STTService.deepgram
model=nova-2]
H --> J[process_audio_dg
single-channel]
I --> J
J --> K{has_speech_profile?}
K -- yes --> L[deepgram_profile_socket
preseconds window]
K -- no --> M[deepgram_socket
direct stream]
L --> M
|
| @staticmethod | ||
| def get_model_name(value): | ||
| if value == STTService.deepgram: | ||
| return 'deepgram_streaming' |
There was a problem hiding this comment.
get_model_name implicitly returns None for unrecognised values
With Soniox/Speechmatics branches removed, the method only handles STTService.deepgram. Any other value (impossible today since the enum has a single member, but a defensive concern) falls through with an implicit None return, which is silent and hard to debug. Consider either adding an explicit else branch or removing the method entirely since it has only one meaningful path now.
| @staticmethod | |
| def get_model_name(value): | |
| if value == STTService.deepgram: | |
| return 'deepgram_streaming' | |
| @staticmethod | |
| def get_model_name(value): | |
| if value == STTService.deepgram: | |
| return 'deepgram_streaming' | |
| return None # Unknown / unsupported provider |
With Soniox and Speechmatics removed, only DG single-channel and multi-channel accumulation paths remain. Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
With Soniox and Speechmatics removed, only DG single-channel and multi-channel accumulation paths remain. Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
…lues Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
…lues Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
…alues Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
…t.py Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Removes all references to Soniox and Speechmatics STT providers, which have been removed from the backend. Backend now uses only Deepgram. Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Removes Soniox and Speechmatics from diagrams, provider tables, and parameter descriptions. Backend now uses only Deepgram. Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Comment no longer refers to a removed provider. Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
… card Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
…ion docs Fixes #6116 Co-Authored-By: Claude Opus 4.6 <[email protected]>
## Summary - Bump app build number from 1.0.528+794 to 1.0.528+795 - 287 commits since last Codemagic build (v1.0.528+792) Key changes in this release: - **PR #5995**: Phone mic WAL + AudioSource refactor (backend already deployed) - **PR #6118**: Remove dead Speechmatics/Soniox STT code - **PR #6119**: Remove redundant desktop code from app/ - **PR #6103/#6061**: Transcribe fallback removal + pusher recovery - **PR #6083**: Free-tier fair-use enforcement - **Lock bypass fixes**: 19+ security fixes for locked conversations - **BLE reliability**: Native-owned BLE connection pipeline - **Phone call UI**: Minimizable phone call with home screen banner ## After merge 1. Tag for Codemagic: `git tag v1.0.528+795-mobile-cm && git push origin v1.0.528+795-mobile-cm` 2. Monitor Codemagic build → TestFlight/Play Store internal test 🤖 Generated with [Claude Code](https://claude.com/claude-code)
## Summary - Bump app build number from 1.0.528+794 to 1.0.528+795 - 287 commits since last Codemagic build (v1.0.528+792) Key changes in this release: - **PR BasedHardware#5995**: Phone mic WAL + AudioSource refactor (backend already deployed) - **PR BasedHardware#6118**: Remove dead Speechmatics/Soniox STT code - **PR BasedHardware#6119**: Remove redundant desktop code from app/ - **PR BasedHardware#6103/BasedHardware#6061**: Transcribe fallback removal + pusher recovery - **PR BasedHardware#6083**: Free-tier fair-use enforcement - **Lock bypass fixes**: 19+ security fixes for locked conversations - **BLE reliability**: Native-owned BLE connection pipeline - **Phone call UI**: Minimizable phone call with home screen banner ## After merge 1. Tag for Codemagic: `git tag v1.0.528+795-mobile-cm && git push origin v1.0.528+795-mobile-cm` 2. Monitor Codemagic build → TestFlight/Play Store internal test 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Fixes #6116
Remove all dead Speechmatics and Soniox STT provider code from the backend. Only Deepgram is used in production (controlled by
STT_SERVICE_MODELSenv var which defaults todg-nova-3).Changes:
utils/stt/soniox_util.py(278 lines) andscripts/stt/i_soniox_profiles.py(93 lines)sonioxandspeechmaticsfromSTTServiceenum, leaving onlydeepgramprocess_audio_soniox()(~170 lines) andprocess_audio_speechmatics()(~110 lines) fromstreaming.pytranscribe.pystt_serviceWebSocket param fromOptional[STTService]toOptional[str]for backward compat (old app clients send'soniox'as default)redis_db.pyremove_user_soniox_speech_profilecall fromspeech_profile.pyconnect_user_webhook_ws()function and unusedwebsocketsimport fromwebhooks.pysonioxandspeechmatics-pythonfromrequirements.txtSONIOX_API_KEYfrom.env.templateand all Helm values (backend-listen, pusher, backend-secrets)database/conversations.pyhistorical data reads for backward compat with existing Firestore collectionsReview cycles:
test_dg_usage_batch.pyaccumulation count (4→2) — fixedtest_fair_use_api.pyaccumulation assertion (4→2),.env.templateSONIOX_API_KEY — fixedbackend_deepdive.mdxandtranscription.mdx— fixedTest evidence:
backend/test.sh— all pass (4 pre-existing desktop_updates failures unrelated)pytest tests/unit/test_dg_usage_batch.py— 11/11 passpytest tests/integration/test_fair_use_api.py— 22/22 passstt_service=sonioxas string won't cause 422Net: ~1,100 lines deleted across 21 files (2 deleted entirely)
by AI for @beastoin