A new Workspace capability unifies agent-accessible filesystem operations, sandboxed command/code execution, keyword/semantic/hybrid search, and SKILL.md discovery with safety controls (read-only, approval flows, read-before-write guards). The Workspace is exposed end-to-end: core Workspace class (@mastra/core/workspace), server API endpoints (/workspaces/...), and new @mastra/client-js workspace client methods (files, skills, references, search).
Tracing is more actionable: listTraces now returns a status (success|error|running), spans are cleaner (inherit entity metadata, remove internal spans, emit model chunk spans for all streaming chunks), and tool approval requests are visible in traces. Token accounting for Langfuse/PostHog is corrected (cached tokens separated) and default tracing tags are preserved across exporters.
Server Adapters: Serverless MCP Support + Explicit Route Auth Controls
Express/Fastify/Hono/Koa adapters gain (notably ) to run MCP HTTP transport statelessly in serverless/edge environments without overriding response handling. Adapters and also add explicit per route (defaulting to protected), improved custom-route auth enforcement (including path params), and corrected route prefix replacement/normalization.
Tools, agents, workflows, and steps can now define a requestContextSchema (Zod) to validate required context at runtime and get typed access in execution; RequestContext.all provides convenient access to all validated values. This also flows into Studio UX (Request Context tab/forms) and fixes/improves propagation through agent networks and nested workflow execution for better observability and analytics.
Breaking Changes
Google embedding model router removes deprecated text-embedding-004; use google/gemini-embedding-001 instead.
Fixed skill loading error caused by Zod version conflicts between v3 and v4. Replaced Zod schemas with plain TypeScript validation functions in skill metadata validation.
Restructured stored agents to use a thin metadata record with versioned configuration snapshots.
The agent record now only stores metadata fields (id, status, activeVersionId, authorId, metadata, timestamps). All configuration fields (name, instructions, model, tools, etc.) live exclusively in version snapshot rows, enabling full version history and rollback.
Key changes:
Stored Agent records are now thin metadata-only (StorageAgentType)
All config lives in version snapshots (StorageAgentSnapshotType)
New resolved type (StorageResolvedAgentType) merges agent record + active version config
Renamed ownerId to authorId for multi-tenant filtering
Changed memory field type from string to Record<string, unknown>
Added status field ('draft' | 'published') to agent records
Flattened CreateAgent/UpdateAgent input types (config fields at top level, no nested snapshot)
Version config columns are top-level in the agent_versions table (no single snapshot jsonb column)
List endpoints return resolved agents (thin record + active version config)
Auto-versioning on update with retention limits and race condition handling
Fix model router routing providers that use non-default AI SDK packages (e.g. @ai-sdk/anthropic, @ai-sdk/openai) to their correct SDK instead of falling back to openai-compatible. Add cerebras, togetherai, and deepinfra as native SDK providers.
Fixed agent.network() to properly pass requestContext to workflow runs. Workflow execution now includes user metadata (userId, resourceId) for observability and analytics. (Fixes #12330)
New storage interfaces for stored agents and agent versions
PostgreSQL, LibSQL, and MongoDB implementations included
In-memory storage for development and testing
API:
RESTful endpoints for agent CRUD operations
Version management endpoints (create, list, activate, restore, delete, compare)
Automatic versioning on agent updates when enabled
Client SDK:
JavaScript client with full support for stored agents and versions
Type-safe methods for all CRUD and version operations
Usage Example:
// Server-side: Configure storage
import { Mastra } from '@mastra/core';
import { PgAgentsStorage } from '@mastra/pg';
const mastra = new Mastra({
agents: { agentOne },
storage: {
agents: new PgAgentsStorage({
connectionString: process.env.DATABASE_URL,
}),
},
});
// Client-side: Use the SDK
import { MastraClient } from '@mastra/client-js';
const client = new MastraClient({ baseUrl: 'http://localhost:3000' });
// Create a stored agent
const agent = await client.createStoredAgent({
name: 'Customer Support Agent',
description: 'Handles customer inquiries',
model: { provider: 'ANTHROPIC', name: 'claude-sonnet-4-5' },
instructions: 'You are a helpful customer support agent...',
tools: ['search', 'email'],
});
// Create a version snapshot
await client.storedAgent(agent.id).createVersion({
name: 'v1.0 - Initial release',
changeMessage: 'First production version',
});
// Compare versions
const diff = await client.storedAgent(agent.id).compareVersions('version-1', 'version-2');
Why:
This feature enables teams to manage agents dynamically without code changes, making it easier to iterate on agent configurations and maintain a complete audit trail of changes.
Fix ModelRouterLanguageModel to propagate supportedUrls from underlying model providers
Previously, ModelRouterLanguageModel (used when specifying models as strings like "mistral/mistral-large-latest" or "openai/gpt-4o") had supportedUrls hardcoded as an empty object. This caused Mastra to download all file URLs and convert them to bytes/base64, even when the model provider supports URLs natively.
This fix:
Changes supportedUrls to a lazy PromiseLike that resolves the underlying model's supported URL patterns
Updates llm-execution-step.ts to properly await supportedUrls when preparing messages
Impact:
Mistral: PDF URLs are now passed directly (fixes #12152)
OpenAI: Image URLs (and PDF URLs in response models) are now passed directly
Anthropic: Image URLs are now passed directly
Google: Files from Google endpoints are now passed directly
Note: Users who were relying on Mastra to download files from URLs that model providers cannot directly access (internal URLs, auth-protected URLs) may need to adjust their approach by either using base64-encoded content or ensuring URLs are publicly accessible to the model provider.
Extended readOnly memory option to also apply to working memory. When readOnly: true, working memory data is provided as context but the updateWorkingMemory tool is not available.
Example:
// Working memory is loaded but agent cannot update it
const response = await agent.generate("What do you know about me?", {
memory: {
thread: "conversation-123",
resource: "user-alice-456",
options: { readOnly: true },
},
});
Added unified Workspace API for agent filesystem access, code execution, and search capabilities.
New Workspace class combines filesystem, sandbox, and search into a single interface that agents can use for file operations, command execution, and content search.
Key features:
Filesystem operations (read, write, copy, move, delete) through pluggable providers
Code and command execution in secure sandboxed environments with optional OS-level isolation
Keyword search, semantic search, and hybrid search modes
Skills system for discovering and using SKILL.md instruction files
Safety controls including read-before-write guards, approval flows, and read-only mode
Usage:
import { Workspace, LocalFilesystem, LocalSandbox } from '@mastra/core/workspace';
const workspace = new Workspace({
filesystem: new LocalFilesystem({ basePath: './workspace' }),
sandbox: new LocalSandbox({ workingDirectory: './workspace' }),
bm25: true,
});
const agent = new Agent({
workspace,
// Agent automatically receives workspace tools
});
Fixed TypeScript error when calling bail() in workflow steps. bail() now accepts any value, so workflows can exit early with a custom result. Fixes #12424.
Fixed type error when using createTool with Agent when exactOptionalPropertyTypes is enabled in TypeScript config. The ProviderDefinedTool structural type now correctly marks inputSchema as optional and allows execute to be undefined, matching the ToolAction interface.
Fixed tracingOptions.tags not being preserved when merging defaultOptions with call-site options. Tags set in agent's defaultOptions.tracingOptions are now correctly passed to all observability exporters (Langfuse, Langsmith, Braintrust, Datadog, etc.). Fixes #12209.
Added activeTools parameter support to model loop stream. The activeTools parameter can now be passed through the ModelLoopStreamArgs to control which tools are available during LLM execution.
Added status field to listTraces response. The status field indicates the trace state: success (completed without error), error (has error), or running (still in progress). This makes it easier to filter and display traces by their current state without having to derive it from the error and endedAt fields.
Fixed agent network crashing with 'Invalid task input' error when routing agent returns malformed JSON for tool/workflow prompts. The error is now fed back to the routing agent, allowing it to retry with valid JSON on the next iteration.
Fixed type error when passing MastraVoice implementations (like OpenAIVoice) directly to Agent's voice config. Previously, the voice property only accepted CompositeVoice, requiring users to wrap their voice provider. Now you can pass any MastraVoice implementation directly.
Before (required wrapper):
const agent = new Agent({
voice: new CompositeVoice({ output: new OpenAIVoice() }),
});
After (direct usage):
const agent = new Agent({
voice: new OpenAIVoice(),
});
Fixed output processors not being applied to messages saved during network execution. When using agent.network(), configured output processors (like TraceIdInjector for feedback attribution) are now correctly applied to all messages before they are saved to storage.
Removed deprecated Google text-embedding-004 embedding model from the model router. Google shut down this model on January 14, 2026. Use google/gemini-embedding-001 instead.
Fixed tool input validation failing when LLMs send null for optional fields (#12362). Zod's .optional() only accepts undefined, not null, causing validation errors with Gemini and other LLMs. Validation now retries with null values stripped when the initial attempt fails, so .optional() fields accept null while .nullable() fields continue to work correctly.
Fixed network mode not applying user-configured input/output processors (like token limiters) to the routing agent. This caused unbounded context growth during network iterations.
User-configured processors are now correctly passed to the routing agent, while memory-derived processors (which could interfere with routing logic) are excluded.
Fixed repeated build failures caused by stale global cache (~/.cache/mastra/) containing invalid TypeScript in provider-types.generated.d.ts. Provider names starting with digits (e.g. 302ai) are now properly quoted, and the global cache sync validates .d.ts files before copying to prevent corrupted files from overwriting correct ones.
Fixed custom data parts from writer.custom() breaking subsequent messages with Gemini. Messages containing only data-* parts no longer produce empty content arrays that cause Gemini to fail with 'must include at least one parts field'.
Improve autoresume prompt sent to LLM to ensure gemini resumes well.
Gemini sometimes doesn't use the previous messages to create inputData for the tool to resume, the prompt was updated to make sure it gets the inputData from the suspended tool call.
Fix TypeScript types for custom API route handlers to include requestContext in Hono context Variables. Previously, only mastra was typed, causing TypeScript errors when accessing c.get('requestContext') even though the runtime correctly provided this context.
Fixed file naming conversion when merging templates. Kebab-case filenames like csv-to-questions-workflow.ts were incorrectly converted to all-lowercase (csvtoquestionsworkflow.ts) instead of proper camelCase (csvToQuestionsWorkflow.ts). PascalCase and acronym-boundary conversions are also fixed.
Fixed latent Memory storage bug in AgentBuilder. AgentBuilder was created without providing storage to Memory, causing intermittent failures when Memory operations were invoked. Now uses InMemoryStore as a fallback when no storage is provided, allowing it to function without explicit storage configuration.
fix(ai-sdk): import ReadableStream and TransformStream from node:stream/web to fix TypeScript async iterator errors
Fixed TypeScript build errors when using toAISdkStream() with for await...of loops. The function now explicitly imports ReadableStream and TransformStream from 'node:stream/web', ensuring the Node.js types (which include Symbol.asyncIterator support) are used instead of global types that may not have async iterator support in all TypeScript configurations.
This resolves issue #11884 where users encountered the error: "Type 'ReadableStream<InferUIMessageChunk>' must have a 'Symbol.asyncIterator' method that returns an async iterator."
Fixed incorrect span kind mapping in @mastra/arize. Workflow spans now correctly map to CHAIN, agent spans to AGENT, and tool spans to TOOL instead of defaulting to LLM.
New storage interfaces for stored agents and agent versions
PostgreSQL, LibSQL, and MongoDB implementations included
In-memory storage for development and testing
API:
RESTful endpoints for agent CRUD operations
Version management endpoints (create, list, activate, restore, delete, compare)
Automatic versioning on agent updates when enabled
Client SDK:
JavaScript client with full support for stored agents and versions
Type-safe methods for all CRUD and version operations
Usage Example:
// Server-side: Configure storage
import { Mastra } from '@mastra/core';
import { PgAgentsStorage } from '@mastra/pg';
const mastra = new Mastra({
agents: { agentOne },
storage: {
agents: new PgAgentsStorage({
connectionString: process.env.DATABASE_URL,
}),
},
});
// Client-side: Use the SDK
import { MastraClient } from '@mastra/client-js';
const client = new MastraClient({ baseUrl: 'http://localhost:3000' });
// Create a stored agent
const agent = await client.createStoredAgent({
name: 'Customer Support Agent',
description: 'Handles customer inquiries',
model: { provider: 'ANTHROPIC', name: 'claude-sonnet-4-5' },
instructions: 'You are a helpful customer support agent...',
tools: ['search', 'email'],
});
// Create a version snapshot
await client.storedAgent(agent.id).createVersion({
name: 'v1.0 - Initial release',
changeMessage: 'First production version',
});
// Compare versions
const diff = await client.storedAgent(agent.id).compareVersions('version-1', 'version-2');
Why:
This feature enables teams to manage agents dynamically without code changes, making it easier to iterate on agent configurations and maintain a complete audit trail of changes.
Added status field to listTraces response. The status field indicates the trace state: success (completed without error), error (has error), or running (still in progress). This makes it easier to filter and display traces by their current state without having to derive it from the error and endedAt fields.
Restructured stored agents to use a thin metadata record with versioned configuration snapshots.
The agent record now only stores metadata fields (id, status, activeVersionId, authorId, metadata, timestamps). All configuration fields (name, instructions, model, tools, etc.) live exclusively in version snapshot rows, enabling full version history and rollback.
Key changes:
Stored Agent records are now thin metadata-only (StorageAgentType)
All config lives in version snapshots (StorageAgentSnapshotType)
New resolved type (StorageResolvedAgentType) merges agent record + active version config
Renamed ownerId to authorId for multi-tenant filtering
Changed memory field type from string to Record<string, unknown>
Added status field ('draft' | 'published') to agent records
Flattened CreateAgent/UpdateAgent input types (config fields at top level, no nested snapshot)
Version config columns are top-level in the agent_versions table (no single snapshot jsonb column)
List endpoints return resolved agents (thin record + active version config)
Auto-versioning on update with retention limits and race condition handling
New storage interfaces for stored agents and agent versions
PostgreSQL, LibSQL, and MongoDB implementations included
In-memory storage for development and testing
API:
RESTful endpoints for agent CRUD operations
Version management endpoints (create, list, activate, restore, delete, compare)
Automatic versioning on agent updates when enabled
Client SDK:
JavaScript client with full support for stored agents and versions
Type-safe methods for all CRUD and version operations
Usage Example:
// Server-side: Configure storage
import { Mastra } from '@mastra/core';
import { PgAgentsStorage } from '@mastra/pg';
const mastra = new Mastra({
agents: { agentOne },
storage: {
agents: new PgAgentsStorage({
connectionString: process.env.DATABASE_URL,
}),
},
});
// Client-side: Use the SDK
import { MastraClient } from '@mastra/client-js';
const client = new MastraClient({ baseUrl: 'http://localhost:3000' });
// Create a stored agent
const agent = await client.createStoredAgent({
name: 'Customer Support Agent',
description: 'Handles customer inquiries',
model: { provider: 'ANTHROPIC', name: 'claude-sonnet-4-5' },
instructions: 'You are a helpful customer support agent...',
tools: ['search', 'email'],
});
// Create a version snapshot
await client.storedAgent(agent.id).createVersion({
name: 'v1.0 - Initial release',
changeMessage: 'First production version',
});
// Compare versions
const diff = await client.storedAgent(agent.id).compareVersions('version-1', 'version-2');
Why:
This feature enables teams to manage agents dynamically without code changes, making it easier to iterate on agent configurations and maintain a complete audit trail of changes.
Fix PATCH request JSON-body handling in @mastra/client-js so stored agent edit flows work correctly. Fix stored agent schema migration in @mastra/libsql and @mastra/pg to drop and recreate the versions table when the old snapshot-based schema is detected, clean up stale draft records from partial create failures, and remove lingering legacy tables. Restores create and edit flows for stored agents.
New storage interfaces for stored agents and agent versions
PostgreSQL, LibSQL, and MongoDB implementations included
In-memory storage for development and testing
API:
RESTful endpoints for agent CRUD operations
Version management endpoints (create, list, activate, restore, delete, compare)
Automatic versioning on agent updates when enabled
Client SDK:
JavaScript client with full support for stored agents and versions
Type-safe methods for all CRUD and version operations
Usage Example:
// Server-side: Configure storage
import { Mastra } from '@mastra/core';
import { PgAgentsStorage } from '@mastra/pg';
const mastra = new Mastra({
agents: { agentOne },
storage: {
agents: new PgAgentsStorage({
connectionString: process.env.DATABASE_URL,
}),
},
});
// Client-side: Use the SDK
import { MastraClient } from '@mastra/client-js';
const client = new MastraClient({ baseUrl: 'http://localhost:3000' });
// Create a stored agent
const agent = await client.createStoredAgent({
name: 'Customer Support Agent',
description: 'Handles customer inquiries',
model: { provider: 'ANTHROPIC', name: 'claude-sonnet-4-5' },
instructions: 'You are a helpful customer support agent...',
tools: ['search', 'email'],
});
// Create a version snapshot
await client.storedAgent(agent.id).createVersion({
name: 'v1.0 - Initial release',
changeMessage: 'First production version',
});
// Compare versions
const diff = await client.storedAgent(agent.id).compareVersions('version-1', 'version-2');
Why:
This feature enables teams to manage agents dynamically without code changes, making it easier to iterate on agent configurations and maintain a complete audit trail of changes.
Added workflow-get-init-data codemod that transforms getInitData() calls to getInitData<any>().
This codemod helps migrate code after the getInitData return type changed from any to unknown. Adding the explicit <any> type parameter restores the previous behavior while maintaining type safety.
Fixed Convex schema validation error where mastra_workflow_snapshots index by_record_id referenced a missing id field. The id field is now explicitly defined in the Convex workflow snapshots table schema. This enables successful npx convex dev deployments that were previously failing with SchemaDefinitionError.
New storage interfaces for stored agents and agent versions
PostgreSQL, LibSQL, and MongoDB implementations included
In-memory storage for development and testing
API:
RESTful endpoints for agent CRUD operations
Version management endpoints (create, list, activate, restore, delete, compare)
Automatic versioning on agent updates when enabled
Client SDK:
JavaScript client with full support for stored agents and versions
Type-safe methods for all CRUD and version operations
Usage Example:
// Server-side: Configure storage
import { Mastra } from '@mastra/core';
import { PgAgentsStorage } from '@mastra/pg';
const mastra = new Mastra({
agents: { agentOne },
storage: {
agents: new PgAgentsStorage({
connectionString: process.env.DATABASE_URL,
}),
},
});
// Client-side: Use the SDK
import { MastraClient } from '@mastra/client-js';
const client = new MastraClient({ baseUrl: 'http://localhost:3000' });
// Create a stored agent
const agent = await client.createStoredAgent({
name: 'Customer Support Agent',
description: 'Handles customer inquiries',
model: { provider: 'ANTHROPIC', name: 'claude-sonnet-4-5' },
instructions: 'You are a helpful customer support agent...',
tools: ['search', 'email'],
});
// Create a version snapshot
await client.storedAgent(agent.id).createVersion({
name: 'v1.0 - Initial release',
changeMessage: 'First production version',
});
// Compare versions
const diff = await client.storedAgent(agent.id).compareVersions('version-1', 'version-2');
Why:
This feature enables teams to manage agents dynamically without code changes, making it easier to iterate on agent configurations and maintain a complete audit trail of changes.
Dependency versions are now accurately resolved in monorepos, even with hoisted dependencies
ESM-only packages and transitive workspace dependencies are now correctly handled
Deployer-provided packages (like hono) that aren't in your project are now resolved correctly
Why this happened:
Previously, dependency versions were resolved at bundle time without the correct project context, causing the bundler to fall back to latest instead of using the actual installed version.
Fixed Cloudflare Workers exceeding the 3MB size limit due to TypeScript being bundled. The deployer now stubs out TypeScript (~10MB) since the agent-builder gracefully falls back to basic validation when it's unavailable.
Added explicit auth control to built-in API routes. All routes now have a requiresAuth property that determines whether authentication is required. This eliminates route matching overhead and makes auth requirements clear in route definitions. Routes default to requiresAuth: true (protected) for security. To make a route public, set requiresAuth: false in the route definition.
Fixed authentication bypass for custom routes in dev mode. Routes registered with registerApiRoute and requiresAuth: true now correctly enforce authentication even when MASTRA_DEV=true.
Added mcpOptions to server adapters for serverless MCP support.
Why: MCP HTTP transport uses session management by default, which requires persistent state across requests. This doesn't work in serverless environments like Cloudflare Workers or Vercel Edge where each request runs in isolation. The new mcpOptions parameter lets you enable stateless mode without overriding the entire sendResponse() method.
Before:
const server = new MastraServer({
app,
mastra,
});
// No way to pass serverless option to MCP HTTP transport
After:
const server = new MastraServer({
app,
mastra,
mcpOptions: {
serverless: true,
},
});
// MCP HTTP transport now runs in stateless mode
Fixed route prefix behavior to correctly replace the default /api prefix instead of prepending to it. Previously, setting prefix: '/api/v2' resulted in routes at /api/v2/api/agents. Now routes correctly appear at /api/v2/agents as documented.
Added explicit auth control to built-in API routes. All routes now have a requiresAuth property that determines whether authentication is required. This eliminates route matching overhead and makes auth requirements clear in route definitions. Routes default to requiresAuth: true (protected) for security. To make a route public, set requiresAuth: false in the route definition.
Fixed authentication bypass for custom routes in dev mode. Routes registered with registerApiRoute and requiresAuth: true now correctly enforce authentication even when MASTRA_DEV=true.
Added mcpOptions to server adapters for serverless MCP support.
Why: MCP HTTP transport uses session management by default, which requires persistent state across requests. This doesn't work in serverless environments like Cloudflare Workers or Vercel Edge where each request runs in isolation. The new mcpOptions parameter lets you enable stateless mode without overriding the entire sendResponse() method.
Before:
const server = new MastraServer({
app,
mastra,
});
// No way to pass serverless option to MCP HTTP transport
After:
const server = new MastraServer({
app,
mastra,
mcpOptions: {
serverless: true,
},
});
// MCP HTTP transport now runs in stateless mode
Fixed route prefix behavior to correctly replace the default /api prefix instead of prepending to it. Previously, setting prefix: '/api/v2' resulted in routes at /api/v2/api/agents. Now routes correctly appear at /api/v2/agents as documented.
Added explicit auth control to built-in API routes. All routes now have a requiresAuth property that determines whether authentication is required. This eliminates route matching overhead and makes auth requirements clear in route definitions. Routes default to requiresAuth: true (protected) for security. To make a route public, set requiresAuth: false in the route definition.
Fixed authentication bypass for custom routes in dev mode. Routes registered with registerApiRoute and requiresAuth: true now correctly enforce authentication even when MASTRA_DEV=true.
Fixed malformed JSON body handling in Hono adapter. When a POST request contains invalid JSON (e.g., missing closing braces), the server now returns HTTP 400 Bad Request with a structured error message instead of silently accepting the request with HTTP 200. This prevents workflows from starting with undefined input data. (#12310)
Added mcpOptions to server adapters for serverless MCP support.
Why: MCP HTTP transport uses session management by default, which requires persistent state across requests. This doesn't work in serverless environments like Cloudflare Workers or Vercel Edge where each request runs in isolation. The new mcpOptions parameter lets you enable stateless mode without overriding the entire sendResponse() method.
Before:
const server = new MastraServer({
app,
mastra,
});
// No way to pass serverless option to MCP HTTP transport
After:
const server = new MastraServer({
app,
mastra,
mcpOptions: {
serverless: true,
},
});
// MCP HTTP transport now runs in stateless mode
Fixed route prefix behavior to correctly replace the default /api prefix instead of prepending to it. Previously, setting prefix: '/api/v2' resulted in routes at /api/v2/api/agents. Now routes correctly appear at /api/v2/agents as documented.
Added explicit auth control to built-in API routes. All routes now have a requiresAuth property that determines whether authentication is required. This eliminates route matching overhead and makes auth requirements clear in route definitions. Routes default to requiresAuth: true (protected) for security. To make a route public, set requiresAuth: false in the route definition.
Fixed authentication bypass for custom routes in dev mode. Routes registered with registerApiRoute and requiresAuth: true now correctly enforce authentication even when MASTRA_DEV=true.
Added mcpOptions to server adapters for serverless MCP support.
Why: MCP HTTP transport uses session management by default, which requires persistent state across requests. This doesn't work in serverless environments like Cloudflare Workers or Vercel Edge where each request runs in isolation. The new mcpOptions parameter lets you enable stateless mode without overriding the entire sendResponse() method.
Before:
const server = new MastraServer({
app,
mastra,
});
// No way to pass serverless option to MCP HTTP transport
After:
const server = new MastraServer({
app,
mastra,
mcpOptions: {
serverless: true,
},
});
// MCP HTTP transport now runs in stateless mode
Fixed route prefix behavior to correctly replace the default /api prefix instead of prepending to it. Previously, setting prefix: '/api/v2' resulted in routes at /api/v2/api/agents. Now routes correctly appear at /api/v2/agents as documented.
Fixed token usage reporting for Langfuse and PostHog exporters. The input token count now correctly excludes cached tokens, matching each platform's expected format for accurate cost calculation. Cache read and cache write tokens are now properly reported as separate fields (cache_read_input_tokens, cache_creation_input_tokens) rather than being included in the base input count. Added defensive clamping to ensure input tokens never go negative if cache values exceed the total.
Restructured stored agents to use a thin metadata record with versioned configuration snapshots.
The agent record now only stores metadata fields (id, status, activeVersionId, authorId, metadata, timestamps). All configuration fields (name, instructions, model, tools, etc.) live exclusively in version snapshot rows, enabling full version history and rollback.
Key changes:
Stored Agent records are now thin metadata-only (StorageAgentType)
All config lives in version snapshots (StorageAgentSnapshotType)
New resolved type (StorageResolvedAgentType) merges agent record + active version config
Renamed ownerId to authorId for multi-tenant filtering
Changed memory field type from string to Record<string, unknown>
Added status field ('draft' | 'published') to agent records
Flattened CreateAgent/UpdateAgent input types (config fields at top level, no nested snapshot)
Version config columns are top-level in the agent_versions table (no single snapshot jsonb column)
List endpoints return resolved agents (thin record + active version config)
Auto-versioning on update with retention limits and race condition handling
New storage interfaces for stored agents and agent versions
PostgreSQL, LibSQL, and MongoDB implementations included
In-memory storage for development and testing
API:
RESTful endpoints for agent CRUD operations
Version management endpoints (create, list, activate, restore, delete, compare)
Automatic versioning on agent updates when enabled
Client SDK:
JavaScript client with full support for stored agents and versions
Type-safe methods for all CRUD and version operations
Usage Example:
// Server-side: Configure storage
import { Mastra } from '@mastra/core';
import { PgAgentsStorage } from '@mastra/pg';
const mastra = new Mastra({
agents: { agentOne },
storage: {
agents: new PgAgentsStorage({
connectionString: process.env.DATABASE_URL,
}),
},
});
// Client-side: Use the SDK
import { MastraClient } from '@mastra/client-js';
const client = new MastraClient({ baseUrl: 'http://localhost:3000' });
// Create a stored agent
const agent = await client.createStoredAgent({
name: 'Customer Support Agent',
description: 'Handles customer inquiries',
model: { provider: 'ANTHROPIC', name: 'claude-sonnet-4-5' },
instructions: 'You are a helpful customer support agent...',
tools: ['search', 'email'],
});
// Create a version snapshot
await client.storedAgent(agent.id).createVersion({
name: 'v1.0 - Initial release',
changeMessage: 'First production version',
});
// Compare versions
const diff = await client.storedAgent(agent.id).compareVersions('version-1', 'version-2');
Why:
This feature enables teams to manage agents dynamically without code changes, making it easier to iterate on agent configurations and maintain a complete audit trail of changes.
Added status field to listTraces response. The status field indicates the trace state: success (completed without error), error (has error), or running (still in progress). This makes it easier to filter and display traces by their current state without having to derive it from the error and endedAt fields.
Fix PATCH request JSON-body handling in @mastra/client-js so stored agent edit flows work correctly. Fix stored agent schema migration in @mastra/libsql and @mastra/pg to drop and recreate the versions table when the old snapshot-based schema is detected, clean up stale draft records from partial create failures, and remove lingering legacy tables. Restores create and edit flows for stored agents.
Extended readOnly memory option to also apply to working memory. When readOnly: true, working memory data is provided as context but the updateWorkingMemory tool is not available.
Example:
// Working memory is loaded but agent cannot update it
const response = await agent.generate("What do you know about me?", {
memory: {
thread: "conversation-123",
resource: "user-alice-456",
options: { readOnly: true },
},
});
Restructured stored agents to use a thin metadata record with versioned configuration snapshots.
The agent record now only stores metadata fields (id, status, activeVersionId, authorId, metadata, timestamps). All configuration fields (name, instructions, model, tools, etc.) live exclusively in version snapshot rows, enabling full version history and rollback.
Key changes:
Stored Agent records are now thin metadata-only (StorageAgentType)
All config lives in version snapshots (StorageAgentSnapshotType)
New resolved type (StorageResolvedAgentType) merges agent record + active version config
Renamed ownerId to authorId for multi-tenant filtering
Changed memory field type from string to Record<string, unknown>
Added status field ('draft' | 'published') to agent records
Flattened CreateAgent/UpdateAgent input types (config fields at top level, no nested snapshot)
Version config columns are top-level in the agent_versions table (no single snapshot jsonb column)
List endpoints return resolved agents (thin record + active version config)
Auto-versioning on update with retention limits and race condition handling
New storage interfaces for stored agents and agent versions
PostgreSQL, LibSQL, and MongoDB implementations included
In-memory storage for development and testing
API:
RESTful endpoints for agent CRUD operations
Version management endpoints (create, list, activate, restore, delete, compare)
Automatic versioning on agent updates when enabled
Client SDK:
JavaScript client with full support for stored agents and versions
Type-safe methods for all CRUD and version operations
Usage Example:
// Server-side: Configure storage
import { Mastra } from '@mastra/core';
import { PgAgentsStorage } from '@mastra/pg';
const mastra = new Mastra({
agents: { agentOne },
storage: {
agents: new PgAgentsStorage({
connectionString: process.env.DATABASE_URL,
}),
},
});
// Client-side: Use the SDK
import { MastraClient } from '@mastra/client-js';
const client = new MastraClient({ baseUrl: 'http://localhost:3000' });
// Create a stored agent
const agent = await client.createStoredAgent({
name: 'Customer Support Agent',
description: 'Handles customer inquiries',
model: { provider: 'ANTHROPIC', name: 'claude-sonnet-4-5' },
instructions: 'You are a helpful customer support agent...',
tools: ['search', 'email'],
});
// Create a version snapshot
await client.storedAgent(agent.id).createVersion({
name: 'v1.0 - Initial release',
changeMessage: 'First production version',
});
// Compare versions
const diff = await client.storedAgent(agent.id).compareVersions('version-1', 'version-2');
Why:
This feature enables teams to manage agents dynamically without code changes, making it easier to iterate on agent configurations and maintain a complete audit trail of changes.
Added status field to listTraces response. The status field indicates the trace state: success (completed without error), error (has error), or running (still in progress). This makes it easier to filter and display traces by their current state without having to derive it from the error and endedAt fields.
Added status field to listTraces response. The status field indicates the trace state: success (completed without error), error (has error), or running (still in progress). This makes it easier to filter and display traces by their current state without having to derive it from the error and endedAt fields.
Fixed tracingOptions.tags not being preserved when merging defaultOptions with call-site options. Tags set in agent's defaultOptions.tracingOptions are now correctly passed to all observability exporters (Langfuse, Langsmith, Braintrust, Datadog, etc.). Fixes #12209.
Added the ability to see tool approval requests in traces for debugging purposes. When a tool requires approval, a MODEL_CHUNK span named chunk: 'tool-call-approval' is now created containing:
The tool call ID and name for identification
The arguments that need approval
The resume schema defining the approval response format
This enables users to debug their system by seeing approval requests in traces, making it easier to understand the flow of tool approvals and their payloads.
Restructured stored agents to use a thin metadata record with versioned configuration snapshots.
The agent record now only stores metadata fields (id, status, activeVersionId, authorId, metadata, timestamps). All configuration fields (name, instructions, model, tools, etc.) live exclusively in version snapshot rows, enabling full version history and rollback.
Key changes:
Stored Agent records are now thin metadata-only (StorageAgentType)
All config lives in version snapshots (StorageAgentSnapshotType)
New resolved type (StorageResolvedAgentType) merges agent record + active version config
Renamed ownerId to authorId for multi-tenant filtering
Changed memory field type from string to Record<string, unknown>
Added status field ('draft' | 'published') to agent records
Flattened CreateAgent/UpdateAgent input types (config fields at top level, no nested snapshot)
Version config columns are top-level in the agent_versions table (no single snapshot jsonb column)
List endpoints return resolved agents (thin record + active version config)
Auto-versioning on update with retention limits and race condition handling
New storage interfaces for stored agents and agent versions
PostgreSQL, LibSQL, and MongoDB implementations included
In-memory storage for development and testing
API:
RESTful endpoints for agent CRUD operations
Version management endpoints (create, list, activate, restore, delete, compare)
Automatic versioning on agent updates when enabled
Client SDK:
JavaScript client with full support for stored agents and versions
Type-safe methods for all CRUD and version operations
Usage Example:
// Server-side: Configure storage
import { Mastra } from '@mastra/core';
import { PgAgentsStorage } from '@mastra/pg';
const mastra = new Mastra({
agents: { agentOne },
storage: {
agents: new PgAgentsStorage({
connectionString: process.env.DATABASE_URL,
}),
},
});
// Client-side: Use the SDK
import { MastraClient } from '@mastra/client-js';
const client = new MastraClient({ baseUrl: 'http://localhost:3000' });
// Create a stored agent
const agent = await client.createStoredAgent({
name: 'Customer Support Agent',
description: 'Handles customer inquiries',
model: { provider: 'ANTHROPIC', name: 'claude-sonnet-4-5' },
instructions: 'You are a helpful customer support agent...',
tools: ['search', 'email'],
});
// Create a version snapshot
await client.storedAgent(agent.id).createVersion({
name: 'v1.0 - Initial release',
changeMessage: 'First production version',
});
// Compare versions
const diff = await client.storedAgent(agent.id).compareVersions('version-1', 'version-2');
Why:
This feature enables teams to manage agents dynamically without code changes, making it easier to iterate on agent configurations and maintain a complete audit trail of changes.
Added status field to listTraces response. The status field indicates the trace state: success (completed without error), error (has error), or running (still in progress). This makes it easier to filter and display traces by their current state without having to derive it from the error and endedAt fields.
Fix PATCH request JSON-body handling in @mastra/client-js so stored agent edit flows work correctly. Fix stored agent schema migration in @mastra/libsql and @mastra/pg to drop and recreate the versions table when the old snapshot-based schema is detected, clean up stale draft records from partial create failures, and remove lingering legacy tables. Restores create and edit flows for stored agents.
Added ghost variant support to domain comboboxes (AgentCombobox, WorkflowCombobox, MCPServerCombobox, ScorerCombobox, ToolCombobox) and moved them into the breadcrumb for a cleaner navigation pattern
Restructured stored agents to use a thin metadata record with versioned configuration snapshots.
The agent record now only stores metadata fields (id, status, activeVersionId, authorId, metadata, timestamps). All configuration fields (name, instructions, model, tools, etc.) live exclusively in version snapshot rows, enabling full version history and rollback.
Key changes:
Stored Agent records are now thin metadata-only (StorageAgentType)
All config lives in version snapshots (StorageAgentSnapshotType)
New resolved type (StorageResolvedAgentType) merges agent record + active version config
Renamed ownerId to authorId for multi-tenant filtering
Changed memory field type from string to Record<string, unknown>
Added status field ('draft' | 'published') to agent records
Flattened CreateAgent/UpdateAgent input types (config fields at top level, no nested snapshot)
Version config columns are top-level in the agent_versions table (no single snapshot jsonb column)
List endpoints return resolved agents (thin record + active version config)
Auto-versioning on update with retention limits and race condition handling
Added Request Context tab to Tools, Agents, and Workflows in Mastra Studio. When an entity defines a requestContextSchema, a form is displayed allowing you to input context values before execution.
Refactored Combobox component to use @base-ui/react instead of custom Radix UI Popover implementation. This removes ~70 lines of manual keyboard navigation code while preserving the same props interface and styling.
Refactored agent model dropdowns to use the Combobox design system component, reducing code complexity while preserving all features including custom model ID support and provider connection status indicators.
Fixed model combobox auto-opening on mount. The model selector now only opens when explicitly changing providers, improving the initial page load experience.
New storage interfaces for stored agents and agent versions
PostgreSQL, LibSQL, and MongoDB implementations included
In-memory storage for development and testing
API:
RESTful endpoints for agent CRUD operations
Version management endpoints (create, list, activate, restore, delete, compare)
Automatic versioning on agent updates when enabled
Client SDK:
JavaScript client with full support for stored agents and versions
Type-safe methods for all CRUD and version operations
Usage Example:
// Server-side: Configure storage
import { Mastra } from '@mastra/core';
import { PgAgentsStorage } from '@mastra/pg';
const mastra = new Mastra({
agents: { agentOne },
storage: {
agents: new PgAgentsStorage({
connectionString: process.env.DATABASE_URL,
}),
},
});
// Client-side: Use the SDK
import { MastraClient } from '@mastra/client-js';
const client = new MastraClient({ baseUrl: 'http://localhost:3000' });
// Create a stored agent
const agent = await client.createStoredAgent({
name: 'Customer Support Agent',
description: 'Handles customer inquiries',
model: { provider: 'ANTHROPIC', name: 'claude-sonnet-4-5' },
instructions: 'You are a helpful customer support agent...',
tools: ['search', 'email'],
});
// Create a version snapshot
await client.storedAgent(agent.id).createVersion({
name: 'v1.0 - Initial release',
changeMessage: 'First production version',
});
// Compare versions
const diff = await client.storedAgent(agent.id).compareVersions('version-1', 'version-2');
Why:
This feature enables teams to manage agents dynamically without code changes, making it easier to iterate on agent configurations and maintain a complete audit trail of changes.
Added Command component (CMDK) with CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandSeparator, and CommandShortcut subcomponents for building command palettes and searchable menus
Refactored WorkflowTrigger component into focused sub-components for better maintainability. Extracted WorkflowTriggerForm, WorkflowSuspendedSteps, WorkflowCancelButton, and WorkflowStepsStatus. Added useSuspendedSteps and useWorkflowSchemas hooks for memoized computations. No changes to public API.
Refined color palette for a more polished dark theme. Surfaces now use warm near-blacks, accents are softer and less neon, borders are subtle white overlays for a modern look.
Added useCancelWorkflowRun hook to @mastra/react for canceling workflow runs. This hook was previously only available internally in playground-ui and is now exported for use in custom applications.
Added global command palette (Cmd+K) for quick navigation to any entity in Mastra Studio. Press Cmd+K (or Ctrl+K on Windows/Linux) to search and navigate to agents, workflows, tools, scorers, processors, and MCP servers.
Fixed skill detail page crashing when skills have object-typed compatibility or metadata fields. Skills from skills.sh and other external sources now display correctly.
Remove hardcoded temperature: 0.5 and topP: 1 defaults from playground agent settings
Let agent config and provider defaults handle these values instead
Added useStreamWorkflow hook to @mastra/react for streaming workflow execution. This hook supports streaming, observing, resuming, and time-traveling workflows. It accepts tracingOptions and onError as parameters for better customization.
Added IconButton design system component that combines button styling with built-in tooltip support. Replaced TooltipIconButton with IconButton throughout the chat interface for consistency.
Developers can now configure a custom API route prefix in the Studio UI, enabling Studio to work with servers using custom base paths (e.g., /mastra instead of the default /api). See #12261 for more details.
Fixed token usage reporting for Langfuse and PostHog exporters. The input token count now correctly excludes cached tokens, matching each platform's expected format for accurate cost calculation. Cache read and cache write tokens are now properly reported as separate fields (cache_read_input_tokens, cache_creation_input_tokens) rather than being included in the base input count. Added defensive clamping to ensure input tokens never go negative if cache values exceed the total.
Added support for 20 additional languages in code chunking
Extended RecursiveCharacterTransformer to support all languages defined in the Language enum. Previously, only 6 languages were supported (CPP, C, TS, MARKDOWN, LATEX, PHP), causing runtime errors for other defined languages.
PROTO (Protocol Buffers), RST (reStructuredText) (data/documentation formats)
Each language has been configured with appropriate separators based on its syntax patterns (modules, classes, functions, control structures) to enable semantic code chunking.
Before:
import { RecursiveCharacterTransformer, Language } from '@mastra/rag';
// These would all throw "Language X is not supported!" errors
const goTransformer = RecursiveCharacterTransformer.fromLanguage(Language.GO);
const pythonTransformer = RecursiveCharacterTransformer.fromLanguage(Language.PYTHON);
const rustTransformer = RecursiveCharacterTransformer.fromLanguage(Language.RUST);
After:
import { RecursiveCharacterTransformer, Language } from '@mastra/rag';
// All languages now work seamlessly
const goTransformer = RecursiveCharacterTransformer.fromLanguage(Language.GO);
const goChunks = goTransformer.transform(goCodeDocument);
const pythonTransformer = RecursiveCharacterTransformer.fromLanguage(Language.PYTHON);
const pythonChunks = pythonTransformer.transform(pythonCodeDocument);
const rustTransformer = RecursiveCharacterTransformer.fromLanguage(Language.RUST);
const rustChunks = rustTransformer.transform(rustCodeDocument);
// All languages in the Language enum are now fully supported
Previously, the Language enum defined PHP, but it was not supported in the getSeparatorsForLanguage method. This caused runtime errors when trying to use PHP for code chunking.
This change adds proper separator definitions for PHP, ensuring that PHP defined in the Language enum is now fully supported. PHP has been configured with appropriate separators based on its syntax and common programming patterns (classes, functions, control structures, etc.).
Before:
import { RecursiveCharacterTransformer, Language } from '@mastra/rag';
const transformer = RecursiveCharacterTransformer.fromLanguage(Language.PHP);
const chunks = transformer.transform(phpCodeDocument);
// Throws: "Language PHP is not supported!"
After:
import { RecursiveCharacterTransformer, Language } from '@mastra/rag';
const transformer = RecursiveCharacterTransformer.fromLanguage(Language.PHP);
const chunks = transformer.transform(phpCodeDocument);
// Successfully chunks PHP code at namespace, class, function boundaries
Fixes the issue where using Language.PHP would throw "Language PHP is not supported!" error.
Added useCancelWorkflowRun hook to @mastra/react for canceling workflow runs. This hook was previously only available internally in playground-ui and is now exported for use in custom applications.
Added useStreamWorkflow hook to @mastra/react for streaming workflow execution. This hook supports streaming, observing, resuming, and time-traveling workflows. It accepts tracingOptions and onError as parameters for better customization.
Restructured stored agents to use a thin metadata record with versioned configuration snapshots.
The agent record now only stores metadata fields (id, status, activeVersionId, authorId, metadata, timestamps). All configuration fields (name, instructions, model, tools, etc.) live exclusively in version snapshot rows, enabling full version history and rollback.
Key changes:
Stored Agent records are now thin metadata-only (StorageAgentType)
All config lives in version snapshots (StorageAgentSnapshotType)
New resolved type (StorageResolvedAgentType) merges agent record + active version config
Renamed ownerId to authorId for multi-tenant filtering
Changed memory field type from string to Record<string, unknown>
Added status field ('draft' | 'published') to agent records
Flattened CreateAgent/UpdateAgent input types (config fields at top level, no nested snapshot)
Version config columns are top-level in the agent_versions table (no single snapshot jsonb column)
List endpoints return resolved agents (thin record + active version config)
Auto-versioning on update with retention limits and race condition handling
Fixed server handlers to find stored and sub-agents, not just registered agents. Agents created via the API or stored in the database are now correctly resolved in A2A, memory, scores, tools, and voice endpoints.
Added explicit auth control to built-in API routes. All routes now have a requiresAuth property that determines whether authentication is required. This eliminates route matching overhead and makes auth requirements clear in route definitions. Routes default to requiresAuth: true (protected) for security. To make a route public, set requiresAuth: false in the route definition.
Fixed a bug introduced in PR #12251 where requestContext was not passed through to agent and workflow operations. This could cause tools and nested operations that rely on requestContext values to fail or behave incorrectly.
Fixed authentication bypass for custom routes in dev mode. Routes registered with registerApiRoute and requiresAuth: true now correctly enforce authentication even when MASTRA_DEV=true.
New storage interfaces for stored agents and agent versions
PostgreSQL, LibSQL, and MongoDB implementations included
In-memory storage for development and testing
API:
RESTful endpoints for agent CRUD operations
Version management endpoints (create, list, activate, restore, delete, compare)
Automatic versioning on agent updates when enabled
Client SDK:
JavaScript client with full support for stored agents and versions
Type-safe methods for all CRUD and version operations
Usage Example:
// Server-side: Configure storage
import { Mastra } from '@mastra/core';
import { PgAgentsStorage } from '@mastra/pg';
const mastra = new Mastra({
agents: { agentOne },
storage: {
agents: new PgAgentsStorage({
connectionString: process.env.DATABASE_URL,
}),
},
});
// Client-side: Use the SDK
import { MastraClient } from '@mastra/client-js';
const client = new MastraClient({ baseUrl: 'http://localhost:3000' });
// Create a stored agent
const agent = await client.createStoredAgent({
name: 'Customer Support Agent',
description: 'Handles customer inquiries',
model: { provider: 'ANTHROPIC', name: 'claude-sonnet-4-5' },
instructions: 'You are a helpful customer support agent...',
tools: ['search', 'email'],
});
// Create a version snapshot
await client.storedAgent(agent.id).createVersion({
name: 'v1.0 - Initial release',
changeMessage: 'First production version',
});
// Compare versions
const diff = await client.storedAgent(agent.id).compareVersions('version-1', 'version-2');
Why:
This feature enables teams to manage agents dynamically without code changes, making it easier to iterate on agent configurations and maintain a complete audit trail of changes.
Fixed malformed JSON body handling in Hono adapter. When a POST request contains invalid JSON (e.g., missing closing braces), the server now returns HTTP 400 Bad Request with a structured error message instead of silently accepting the request with HTTP 200. This prevents workflows from starting with undefined input data. (#12310)
Fix path parameter routes not respecting requiresAuth setting
Fixes issue where custom API routes with path parameters (e.g., /users/:id) were incorrectly requiring authentication even when requiresAuth was set to false. The authentication middleware now uses pattern matching to correctly match dynamic routes against registered patterns.
Changes:
Inlined path pattern matching utility (based on regexparam) to avoid dependency complexity
Updated isCustomRoutePublic() to iterate through routes and match path patterns
Enhanced pathMatchesPattern() to support path parameters (:id), optional parameters (:id?), and wildcards (*)
Added comprehensive test coverage for path parameter matching scenarios
Added mcpOptions to server adapters for serverless MCP support.
Why: MCP HTTP transport uses session management by default, which requires persistent state across requests. This doesn't work in serverless environments like Cloudflare Workers or Vercel Edge where each request runs in isolation. The new mcpOptions parameter lets you enable stateless mode without overriding the entire sendResponse() method.
Before:
const server = new MastraServer({
app,
mastra,
});
// No way to pass serverless option to MCP HTTP transport
After:
const server = new MastraServer({
app,
mastra,
mcpOptions: {
serverless: true,
},
});
// MCP HTTP transport now runs in stateless mode
Fixed memory API endpoints to respect MASTRA_RESOURCE_ID_KEY and MASTRA_THREAD_ID_KEY from middleware. Previously, these endpoints ignored the reserved context keys and used client-provided values directly, allowing authenticated users to potentially access other users' threads and messages. Now when middleware sets these reserved keys, they take precedence over client-provided values for secure user isolation.
Added support for including custom API routes in the generated OpenAPI documentation. Custom routes registered via registerApiRoute() now appear in the OpenAPI spec alongside built-in Mastra routes.
Fixed route prefix behavior to correctly replace the default /api prefix instead of prepending to it. Previously, setting prefix: '/api/v2' resulted in routes at /api/v2/api/agents. Now routes correctly appear at /api/v2/agents as documented.
Added peer dependency version validation when running mastra dev and mastra build. The CLI now checks if installed @mastra/* packages satisfy each other's peer dependency requirements and displays a warning with upgrade instructions when mismatches are detected.
New storage interfaces for stored agents and agent versions
PostgreSQL, LibSQL, and MongoDB implementations included
In-memory storage for development and testing
API:
RESTful endpoints for agent CRUD operations
Version management endpoints (create, list, activate, restore, delete, compare)
Automatic versioning on agent updates when enabled
Client SDK:
JavaScript client with full support for stored agents and versions
Type-safe methods for all CRUD and version operations
Usage Example:
// Server-side: Configure storage
import { Mastra } from '@mastra/core';
import { PgAgentsStorage } from '@mastra/pg';
const mastra = new Mastra({
agents: { agentOne },
storage: {
agents: new PgAgentsStorage({
connectionString: process.env.DATABASE_URL,
}),
},
});
// Client-side: Use the SDK
import { MastraClient } from '@mastra/client-js';
const client = new MastraClient({ baseUrl: 'http://localhost:3000' });
// Create a stored agent
const agent = await client.createStoredAgent({
name: 'Customer Support Agent',
description: 'Handles customer inquiries',
model: { provider: 'ANTHROPIC', name: 'claude-sonnet-4-5' },
instructions: 'You are a helpful customer support agent...',
tools: ['search', 'email'],
});
// Create a version snapshot
await client.storedAgent(agent.id).createVersion({
name: 'v1.0 - Initial release',
changeMessage: 'First production version',
});
// Compare versions
const diff = await client.storedAgent(agent.id).compareVersions('version-1', 'version-2');
Why:
This feature enables teams to manage agents dynamically without code changes, making it easier to iterate on agent configurations and maintain a complete audit trail of changes.
Fixed Studio scorers page crash when navigating directly to a scorer URL or reloading the page. The page would crash with 'Cannot read properties of undefined' due to a race condition between scorer and agents data loading.