Skip to content

Fix Conversational AI audio chunk handling and WebSocket error recovery#727

Open
18-RAJAT wants to merge 1 commit intoelevenlabs:mainfrom
18-RAJAT:fix/conversational-ai-audio-chunk-handling
Open

Fix Conversational AI audio chunk handling and WebSocket error recovery#727
18-RAJAT wants to merge 1 commit intoelevenlabs:mainfrom
18-RAJAT:fix/conversational-ai-audio-chunk-handling

Conversation

@18-RAJAT
Copy link
Copy Markdown

@18-RAJAT 18-RAJAT commented Feb 3, 2026

  • Add audio chunk queue/buffer to prevent loss during transient WebSocket failures
  • Improve error handling to distinguish between fatal and recoverable errors
  • Add connection state checking before sending audio chunks
  • Add proper exception handling for WebSocket errors (including 1011 internal error)
  • Use dedicated thread/task for sending audio chunks to prevent blocking
  • Handle ConnectionClosedOK, ConnectionClosedError, and ConnectionClosed exceptions gracefully
  • Prevent session termination on transient errors to improve reliability

- Add audio chunk queue/buffer to prevent loss during transient WebSocket failures
- Improve error handling to distinguish between fatal and recoverable errors
- Add connection state checking before sending audio chunks
- Add proper exception handling for WebSocket errors (including 1011 internal error)
- Use dedicated thread/task for sending audio chunks to prevent blocking
- Handle ConnectionClosedOK, ConnectionClosedError, and ConnectionClosed exceptions gracefully
- Prevent session termination on transient errors to improve reliability
@kraenhansen
Copy link
Copy Markdown
Member

First off - thanks a lot for your interest in the project!

This PR addresses a bit too many issues at once for us to reliably review and merge - especially since this is your first PR to our projects. Could I get you to separate this out into:

  • an initial PR with the refactoring (no new features or actual bug-fixes),
  • then PRs for each bug that you're fixing
  • and finally a PR for the audio chunck queue / buffering.

This will make it easier for us to review and potentially partially revert if this (against expectations) introduce new bugs.

@kraenhansen kraenhansen added the stale PR or issue has not had recent activity and may be closed label Apr 28, 2026
@kraenhansen
Copy link
Copy Markdown
Member

Hey! We're doing a spring cleaning of open PRs. It looks like there are some outstanding requested changes or questions on this PR. Is it still something you'd like to get merged? If so, could you update it when you get a chance? We're marking this as stale for now and will close it in a week if there's no activity.

@kraenhansen
Copy link
Copy Markdown
Member

Also, your branch has merge conflicts and will need a rebase before it can be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale PR or issue has not had recent activity and may be closed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants