1
One socket per session, reused across turns
Not one per turn. The handshake is ~205 ms and you should pay it once.
2
A context_id per turn, and cancel by that id
Ids are spent once a turn ends — never reuse one.
3
Treat end and cancelled alike
Both mean “turn over”. Code that only handles
end hangs on every barge-in.4
Mute local playback the instant you send cancel
Do not wait for the reply. The engine keeps emitting for ~250 ms while your
cancel is in flight, and that audio is already talked over.
5
Read sample_rate from metadata
Do not hard-code it.
6
Log context_id and session_id
They are what support needs to find your call.
7
Reconnect on close with backoff
Deploys and idle timeouts drop sockets normally. It is not an error state.
Identifiers to log
Support: charan@mayaresearch.ai,
bharath@mayaresearch.ai,
dheemanth@mayaresearch.ai