Agent Testing (Vercel AI SDK)

•
4
•

Standardizes testing and mocking for Vercel AI SDK implementations to prevent protocol errors and silent failures.

The Agent Testing skill provides critical guidance and boilerplate for developers testing agents built with the Vercel AI SDK (ai/test). It specifically addresses the 'sharp edges' of the V3 protocol, such as the common mistake of using textDelta instead of delta, incorrect finishReason structures, and non-deterministic hangs caused by smoothStream. By providing canonical mock patterns for MockLanguageModelV3 and specialized fixtures for usage and content parts, it ensures that unit and integration tests for AI agents are robust, accurate, and pass on the first run.

주요 기능

01Diagnostic stream-chunk linter for debugging empty test outputs
02V3 protocol-compliant mock fixtures for text and streaming responses
03Automated validation for finishReason objects and usage shapes
04Pre-configured patterns for MockLanguageModelV3 and simulateReadableStream
05Bypassing strategies for smoothStream hangs in synthetic test environments
064 GitHub stars

사용 사례

01Mocking complex multi-step agentic workflows and retry logic
02Writing unit tests for agents using generateText, streamText, or tool calls
03Debugging silent failures in AI SDK streaming tests