refactor: remove websocket streaming support and clean up associated tests
Overview
This Merge Request removes all deprecated WebSocket streaming functionality from the backend and simplifies the ASR pipeline to support only REST-based transcription and diarization workflows.
The cleanup includes removal of streaming services, PCM16-specific methods, unused configuration, and related tests, while ensuring all existing REST APIs continue to work correctly with full test coverage maintained.
Changes Made
WebSocket & Streaming Cleanup
-
Removed
/streamWebSocket endpoint fromapp/main.py -
Deleted
app/services/streaming_service.py -
Removed streaming session cleanup lifecycle logic
-
Removed PCM16 streaming transcription flow from:
app/asr_service.pyapp/asr/router.py- ASR engine implementations
ASR Engine Refactor
-
Removed:
transcribe_pcm16detect_language_pcm16
-
Cleaned up unused imports and streaming-only utilities
Configuration Cleanup
Removed obsolete configuration related to:
STREAMING_*VAD_*
from app/config.py
Test & Documentation Updates
-
Deleted
tests/test_streaming_service.py -
Updated affected unit tests:
test_main.pytest_engines.pytest_asr_service.pytest_model_router.pytest_whisper_lid_unit.py
-
Updated README to remove streaming/WebSocket references
Additional Fixes
- Fixed legacy exception syntax issues:
except ValueError, OSError:
updated to:
except (ValueError, OSError):
-
Applied:
ruff formatruff check --fix
Validation
- All tests passing successfully
- Maintained required coverage threshold (~95%)
- REST transcription and diarization flows verified after cleanup
Impact
Benefits
- Reduced backend complexity
- Easier maintenance and debugging
- Cleaner ASR architecture
- Removed unused/dead code paths
- Faster and more stable test execution
No Impact On
- REST transcription APIs
- Diarization workflows
- Benchmark jobs
- Existing ASR model functionality
*Closes #29 (closed)