Skip to content

fix: ignore malformed default input messages#679

Open
VivekJJadav wants to merge 2 commits intobolna-ai:masterfrom
VivekJJadav:fix/default-input-malformed-message
Open

fix: ignore malformed default input messages#679
VivekJJadav wants to merge 2 commits intobolna-ai:masterfrom
VivekJJadav:fix/default-input-malformed-message

Conversation

@VivekJJadav
Copy link
Copy Markdown

Summary

Fixes a reliability issue in DefaultInputHandler where a malformed websocket input message could stop the input listener entirely.

Previously, process_message() accessed message["type"] and message["data"] directly. If a client sent a malformed payload, the resulting exception was caught by _listen() as a fatal error, causing the handler to send EOS to the transcriber and stop processing future messages.

Changes

  • Validate that incoming messages are dictionaries before routing them
  • Guard audio and text messages that are missing data
  • Keep the listener alive after malformed input
  • Add an async regression test covering malformed input followed by valid text input

Test

.venv/bin/python -m pytest -q tests/tests/test_default_input_handler.py

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