Skip to content

fix(websockets): tolerate unknown message types from API#671

Merged
lukeocodes merged 1 commit intov5from
lo/v5-unknown-ws-tolerance
Feb 24, 2026
Merged

fix(websockets): tolerate unknown message types from API#671
lukeocodes merged 1 commit intov5from
lo/v5-unknown-ws-tolerance

Conversation

@lukeocodes
Copy link
Contributor

@lukeocodes lukeocodes commented Feb 24, 2026

Summary

  • Backport of the v6.0.1 construct_type fix to the v5 maintenance branch
  • Adds unchecked_base_model.py (from v6) with construct_type which does best-effort union coercion instead of strict Pydantic validation
  • Switches all 4 socket clients (listen v1, listen v2, speak v1, agent v1) from parse_obj_as to construct_type
  • Unknown WebSocket message types (e.g. ConfigureSuccess) now pass through without crashing the listener

Test plan

  • 853 unit/integration tests pass
  • Verified against live Deepgram API with Listen V2 (Flux) — ConfigureSuccess unknown message type coerced cleanly as ListenV2ConnectedEvent
  • Verify no regressions in existing v5 consumers

Add construct_type (from v6's unchecked_base_model) which does best-effort
union coercion instead of strict validation. Switch all 4 socket clients
from parse_obj_as to construct_type so unknown WebSocket message types
(e.g. ConfigureSuccess) pass through without crashing the listener.

Also adds a Listen V2 (Flux) example demonstrating the fix.
@lukeocodes lukeocodes merged commit 7deb302 into v5 Feb 24, 2026
14 checks passed
@lukeocodes lukeocodes deleted the lo/v5-unknown-ws-tolerance branch February 24, 2026 14:07
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.

1 participant