feat: forward and draw the SDK's join DAG (3RTT T01) - #689
Merged
Merged
Conversation
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>
…into 3rtt/t01-join-dag # Conflicts: # CHANGELOG.md # acceleration/go.mod # go.work.sum
The Stream edge takes the Go SDK's join trace (Call.OnJoinTrace) and passes its JSON report through unchanged, in place of the per-path layout it built from ConnectionTiming. The session socket's connection frame carries it as `trace`, and a watcher that attaches late is sent it too.
render_connection draws the SDK's trace: each step with what it waited for, its time in ms and round trips, a timeline showing the parallel branches, and the critical path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
3RTT task T01, agent side. Builds on #684 (merged in) and on the SDK's join trace (getstream-go-webrtc#7;
acceleration/go.modpins that branch's commit).What's in it
streamedgesetsCall.OnJoinTraceand forwards the SDK'sjointrace.ReportJSON unchanged. It replaces the per-pathConnectionTiminglayout from feat: join and WebRTC connection latency DAGs #684.agent.JoinTracecarries that report plus the critical path for logs.Connector.JoinTraces()replacesConnections().connectionframe{"type": "connection", "trace": <report>}, replayed to watchers that attach late.render_connectiondraws the DAG from that report, with the parallel branches, a timeline, RTT columns, detail spans under their step, the critical path and the times to media. It prints withlog_latency=True/VOICE_LATENCY_DAG=1.Tests
cd acceleration && go test ./...passes. It includes the newstreamedgefixtures (the trace is the SDK's report byte for byte, the critical path, reported once) and the session and socket-frame tests.uv run --no-sync pytest plugins/stream/tests -m "not integration"passes (194).test_accelerated.pyrenders the SDK's report for a real fixture (tests/join_trace.json).ruff check,ruff formatandmypypass on the changed Python.