packages icon indicating copy to clipboard operation
packages copied to clipboard

Simplify convai-widget-core session config after connection type inference

Open kraenhansen opened this issue 8 months ago • 2 comments

[!NOTE] I'm not actually committed to making this change.

Summary

After #579 (infer default connection type from conversation mode), convai-widget-core can simplify its session config construction.

Currently session-config.tsx branches on isWebRTC to explicitly set connectionType when using agentId.

https://github.com/elevenlabs/packages/blob/d76ae920ffedcc460228dfb87d693eaacc8d7892/packages/convai-widget-core/src/contexts/session-config.tsx#L99-L113

Since the client now infers the default from the conversation mode (voice → "webrtc", text-only → "websocket"), this branching can be removed — connectionType can be omitted entirely, and the client will infer the correct default.

Changes

  • Remove the isWebRTC conditional in the agentId branch of session-config.tsx
  • Potentially remove the useWebRTCEnabled signal if no longer needed elsewhere

🤖 Generated with Claude Code

kraenhansen avatar Mar 20 '26 12:03 kraenhansen

I'm not actually committed to making this change. @kamilk-11 / @kalvin807 what do you think?

kraenhansen avatar Mar 20 '26 17:03 kraenhansen

@kraenhansen Logical change to me, but it might be a very big change. From the serverside code + current useRTC logic, we are running websocket in both voice and text mode -> this change would be equivalent to migrating the widget to use WebRTC.

kalvin807 avatar Mar 27 '26 14:03 kalvin807