Expose the voice-agent latency critical path - #674
Merged
Merged
Conversation
thesyncim
force-pushed
the
codex/voice-latency-tracing
branch
from
September 28, 2026 10:47
65cd601 to
92f6125
Compare
tbarbugli
approved these changes
Sep 28, 2026
thesyncim
force-pushed
the
codex/voice-latency-tracing
branch
from
September 28, 2026 11:51
ffa719c to
20b6337
Compare
This was referenced Sep 30, 2026
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.
The existing
roundtrip_msclock started after transcript cadence settled, hiding roughly 350 ms of caller wait. It also gave no way to distinguish turn-decision time from reply generation and speech synthesis.This PR traces the path from the last transcript revision to the first audio chunk published by the Go edge. The call timeline API exposes its stage timings and every flow, reply, and subagent model attempt with turn ID, TTFT, and full duration. Model calls annotate the stages they overlap, so their durations are not added twice. Call setup is measured separately: the Go edge logs signaling and each ICE peer connection, while Python reports join duration in its agent event and OpenTelemetry metric.
Console timing is opt-in:
stream.Accelerated(log_latency=True)prints per-model lines and an ASCII DAG for each turn. It is quiet by default; thesimple_voice_aiexample enables it withVOICE_LATENCY_DAG=1. The router records the metrics regardless of this logging flag.A spoken turn in the local test call printed:
speech_end_to_audio_msadds provider STT processing to the edge roundtrip; it excludes network transit and browser playback. The example also drops a memory filter that prevented it from starting without a memory provider. The OpenAPI change is reflected in the generated Go, Python, and JavaScript clients.Checks: Changed Go packages, the Go SDK, all 29 accelerated-agent tests, JavaScript typecheck, Swift client audit, and
git diff --checkpass. TheaccelerateCI baseline was restored and merged in #676. Full CI is running on this rebased branch.