npm / @copilotkit/aimock
@copilotkit/aimock
What changed in @copilotkit/aimock 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-21.
9 breaking4 security2 deprecations90 new APIs and options29 behavior and defaults4 tooling83 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@copilotkit/aimock 1221 changes
Breaking changes 9
Non-streaming responses use streamingProfile timing only when opted in.
Realtime now returns the actual Beta sunset rejection instead of a handshake.
Non-string inputs and out-of-range dimensions are rejected with 400 responses.
Non-object JSON bodies now return 400 instead of 500.
The combined reset endpoint was split into /reset/fixtures and /reset/journal.
Adds a separate endpoint for resetting fixtures.
Adds a separate endpoint for resetting the journal.
The spurious type field was removed from converse-stream delta and start events.
Metrics now use the aimock_* prefix.
Security 4
Adds API key validation.
Adds support for transcription replay.
Embeds testId in Veo/Grok video poll ids to provide multi-tenant isolation.
Records gpt-oss Harmony tool calls; stream and recorder handling was hardened.
Deprecations 2
The package is now named @copilotkit/aimock, replacing @copilotkit/llmock.
The old package name remains available as a re-export with deprecation.
New APIs and options 90
Adds record-and-replay support for Audio Isolation.
Adds deterministic multi-turn conversations for A2A.
Adds record-and-replay support for ElevenLabs Scribe.
Adds record-and-replay support for Seed Speech TTS.
Gemini and the remaining providers support model-generated files.
All providers support opt-in timing for non-streaming requests.
Responses supports scriptable citations, allowing developers to use citations with that provider.
Supports explicit message phases in Responses.
Deterministic model misbehavior faults are added, with the new behavior opt-in.
MCP recording is added.
Per-test fake reports are added.
Namespaced function calls and custom tool calls are supported on the Responses API; the new behavior is opt-in.
Workflow targets are added.
Fixtures can now provide scenario-scoped MCP tool fakes.
The mock now supports the OpenAI Vector Stores API, including files, batches, and search.
A machine-readable catalog of control routes is now available.
Chaos testing adds a 429 rate-limit fault for simulating rate-limited responses.
A CLI subcommand lints fixtures offline.
ElevenLabs Voice Design supports recording and replay.
Fine-tuning jobs can be mocked with a deterministic lifecycle and events.
GPT-Live WebSocket sessions can be mocked, recorded, and replayed.
Chaos testing adds latency injection so developers can simulate slow responses.
The mock supports the OpenAI Batches API with deterministic poll progression.
The mock supports the OpenAI Files API with JSON and multipart uploads.
The journal can be filtered by requestId to inspect a specific request.
Control API adds a fixtures dump.
Control API adds journal filters.
Control API adds runtime chaos control.
BytePlus Ark (Seedance) video task lifecycle can now be recorded and replayed.
Adds a fixtures introspection endpoint.
Capture and replay OpenAI and OpenRouter stream usage, including cost.
Exports the subagent types.
Adds OpenRouter chat/LLM router simulation.
Synthesizes reasoning.encrypted_content when requested.
Adds a match gate on the last tool-result payload.
Adds a blocks array to fixtures for tool-first or interleaved ordering across providers, and supports blocks-only fixtures as a first-class option.
Adds a native asynchronous video provider for Google Veo.
Adds a native asynchronous video provider for xAI Grok Imagine.
Fal queue responses can emit the x-fal-billable-units header when opted in.
OpenRouter async video generation endpoints now support the job lifecycle.
Record-mode proxying is available for the OpenRouter video surface.
Adds pytest option forwarding to aimock-pytest.
Added an Ollama /api/embed alias.
Adds support for recording and replaying HITL continuations.
Fixture routing can use the context specified by the X-AIMock-Context header.
Adds a replay-speed multiplier for timing-aware recording and replay.
Six new endpoints were added.
Rate limiting headers were added.
RecordConfig now supports configurable upstream and body-idle timeouts.
Streaming usage was added.
Adds typed helpers for fal image and video functionality.
Requests can use the X-AIMock-Strict header to enable strict mode.
match.systemMessage now accepts string[] as well as a string.
Adds a fixture matcher for system messages.
Adds support for async function responses in fixtures.
Adds snapshot-style fixture recording by test ID, allowing fixtures to be recorded and associated with a test ID.
Added fal.ai as a first-class provider for record and replay.
Adds record/replay support for the Gemini Interactions API.
Adds mocking for non-speech audio generation with ElevenLabs, fal.ai, and Gemini.
Added hasToolResult as a stateless match criterion.
Added turnIndex as a stateless match criterion.
Adds chaos behavior in proxy mode, including drop, disconnect, and malformed responses.
Adds reasoning_content support for OpenRouter chat completions.
Adds per-test sequence isolation via the X-Test-Id header.
Adds reasoning support across all providers.
Adds requestTransform for deterministic matching and recording.
Adds Agent-to-Agent mocking for agent cards, message routing, and SSE streaming.
The CLI supports a config file.
Adds a control API for managing fixtures externally.
Adds JSON-RPC 2.0 transport with batch, notifications, and error handling.
Adds Model Context Protocol mocking for tools, resources, prompts, and session management.
Multiple protocol handlers can be mounted on one server.
Adds mocks for Tavily search, Cohere rerank, and OpenAI moderation.
Adds a vector database mock compatible with Pinecone, Qdrant, and ChromaDB.
Chaos is included among the v1.6.0 changes.
Metrics are included among the v1.6.0 changes.
Provider endpoints are included among the v1.6.0 changes.
Record-and-replay is included among the v1.6.0 changes.
Adds the --log-level CLI flag.
Adds the --validate-on-load CLI flag.
Adds the --watch CLI flag.
Adds a Claude Code skill for writing llmock fixtures.
Adds AbortSignal support for interrupting streams.
Adds disconnectAfterMs for interrupting streams after a specified duration.
Adds truncateAfterChunks for interrupting streams after a specified number of chunks.
WebSocket support is added for Gemini Live.
WebSocket support is added for the Realtime API.
WebSocket support is added for the Responses API.
Adds the public API method getFixtures().
Adds the public API method prependFixture().
Behavior and default changes 29
Native citations are preserved during record and replay.
Keeps the endpoint in OpenAI format by default for v1.46.0 compatibility.
Recordings retain Responses namespace and custom tool calls.
The journal now reports what happened.
Metrics now report what happened.
One-shot error injection now reports what happened.
The record proxy now forwards inbound headers and the raw body.
Request IDs are propagated for observability, and the journal can be filtered by requestId.
Every wrapper response path is now journaled, including vector, a2a, mcp, and agui.
Applying drift-sync re-pins classifications and adds an exclude path, closing the classification loop.
Header parsing is now case-insensitive and tolerates whitespace.
Made POST /__aimock/reset the canonical full reset and aligned llmock.reset() with it.
Fixture-miss passthrough can use aimock-owned upstream provider keys.
New voice/audio model families are flagged even when their names do not contain the "realtime" substring.
Fixture matching is now content-anchored.
Migrated the emitter to the SDK 2.x event protocol.
Divergence warnings are relaxed for turnIndex, with an opt-out.
Fal queue responses now emit the x-fal-request-id header.
The recorder now supports faithful reasoning capture and replay.
Reasoning-channel emission is now aware of model capabilities, so behavior can vary according to what a model supports.
Reasoning emission is gated on the tool-call-only path across providers.
Fixture loading now supports full recursion.
Makes fal queue polling more realistic.
NDJSON and Bedrock streams are relayed progressively.
SSE responses add anti-buffering headers.
Aligns with the AG-UI spec and adds automatic remediation of drift.
The --fixtures option now supports HTTPS URL values.
Fixture responses can include content and toolCalls together.
Gemini tool call responses now include function call IDs.
Tooling 4
LLM endpoints support raw SSE/JSON passthrough fixtures.
The Docker image now includes git.
Adds the aimock CLI.
Adds a pip package for native Python testing.
Fixes and other changes 83
CancelTask tasks are now returned in the result.
GetTask tasks are now returned in the result.
Provider quota exhaustion is reported as infrastructure rather than drift.
Attachment-only user items remain text-less for userMessage matching.
Delivery stops when a client disconnects, across providers.
Corrects AG-UI IDs.
Stops streaming when the client disconnects.
Rejects unknown Anthropic model cursors.
Corrects Bedrock SDK setup.
Keeps 401 response bodies backward-compatible.
Corrects Ollama batch handling.
Returns text or a blob when reading a resource that has no content.
Registered tools returned by tools/list now default inputSchema to {type:"object"}.
Serves OpenRouter's removal rejection for this model.
Malformed tool arguments are preserved across provider wires.
Strict-args behavior is opt-in rather than part of the default behavior.
CORS preflight now advertises PUT for fal queue requests.
Malformed requests and fixture inputs are now handled.
OpenRouter video job creation now returns 202.
Moderation and images stop returning model IDs that were removed.
Blocks now return text payloads and correct provider completion reasons.
Reasoning-first streams containing content and tools are now identified as assistant.
Requests to this removed endpoint now replay the real removal 404.
A hotfix addresses MCP streaming.
Injected errors now validate their status and body.
Multipart boundaries are now unquoted when parsed.
Wrong-typed provider fields now return 400 instead of 500.
Moderation, rerank, and search handlers now honor strict mode.
Restores the docs content class and stops capturing a malformed status.
gpt-image-2.5-flare/sunburst and gpt-live-1 are classified as excluded families for image modality and full-duplex voice, respectively.
Declares metadata on the base event and reads canonical optionality correctly.
Classifies new Gemini model families and resolves Live AUDIO modality from the provider.
Keeps the body available on every supported Node version.
Mirrors subagentRunId onto messages and interrupts and aligns AG-UI with canonical subagent lifecycle events.
Non-websocket upgrade probes no longer return 404.
Fixed handling of ordered blocks and the fallback branch for the Responses API.
OpenAI Responses-API function-call streams are collapsed into toolCalls.
Correctly classifies the gemini-3.5-flash-lite and gemini-3.6-flash model families.
Makes fallback for OpenRouter models[] depend on the error class.
Record and replay handling for hasToolResult is symmetric.
Anthropic tool_result and text scoping was fixed.
hasToolResult is scoped to the current turn during multi-turn replay, preventing tool results from earlier turns from affecting the current turn.
Caps the journal body at 64KB to prevent an Invalid string length crash on GET /__aimock/journal.
Caps auto-remediation PR and issue bodies under GitHub's 65536-character limit.
Drift authenticates using the copilotkit-devops-bot app token.
Requires a genuinely green gate before auto-merge, including pass>0 and required contexts, to prevent false-green results.
Corrected text extraction and empty/regex handling when matching fixtures.
Caps string accumulators to prevent RangeError: Invalid string length.
Fixes chunkSize handling in startFromConfig.
Fixes latency handling in startFromConfig.
Fixes logLevel handling in startFromConfig.
Fixes replaySpeed handling in startFromConfig.
Known-models canary drift is surfaced as critical instead of causing a crash.
The recorder no longer drops fixtures when the SDK closes the socket after data: [DONE].
Adds a proxy buffer cap as part of aimock stabilization.
Anthropic extended-thinking request invariants are now validated.
The router distinguishes sequence or turn exhaustion from no-match in strict 503 responses.
Fixes parsing multipart/form-data create bodies for OpenAI SDK 6.28+ video requests.
Corrected the /v1/images/edits path.
Extracts the user message from AG-UI multimodal user content.
Recognizes a top-level Step[] envelope in gemini-interactions input.
Gemini tool-call response serialization now round-trips functionCall.id.
Preserves functionCall.id when converting Gemini conversation history.
Proxy relay status codes are normalized.
Fixed 29 provider spec conformance violations, which may affect provider behavior.
Multi-turn runs now produce distinct fixtures.
Event Stream payloads are no longer double-wrapped.
Hardens error handling in the AG-UI recorder, mock, and handler.
toolCallId now matches only when the tool message is the last turn.
Bedrock invoke streams now emit native stream chunks.
Fixes debug logging.
Fixes six Responses API schema bugs.
The published package no longer runs the only-allow preinstall hook.
Allows --proxy-only to be used with URL-only --fixtures.
The recorder streams SSE responses instead of buffering them.
Uses action.query for web_search_call items to match the OpenAI API.
The Docker image is now ghcr.io/copilotkit/aimock.
The old Docker image remains available as a compatibility alias.
The recorder decodes base64-encoded embeddings.
The record proxy preserves the base URL path prefix.
The record proxy forwards all request headers.
Fixes the missing refusal field in the API.
Errors are more visible across WebSocket handlers.