Skip to content

feat: join and WebRTC connection latency DAGs - #684

Draft
tbarbugli wants to merge 2 commits into
acceleratefrom
feature/connection-latency-dag
Draft

tbarbugli wants to merge 2 commits into
acceleratefrom
feature/connection-latency-dag

Conversation

@tbarbugli

Copy link
Copy Markdown
Member

Why

VOICE_LATENCY_DAG=1 (#674) shows where a turn's time goes, but not where the time before the first turn goes. Joining a call is several hops: the agent creates the call on the coordinator, opens the router session and event socket, and the router then joins the call and negotiates WebRTC (coordinator and SFU sockets and joins, offer/answer, ICE, DTLS, first RTP). Slow starts were hard to attribute without seeing each of those steps, so this prints them as DAGs alongside the existing turn DAG.

Depends on GetStream/getstream-go-webrtc#2, which adds Call.OnConnectionTiming. Until that merges, acceleration/go.mod pins getstream-go-webrtc to its branch feature/connection-timing at 0ab2ab2; the pin should move to the merged commit before this lands.

Changes

  • The Stream edge reports, per peer connection (publisher and subscriber), every step from the start of its join, including SFU offer received, SetPublisher / SendAnswer, ICE start and checks, DTLS and first RTP. A path is reported once it has its first packet, or after a short wait without one.
  • The agent logs each path's timing and emits it as an event; the session socket forwards it as a connection frame, and a watcher that attaches after the path connected is sent the latest timing.
  • The Python agent records its own join steps (create call, components, chat conversation, router session, event socket), passes them to the pipeline as RemoteCall.join_steps, and stream.Accelerated prints a join DAG and a WebRTC connection DAG per connection frame when log_latency is on.
  • The streamedge join conflict with 1480919 is resolved by registering the timing callback on the local call before Join, keeping that fix's "only set e.call after a successful join".

🤖 Generated with Claude Code

tbarbugli and others added 2 commits September 29, 2026 17:47
The Stream edge now reports, per peer connection, every step from the
start of its join: coordinator websocket and join, SFU websocket and
join, offer/answer (SetPublisher or SendAnswer), ICE start and checks,
DTLS and the first RTP packet. The agent logs it and the session socket
forwards it as a "connection" frame, replaying the latest one to a
watcher that attaches after the path connected.

Pins getstream-go-webrtc to feature/connection-timing (0ab2ab2), which
adds Call.OnConnectionTiming.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
With log_latency (VOICE_LATENCY_DAG=1 for simple_voice_ai) the agent
prints its own join as a DAG (create call, components, chat
conversation, router session, event socket) and renders each
"connection" frame from the router as a WebRTC connection DAG. The
agent's steps travel to the pipeline as RemoteCall.join_steps.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant