it0/packages/services/voice-agent/src/plugins
hailin e66c187353 fix: improve voice pipeline robustness for poor network conditions
Flutter (agent_call_page.dart):
- Add ConnectOptions with 15s timeouts for connection/peerConnection/iceRestart
- Add RoomReconnectingEvent/RoomAttemptReconnectEvent/RoomReconnectedEvent
  listeners with "网络重连中" UI indicator during reconnection
- Add TimeoutException detection in _friendlyError()

voice-agent (agent.py):
- Wrap entrypoint() in try-except with full traceback logging
- Register room disconnect listener to close httpx clients (instead of
  finally block, since session.start() returns while session runs in bg)
- Add asyncio import for ensure_future cleanup

voice-agent LLM proxy (agent_llm.py):
- Add retry with exponential backoff (max 2 retries, 1s/3s delays) for
  network errors (ConnectError/ConnectTimeout/OSError) and WS InvalidStatusCode
- Extract _do_stream() method for single-attempt logic
- Add WebSocket connection params: open_timeout=10, ping_interval=20,
  ping_timeout=10 for keepalive and faster dead-connection detection
- Use granular httpx.Timeout(connect=10, read=30, write=10, pool=10)
- Increase WS recv timeout from 5s to 30s to reduce unnecessary loops

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 23:34:55 -08:00
..
__init__.py feat: migrate voice call from WebSocket/PCM to LiveKit WebRTC 2026-02-28 08:55:33 -08:00
agent_llm.py fix: improve voice pipeline robustness for poor network conditions 2026-03-01 23:34:55 -08:00
kokoro_tts.py feat: migrate voice call from WebSocket/PCM to LiveKit WebRTC 2026-02-28 08:55:33 -08:00
whisper_stt.py feat: migrate voice call from WebSocket/PCM to LiveKit WebRTC 2026-02-28 08:55:33 -08:00