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