@coval/wizard) reads your Python agent code, figures out exactly where to inject tracing, and writes the changes for you — including a diff preview, file backup, and connectivity validation. It works for Pipecat, LiveKit Agents, Vapi, and generic Python agents.
Quick Start
Run this from your agent’s project directory:COVAL_API_KEY is not already set in your environment.
What It Does
Detects your project
Scans the directory for a Python project manifest (
pyproject.toml, requirements.txt, Pipfile, or setup.py) and identifies your framework (Pipecat, LiveKit, Vapi, or generic Python).Analyzes your code
Sends your entry point file to an LLM along with framework-specific injection rules to determine the minimal changes needed.
Shows a diff
Displays a colored diff of the proposed changes to your entry point and asks for confirmation before writing anything.
Writes the files
Creates
coval_tracing.py — a self-contained OpenTelemetry module — and modifies your entry point. Your original entry point is backed up to <filename>.bak.Supported Frameworks
| Framework | Detection | What gets injected |
|---|---|---|
| Pipecat | pipecat-ai in dependencies | setup_coval_tracing() before pipeline construction; simulation ID from args.body SIP headers; enable_metrics=True, enable_tracing=True on PipelineTask |
| LiveKit Agents | livekit-agents in dependencies | setup_coval_tracing() before AgentSession; simulation ID from SIP participant attributes; instrument_session(session) after await session.start() |
| Vapi | Vapi webhook patterns in .py files | setup_coval_tracing() at module level; simulation ID extracted from assistantOverrides.variableValues["coval-simulation-id"] in webhook handler |
| Generic Python | Any Python project | setup_coval_tracing() at module level; # TODO comment marking where to call set_simulation_id() |
What It Sets Up
The wizard createscoval_tracing.py — a self-contained module you import in your agent. It provides three public functions:
set_simulation_id() is called are buffered and flushed automatically once the ID arrives — no spans are lost even if tracing initializes before the call connects.
The module also includes convenience helpers (create_llm_span, create_stt_span, create_tts_span, create_tool_call_span) for manually wrapping operations in spans if needed.
What It Doesn’t Set Up
Environment Variables
| Variable | Required | Description |
|---|---|---|
COVAL_API_KEY | Yes | Your Coval API key. Prompted interactively if not set. |
WIZARD_LLM_KEY | No | LLM API key for direct use. |
WIZARD_LLM_PROVIDER | No | anthropic, openai, or gemini |
WIZARD_LLM_MODEL | No | Override the default model (e.g. gpt-4o, gemini-2.5-flash) |
Limitations
- Python only — The wizard requires a Python project manifest (
pyproject.toml,requirements.txt,Pipfile, orsetup.py) in the target directory. - Single entry point — Only one file is analyzed and modified. The entry point must be named
agent.py,main.py,bot.py,app.py, orserver.py, or be the sole.pyfile in the project root. Entry points larger than 50 KB are not supported. - LLM-generated code — The wizard uses a language model to determine what to inject. Results are generally accurate for standard Pipecat, LiveKit, and Vapi patterns, but unusual project structures may require manual corrections. Always review the diff before confirming.
- Generic Python wizard support is minimal — For projects that aren’t one of the three supported frameworks, the wizard adds
setup_coval_tracing()and a# TODOcomment. You will need to callset_simulation_id()manually and instrument spans yourself. - Validation is connectivity-only — The validation step confirms that your API key can reach
api.coval.dev. It does not verify that spans are correctly wired to your agent’s call lifecycle. - No multi-file analysis — The wizard reads your entry point and dependency manifest only. It does not analyze helper modules, shared utilities, or subpackages.
Next Steps
After running the wizard:- Deploy your updated agent and run a simulation in Coval.
- Open the result and look for the OTel Traces card — traces appear within a few seconds of the simulation completing.
- To add richer span attributes (
stt.confidence,llm.finish_reason, provider sub-spans), see the OpenTelemetry guide and the voice agent examples.

