35downloads
Write LiveKit agent tests with pytest or Vitest
Test LiveKit agent messages, tool calls and handoffs in pytest or Vitest. Use the SDK session harness and intent checks to cover behavior changes.
When it runs
Your agent reads this description from SKILL.md to decide when to load the skill:
Writes turn-level tests for a LiveKit agent in the user's normal test suite: pytest (Python) or Vitest (Node.js). Use when the user asks to "write tests for my agent", "add a test for this tool", "test the handoff", "pin this bug", "why does my agent test fail", or after building or changing agent behavior that needs regression coverage. Covers the SDK's test session harness, assertions on messages, tool calls and handoffs, LLM judging of a reply against an intent, mocking tools, multi-turn tests, and judging whole conversations with the built-in judges. For interactive poking use debugging-livekit-agents. For grading whole conversations at scale use running-livekit-simulations.
What SKILL.md covers
- What a test asserts on
- Mocking tools
- Multi-turn and seeded history
- What to test
- Three kinds of evidence, kept distinct
- Don't write tests that punish correct behavior
- Where this sits
- Related skills
Files in the ZIP
Related skills
Build LiveKit voice and chat AI agents
Design LiveKit voice and chat agents with clear tasks, handoffs and tool behavior. Keep context focused and plan for conversational latency.
Debug LiveKit agents through live conversations
Try a LiveKit agent in a live multi turn conversation with lk agent debugger. Inspect what it says and does after changing its prompts or tools.
Deploy and operate LiveKit agents in production
Ship and roll back LiveKit agents, manage worker processes and investigate production failures. Review secrets, shutdown behavior, upgrades and observability.