npm / @mastra/core
@mastra/core
What changed in @mastra/core 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
11 breaking1 security5 deprecations45 new APIs and options1 performance8 behavior and defaults12 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@mastra/core 183 changes
Breaking changes 11
Invalid resume data now throws this error without consuming the suspended run, allowing another resume with valid data.
Without resourceId, the stream now delivers only tasks with no resource; pass allResources: true to subscribe across resources.
Memory derives its resource and thread from resource: and thread: scopes; conflicting values now cause a 400 error.
Commands exceeding the 256 MiB per-stream output limit reject with ProcessOutputLimitError.
Includes a result entry for every experiment ID on each item, ignores duplicate IDs, and throws if
baselineIdis not inexperimentIds.Provider-run tool errors are saved and returned as errors in later steps and recalled conversations, rather than as successful results.
Throws when called during a thread lifecycle transition.
Throws when called during a thread lifecycle transition.
Tool execute and request-context types now use transformed schema output types instead of a union of input and output types.
A model passed to a durable agent's
stream()call is now the model that actually runs, rather than the agent's default model.Resuming a workflow run that is not suspended now throws an error with this ID.
Security 1
When an output processor blocks a reply, saved reply messages are deleted so blocked text is not retained or sent to the model on the next turn.
Deprecations 5
Deprecated in favor of buildPreview.
Deprecated in favor of PREVIEW_MAX_LENGTH.
The pending-item storage helper methods are deprecated.
The
modeId,modelId,state, andpendingfields are deprecated as AgentController sessions restore saved thread state.resolveToolCallId()is deprecated in favor of address-based suspension APIs.
New APIs and options 45
Read an agent's configured scopes.
Set allResources to true to subscribe to background task events across every resource.
Signal-triggered runs record signal metadata on the AGENT_RUN span for traceability.
Adds a tool hook before approval that can reject a call and return output to the model without pausing for approval.
Builds a readable preview from a decoded payload, capped at PREVIEW_MAX_LENGTH characters.
Builds a preview from stored JSON text, capped at PREVIEW_MAX_LENGTH characters.
Trace and span list results now include error previews.
Span query rows report whether error preview content was truncated.
Trusted middleware can inject scopes through this request context key.
Memory implementations can provide error processors that agents append to their resolved error processors.
Adds the error-processor support required for Observational Memory to recover from context-window overflows; older core versions pass the error to the caller.
Pass Infinity to retain all command output, subject to a 256 MiB per-stream limit.
Trace and span list results now include output previews alongside input previews.
Exports the shared maximum length used for generated and stored previews.
Set this option to true to retain strict mode for OpenAI structured output schemas with free-form keys.
Queue a typed signal behind an active run while preserving its type, tag, and attributes.
Agents accept scopes per call, on the agent, or from trusted middleware; Mastra merges them to identify the addresses a run acts as.
Agents can use scopes: resource and thread scopes determine memory identity, other scopes reach tools and processors, and resumed runs retain and validate their scopes.
Adds a schema describing the dimensions and measures accepted by trace aggregation.
Identifies a resume attempt that lost the claim because another approval or resume is running or just finished.
Exported type describing the output stored for an agent experiment target.
Appends a buffered chunk to the current generation and reports whether it persisted and its record ID.
Claims a tool suspension and returns an address that can be used to respond after switching threads.
Writes active observations with an outcome indicating whether the write applied, and can reject stale or conflicting writes.
Supports
provider_tool_callsteps so trajectory expectations can cover provider-executed tools and compare their arguments, result, and success.Exported type describing experiment result output.
Defines a sandbox-provider contract with optional tunable settings, repository templates, and template builds for Mastra Factory.
Accepts file attachments, which reach the model whether the message is sent immediately or queued behind an active run.
Formats W3C
traceparentvalues for trace linking.Reads the authenticated author attached to an AgentController session message.
Exports a helper for hosts that persist or key suspension addresses.
Spans can reference spans in other traces without joining those traces, and storage saves the links.
Setting this variable to
1disables telemetry and skips Git discovery.Parses W3C
traceparentvalues for trace linking.Gateway provider configs can specify model prices in USD per 1 million tokens so private or reseller model calls can receive cost estimates.
Accepts an authenticated message author that can later be read with
getMessageAuthor.Responds to a claimed tool suspension using its address and resume data.
Exported type describing the output stored for a scorer experiment target.
Accepts an authenticated message author that can later be read with
getMessageAuthor.Accepts an authenticated message author that can later be read with
getMessageAuthor.Accepts file attachments, which reach the model whether the message is sent immediately or queued behind an active run.
Observational memory records carry the ID of the newer generation that replaced them.
Exported address type for hosts that persist or key suspension addresses when claiming and resuming prompts after switching threads.
Experiment results include a target type that narrows
outputto typed agent or scorer output; other targets retainunknownoutput.Transfers ownership of an AgentController thread to another owner.
Performance 1
Workflow steps, conditions, and dynamic sleeps create a writer stream only when code reads it, reducing memory churn in agent loops.
Behavior and default changes 8
Live assistant messages now include modelId and provider metadata, including the fallback model after fallback.
Previews for message lists show the last user message instead of joining every user message.
Suspended runs preserve their recorded scopes when resumed, and a resume cannot add scopes.
Command output retains the newest 1 MiB of stdout and stderr by default; truncation is reported, and maxRetainedBytes can change the retained limit.
Memory stores streamed document citations as source-document parts with media type, title, and filename, preserving citations after reload.
Trace searches no longer have a 31-day maximum range; the range must still start before it ends.
A temporal-gap reminder signal sorts directly before the message it describes instead of appearing after it.
Durable agent step results now include each step's response messages and model ID, matching regular agents.
Fixes and other changes 12
Registered durable agents now run through their durable wrapper in workflow steps on both engines.
Workflow agent steps now support durable agents on both execution engines.
Claims a suspended run before resuming it, preventing concurrent callers from running the same tool twice.
Claims a suspended run before resuming it, preventing concurrent callers from running the same tool twice.
Scorers receive every response message across suspend/resume segments under the original run ID, including when observational memory is enabled.
Evented agents and nested evented workflows can resolve steps reachable only through a parent workflow when an orchestration worker calls the API server.
Tools returned by an input processor now receive the agent's ID in
context.agent.agentId, in regular and durable agents.Claims a suspended run before resuming it, preventing concurrent callers from running the same tool twice.
Redis, Spanner, Upstash, and Valkey stores reject writes from durable agent executions that lost their run to crash recovery, preventing them from overwriting recovered state.
Durable, evented, and Inngest agents no longer leak one run's messages into another run's prompt when Mastra instances reuse a run ID in the same process.
An idle stream on the same thread adopts still-running and pending background tasks from the replaced stream so their completion can trigger a continuation turn.
Uses only the final answer of a run, preventing pre-tool text or earlier JSON drafts from failing validation or ending the run early.