unstale

npm / mastra

mastra

What changed in mastra 1, from its official release notes, upgrade guides and advisories. Also covers @mastra/agent-builder, @mastra/ai-sdk, @mastra/arize, @mastra/client-js, @mastra/codemod, @mastra/convex, @mastra/core, @mastra/deployer-cloudflare, @mastra/editor, @mastra/elasticsearch, @mastra/evals, @mastra/memory, @mastra/observability, @mastra/playground-ui, @mastra/rag, @mastra/react, @mastra/schema-compat, @mastra/server. Sources checked 2026-10-19.

15 breaking5 security58 new APIs and options1 performance16 behavior and defaults3 tooling26 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

mastra 1124 changes

Breaking changes 15

  • Vector document IDs now come from Elasticsearch _id; stored id fields are no longer written, which affects code relying on source.id.

    1.2.0release notes

  • The Hono adapter returns HTTP 400 with a structured error for invalid POST JSON instead of HTTP 200, preventing workflows from starting with undefined input.

    1.1.0release notes

  • The Hono adapter returns HTTP 400 with a structured error for invalid JSON POST bodies instead of accepting them with HTTP 200.

    1.1.0release notes

  • Memory API endpoints now prioritize this middleware-reserved context key over client-provided values for secure user isolation.

    1.1.0release notes

  • Memory API endpoints now prioritize this middleware-reserved context key over client-provided values for secure user isolation.

    1.1.0release notes

  • A configured route prefix now replaces the default /api prefix instead of being prepended to it.

    1.1.0release notes

  • Adapters and @mastra/server add explicit per-route authentication controls, with routes protected by default.

    1.1.0release notes

  • Built-in API routes now declare whether authentication is required; routes default to protected, and setting requiresAuth: false makes a route public.

    1.1.0release notes

  • Stored agent records now contain metadata only; configuration lives in versioned snapshot rows, and ownerId is renamed to authorId.

    1.1.0release notes

  • Stored agent records now contain metadata while configuration lives in version snapshots; ownerId is renamed to authorId, memory becomes a record, and status is added.

    1.1.0release notes

  • Stored agent records now contain metadata only; configuration lives in version snapshots, and list endpoints return resolved agents. The ownerId field is renamed to authorId.

    1.1.0release notes

  • Stored agent records now hold metadata while configuration lives in version snapshots; resolved agents combine the record with active-version configuration. Inputs are flattened, memory is an object, and ownerId is renamed to authorId.

    1.1.0release notes

  • Stored agent records now hold thin metadata while configuration lives in version snapshots; the change also adds status, renames ownerId to authorId, changes memory to an object, and flattens create/update inputs.

    1.1.0release notes

  • The Google embedding model was removed from the model router; use google/gemini-embedding-001 instead.

    1.1.0release notes

  • A codemod transforms getInitData() calls to getInitData<any>() to restore the previous behavior after its return type changed from any to unknown.

    1.1.0release notes

Security 5

  • Sensitive observability credentials in tracingContext are excluded from tool execution error logs.

    1.2.0release notes

  • Custom routes with requiresAuth: true enforce authentication in dev mode, and routes with path parameters correctly respect requiresAuth: false.

    1.1.0release notes

  • Custom routes registered with requiresAuth: true now enforce authentication in development mode.

    1.1.0release notes

  • Built-in API routes expose requiresAuth, defaulting to true; set it to false to make a route public.

    1.1.0release notes

  • A unified API provides filesystem operations, sandboxed execution, search, and SKILL.md discovery with safety controls.

    1.1.0release notes

New APIs and options 58

  • Look up processors by ID on an Agent.

    1.2.0release notes

  • Elasticsearch connections accept authentication configuration, including API key, basic, and bearer authentication.

    1.2.0release notes

  • The project creation wizard can optionally install official Mastra skills and lets users choose an agent.

    1.2.0release notes

  • A utility helps extract tool results from scorer output for use in dynamic scoring context.

    1.2.0release notes

  • The hallucination scorer accepts a getContext hook to resolve scoring context dynamically at runtime.

    1.2.0release notes

  • A utility type for schema input type inference is available.

    1.2.0release notes

  • A utility type for schema output type inference is available.

    1.2.0release notes

  • A new package stores, versions, and resolves agent configurations from a database, including dependencies from the Mastra registry.

    1.2.0release notes

  • The server adds proxy endpoints for searching, browsing, previewing, installing, updating, and removing skills from skills.sh.

    1.2.0release notes

  • Workspace filesystem errors expose a MastraClientError with status and body properties; not-found errors return 404 instead of 500.

    1.2.0release notes

  • Set observationalMemory: true to enable a three-tier memory system that compresses conversation history into observations and reflections.

    1.2.0release notes

  • A manual API for triggering observation outside the normal agent loop is available.

    1.2.0release notes

  • Processor state can be persisted across loop iterations.

    1.2.0release notes

  • Processors can emit custom stream events using ProcessorStreamWriter.

    1.2.0release notes

  • ToolSearchProcessor's search configuration accepts minScore to filter results below a score threshold; the documented default is 0.

    1.2.0release notes

  • ToolSearchProcessor's search configuration accepts topK to set the number of returned results; the documented default is 5.

    1.2.0release notes

  • Workspace accepts a custom search index name; default index names now use underscores to work with SQL-based vector stores.

    1.2.0release notes

  • Non-interactive project creation can install skills by passing comma-separated agent names with --skills.

    1.2.0release notes

  • Studio adds an Add Skill dialog to browse, preview, install, update, and remove skills from the skills.sh registry.

    1.2.0release notes

  • A type is available for schemas implementing both validation and JSON Schema conversion.

    1.2.0release notes

  • Agents can search for and load tools on demand through built-in meta-tools, reducing context usage when working with large tool libraries.

    1.2.0release notes

  • Convert Zod, JSON Schema, or AI SDK schemas to Standard Schema format.

    1.2.0release notes

  • The model loop stream accepts activeTools to control which tools are available during LLM execution.

    1.1.0release notes

  • Network calls can receive an abort signal and an onAbort callback so callers can cancel execution and handle aborts.

    1.1.0release notes

  • Dynamic agent management adds CRUD operations, version history, compare and restore capabilities, and automatic versioning on updates.

    1.1.0release notes

  • MastraClient accepts a custom API route prefix for servers deployed behind non-default paths; the default remains /api.

    1.1.0release notes

  • MastraClientProvider accepts apiPrefix for connecting to servers with custom API route prefixes; it defaults to /api.

    1.1.0release notes

  • Stored agents can be created, edited, and deleted through CRUD APIs, with version history, compare and restore capabilities, and optional automatic versioning.

    1.1.0release notes

  • Trace results include a status of success, error, or running, making trace state easier to filter and display.

    1.1.0release notes

  • The response now includes a status field indicating whether a trace succeeded, errored, or is still running.

    1.1.0release notes

  • The listTraces response now includes a status indicating whether a trace succeeded, errored, or is still running.

    1.1.0release notes

  • The listTraces response now includes a status field indicating whether each trace succeeded, errored, or is still running, so callers can filter traces without deriving state from other fields.

    1.1.0release notes

  • The client adds workspace methods for files, skills, references, and search.

    1.1.0release notes

  • Set MASTRA_SKIP_PEERDEP_CHECK=1 to skip the CLI peer dependency check.

    1.1.0release notes

  • The studio command accepts --server-api-prefix to connect to servers with custom API route prefixes.

    1.1.0release notes

  • Workspace client methods support workspace discovery, filesystem operations, skill management, and indexed-content search.

    1.1.0release notes

  • Server adapters accept MCP options, including serverless: true, for stateless MCP HTTP transport in serverless or edge environments.

    1.1.0release notes

  • Server adapters accept mcpOptions.serverless to run MCP HTTP transport without session state, supporting isolated serverless requests.

    1.1.0release notes

  • Server adapters accept mcpOptions; setting serverless: true enables stateless MCP HTTP transport for serverless environments.

    1.1.0release notes

  • Providers using non-default AI SDK packages are routed to their correct SDK instead of falling back to openai-compatible; Cerebras, Together AI, and DeepInfra are added as native SDK providers.

    1.1.0release notes

  • When enabled, working memory is provided as context but the updateWorkingMemory tool is unavailable.

    1.1.0release notes

  • When readOnly is true, working memory is provided as context but the updateWorkingMemory tool is unavailable.

    1.1.0release notes

  • Provides access to all request context values, including validated values.

    1.1.0release notes

  • Tools, agents, workflows, and steps can define a Zod schema to validate request context at runtime and provide typed access.

    1.1.0release notes

  • Added type support for requestContextSchema.

    1.1.0release notes

  • The Inngest integration adds requestContextSchema type support.

    1.1.0release notes

  • Added type support for requestContextSchema.

    1.1.0release notes

  • Adds an option to connect Mastra Studio to a server using a custom API prefix.

    1.1.0release notes

  • Stored agents gain CRUD and version-management APIs, client SDK support, and automatic versioning on updates when enabled, allowing dynamic configuration management and audit history.

    1.1.0release notes

  • Stored agents gain CRUD and version-management operations, including creating, listing, activating, restoring, deleting, and comparing versions, with automatic versioning on updates when enabled.

    1.1.0release notes

  • Agents can be created, edited, deleted, and versioned dynamically through storage, REST endpoints, and the client SDK, with version comparison and restoration.

    1.1.0release notes

  • Developers can configure a custom API route prefix in the Studio UI so Studio works with servers using a custom base path instead of /api.

    1.1.0release notes

  • The workflow-run cancellation hook is now exported from @mastra/react for use in custom applications.

    1.1.0release notes

  • The hook is exported from @mastra/react so custom applications can cancel workflow runs.

    1.1.0release notes

  • A new @mastra/react hook supports streaming, observing, resuming, and time-traveling workflows, with tracingOptions and onError parameters.

    1.1.0release notes

  • The @mastra/react hook supports streaming, observing, resuming, and time-traveling workflows, with tracingOptions and onError parameters.

    1.1.0release notes

  • The playground UI adds components for browsing and viewing workspace files, listing skills, searching workspace content, and viewing skill reference files.

    1.1.0release notes

  • Workspace API endpoints provide workspace discovery, filesystem operations, skill listing and details, references, and indexed-content search.

    1.1.0release notes

Performance 1

  • The Cloudflare deployer stubs out TypeScript to avoid exceeding the Workers 3MB size limit; agent-builder falls back to basic validation when TypeScript is unavailable.

    1.1.0release notes

Behavior and default changes 16

  • Filesystem providers extending MastraFilesystem now automatically receive the Mastra logger for consistent file-operation logging.

    1.2.0release notes

  • Sandbox providers extending MastraSandbox now automatically receive the Mastra logger for consistent command-execution logging.

    1.2.0release notes

  • Custom input processors replace only configured processors; memory and workspace skill tools remain available in generate() and stream().

    1.2.0release notes

  • recall now returns token usage from the vector-search query embedding.

    1.2.0release notes

  • saveMessages now returns aggregated embedding token usage so applications can track embedding consumption.

    1.2.0release notes

  • AI tracing now defaults to a 128KB maxStringLength and maxDepth 8, reducing truncation of large prompts and responses.

    1.2.0release notes

  • Agent voice configuration now accepts any MastraVoice implementation directly, without requiring a CompositeVoice wrapper.

    1.1.0release notes

  • bail() accepts any value, allowing workflow steps to exit early with a custom result.

    1.1.0release notes

  • AgentBuilder now uses InMemoryStore as a fallback when no storage is provided, allowing Memory operations without explicit storage configuration.

    1.1.0release notes

  • The Agent voice property now accepts MastraVoice implementations directly instead of only CompositeVoice.

    1.1.0release notes

  • The model router now propagates providers' supported URL patterns, allowing supported file URLs to be passed directly instead of downloaded and converted to bytes or base64.

    1.1.0release notes

  • Custom API routes registered with registerApiRoute are included in generated OpenAPI documentation alongside built-in routes.

    1.1.0release notes

  • The playground no longer hardcodes temperature: 0.5 or topP: 1 in agent settings; agent configuration and provider defaults now determine these values.

    1.1.0release notes

  • Tool approval requests now create MODEL_CHUNK spans containing the tool call ID and name, approval arguments, and resume schema, making approval flows visible for debugging.

    1.1.0release notes

  • Spans inherit entity metadata from the closest non-internal parent, processor spans track input and output separately, streaming emits model chunk spans, and internal framework spans are omitted from exported traces.

    1.1.0release notes

  • Spans inherit entity identifiers from the closest non-internal parent, processor spans track input and output separately, streaming chunks emit model chunk spans, and internal framework spans are excluded from exported traces.

    1.1.0release notes

Tooling 3

  • create mastra can add an AGENTS.md file during project creation, and can optionally add CLAUDE.md.

    1.2.0release notes

  • The CLI checks whether installed @mastra/* packages satisfy each other's peer dependency requirements and warns with upgrade instructions when they do not.

    1.1.0release notes

  • The CLI checks whether installed @mastra/* packages satisfy each other's peer dependency requirements and warns with upgrade instructions when they do not.

    1.1.0release notes

Fixes and other changes 26

  • The moonshotai provider now uses an Anthropic-compatible API endpoint to properly handle reasoning_content for kimi-k2.5.

    1.2.0release notes

  • The China moonshotai provider now uses an Anthropic-compatible API endpoint to properly handle reasoning_content for kimi-k2.5.

    1.2.0release notes

  • An explicit toolChoice of none returned with empty tools is preserved instead of being discarded and defaulting to auto.

    1.2.0release notes

  • Malformed routing-agent JSON is fed back to the routing agent so it can retry instead of crashing the network.

    1.1.0release notes

  • Network workflow runs now receive request context, including user and resource metadata for observability and analytics.

    1.1.0release notes

  • Configured input and output processors are applied to the routing agent, while memory-derived processors are excluded.

    1.1.0release notes

  • Configured output processors are applied to messages before network execution saves them to storage.

    1.1.0release notes

  • Sub-agents no longer receive completion-check feedback from prior network iterations.

    1.1.0release notes

  • Deployer resolves dependency versions accurately in monorepos, including hoisted dependencies, ESM-only packages, transitive workspace dependencies, and deployer-provided packages.

    1.1.0release notes

  • Template merging now converts kebab-case filenames to camelCase correctly and fixes PascalCase and acronym-boundary conversions.

    1.1.0release notes

  • RecursiveCharacterTransformer now supports all languages defined in the Language enum, including languages that previously caused runtime errors during code chunking.

    1.1.0release notes

  • The Convex workflow snapshots table schema now defines the id field required by the by_record_id index, enabling successful Convex deployments.

    1.1.0release notes

  • Swagger UI now uses the correct OpenAPI endpoint URL, /api/openapi.json.

    1.1.0release notes

  • Agent and workflow operations now receive requestContext, preventing tools and nested operations that depend on its values from failing or behaving incorrectly.

    1.1.0release notes

  • Route prefixes are normalized, and a custom prefix replaces the default /api prefix rather than being prepended to it.

    1.1.0release notes

  • Workflow, agent, and tool spans now map to CHAIN, AGENT, and TOOL respectively instead of defaulting to LLM.

    1.1.0release notes

  • PATCH requests now save stored-agent changes correctly instead of failing silently; schema migration and stale-record cleanup restore create and edit flows.

    1.1.0release notes

  • PATCH requests now save stored agent changes correctly; migration handling repairs old snapshot-based schemas and cleans up stale draft records and legacy tables.

    1.1.0release notes

  • Stored agent edits no longer fail silently; PATCH requests save changes correctly, and schema migration repairs legacy snapshot-based versions tables and stale records.

    1.1.0release notes

  • Server handlers now resolve stored and sub-agents as well as registered agents for A2A, memory, scores, tools, and voice endpoints.

    1.1.0release notes

  • suspendedToolRunId is nullable to fix null handling in tool input validation.

    1.1.0release notes

  • The function imports ReadableStream and TransformStream from node:stream/web, fixing TypeScript async-iterator errors with for-await-of loops.

    1.1.0release notes

  • Langfuse and PostHog exporters exclude cached tokens from input counts, report cache read and creation tokens separately, and clamp input counts to prevent negative values.

    1.1.0release notes

  • Validation retries after stripping null values when the initial attempt fails, so optional fields accept null while nullable fields continue to work.

    1.1.0release notes

  • Tags from agent defaultOptions.tracingOptions are now preserved when merging call-site options and passed to observability exporters.

    1.1.0release notes

  • Tags from agent default tracing options are preserved when call-site options are merged and are passed to observability exporters.

    1.1.0release notes