TraceBox: Real WebRTC Voice-Agent Testing
I built a tool that tests voice agents in a real browser, with an eight-state agent, live audio capture and saved run evidence.
[1] Control plane
Control plane, execution plane & ownership
How runs are created, dispatched, executed, observed, and persisted.
System overview
A signed-in control plane sends each run to one of two execution modes.
Control plane ↔ execution plane
In worker mode, run control and long browser sessions stay separate. Without WORKER_URL, runs execute in-process.
I own the eight-state LangGraph agent, browser and WebRTC control, isolated workers, live inspection, persistence and session evidence. I built the voice-agent testing workflow end to end.
Ownership ledger
The story: a control and execution split, isolated headless browser workers, the LangGraph lifecycle, real WebRTC media, live observability, evidence capture, deployment and known limits.
[2] Agent
LangGraph agent & runtime guardrails
An eight-state lifecycle with retries, time limits, recovery and finalization.
Eight-state bot lifecycle
The main path is shown first, with the retry and exit routes listed below.
Retry and exit routes
Runtime guardrails
[3] WebRTC
Real-time WebRTC voice loop
It captures live speech, reasons over the conversation and page, then plays synthesized audio back into the browser session.
Real WebRTC media loop
Target audio becomes conversation state, and the agent either acts in the browser or speaks.
WebRTC media bridge
Screenshot-assisted reasoning
[4] Observability
Realtime observability & session evidence
Watch a run live without polling, then review recordings, screenshots, transcripts, timings, logs and errors afterwards.
Live observability without polling
Database state and short-lived session data take separate Supabase Realtime paths to the viewer.
Screen recording & live frame pipeline
CDP screencast frames split into sampled live frames and the saved screen recording.
Evidence per bot
[5] Deployment
Deployment, technical facts & limitations
What the implementation confirms, and what this write-up deliberately doesn't claim.
Two-service Cloud Run path
deploy.sh deploys the worker first, takes its URL, then deploys the frontend with WORKER_URL.
deploy.sh defaults to asia-south1. GCP, Supabase and provider settings are set up separately. cloudbuild.yaml is an alternate combined-image path.
Confirmed technical facts
Known limitations & boundary
Note on scope
High-level architecture and confirmed configuration only. No claims about users, revenue, uptime, benchmarks, reliability, privacy or load.
Want to talk about any of this?
Happy to go deeper on the WebRTC audio loop, the LangGraph lifecycle, or live observability.