chore(deps): update dependency @mastra/core to v1 - autoclosed #628
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^0.24.9→^1.0.0Release Notes
mastra-ai/mastra (@mastra/core)
v1.1.0Compare Source
Minor Changes
Restructured stored agents to use a thin metadata record with versioned configuration snapshots. (#12488)
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:
ownerIdtoauthorIdfor multi-tenant filteringmemoryfield type fromstringtoRecord<string, unknown>statusfield ('draft' | 'published') to agent recordsAdded dynamic agent management with CRUD operations and version tracking (#12038)
New Features:
Storage:
API:
Client SDK:
Usage Example:
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 unified Workspace API for agent filesystem access, code execution, and search capabilities. (#11986)
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:
Usage:
Added
statusfield tolistTracesresponse. The status field indicates the trace state:success(completed without error),error(has error), orrunning(still in progress). This makes it easier to filter and display traces by their current state without having to derive it from theerrorandendedAtfields. (#12213)Added
RequestContext.allto access the entireRequestContextobject values. (#12259)Added
requestContextSchemasupport to tools, agents, workflows, and steps. Define a Zod schema to validate and type requestContext values at runtime.Tool example:
Agent example:
Workflow example:
When requestContextSchema is defined, validation runs automatically and throws an error if required context values are missing or invalid.
Patch Changes
dependencies updates: (#10184)
@isaacs/ttlcache@^2.1.4↗︎ (from^1.4.1, independencies)Update provider registry and model documentation with latest models and providers (
1cf5d2e)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. (#12485)
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 toopenai-compatible. Addcerebras,togetherai, anddeepinfraas native SDK providers. (#12450)Make suspendedToolRunId nullable to fix the null issue in tool input validation (#12303)
Fixed agent.network() to properly pass requestContext to workflow runs. Workflow execution now includes user metadata (userId, resourceId) for observability and analytics. (Fixes #12330) (#12379)
Fix ModelRouterLanguageModel to propagate supportedUrls from underlying model providers (#12167)
Previously,
ModelRouterLanguageModel(used when specifying models as strings like"mistral/mistral-large-latest"or"openai/gpt-4o") hadsupportedUrlshardcoded 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:
supportedUrlsto a lazyPromiseLikethat resolves the underlying model's supported URL patternsllm-execution-step.tsto properly awaitsupportedUrlswhen preparing messagesImpact:
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. (#12471)
Example:
fix(core): skip non-serializable values in RequestContext.toJSON (#12344)
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. (#12429)
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. Fixes #12281 (#12325)
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. (#12220)
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. (#12082)
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. (#12486)
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. (#12329)
Before (required wrapper):
After (direct usage):
Fixes #12293
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. (#12346)
Removed deprecated Google
text-embedding-004embedding model from the model router. Google shut down this model on January 14, 2026. Usegoogle/gemini-embedding-001instead. (#12433)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. (#12396)
Tracing fixes: (#12370)
Fixed generated provider types so IDs starting with digits no longer break TypeScript builds (#12418)
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. (#12074)
User-configured processors are now correctly passed to the routing agent, while memory-derived processors (which could interfere with routing logic) are excluded.
Fixes #12016
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. (#12425)
Update @isaacs/ttlcache to v2 and fix import for v2 compatibility (changed from default to named export) (#10184)
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'. (#12373)
Improve autoresume prompt sent to LLM to ensure gemini resumes well. (#12320)
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.
Fixed sub-agents in Agent Networks seeing completion-check feedback from prior iterations, so delegated agents stay focused on their task. Fixes #12224 (#12338)
Fix TypeScript types for custom API route handlers to include
requestContextin Hono context Variables. Previously, onlymastrawas typed, causing TypeScript errors when accessingc.get('requestContext')even though the runtime correctly provided this context. (#12419)Let callers cancel a running agent network call and handle abort callbacks. (#12351)
Example
Before:
After:
Related issue:
#12282v1.0.4Compare Source
v1.0.0Compare Source
Major Changes
Moving scorers under the eval domain, api method consistency, prebuilt evals, scorers require ids. (#9589)
Scorers for Agents will now use
MastraDBMessageinstead ofUIMessage(#9702)MastraDBMessage[]with nestedcontentobject structuregetTextContentFromMastraDBMessage()helper function to extract text content fromMastraDBMessageobjectscreateTestMessage()helper function for creatingMastraDBMessageobjects in tests with optional tool invocations supportextractToolCalls()to access tool invocations from nestedcontentstructuregetUserMessageFromRunInput()andgetAssistantMessageFromRunOutput()to use new message structurecreateUIMessage()Every Mastra primitive (agent, MCPServer, workflow, tool, processor, scorer, and vector) now has a get, list, and add method associated with it. Each primitive also now requires an id to be set. (#9675)
Primitives that are added to other primitives are also automatically added to the Mastra instance
Update handlers to use
listWorkflowRunsinstead ofgetWorkflowRuns. Fix type names fromStoragelistThreadsByResourceIdInput/OutputtoStorageListThreadsByResourceIdInput/Output. (#9507)Refactor workflow and tool types to remove Zod-specific constraints (#11814)
Removed Zod-specific type constraints across all workflow implementations and tool types, replacing them with generic types. This ensures type consistency across default, evented, and inngest workflows while preparing for Zod v4 migration.
Workflow Changes:
z.ZodObject<any>andz.ZodType<any>constraints from all workflow generic typesTInputandTStatedirectly instead ofz.infer<TInput>andz.infer<TState>TInput extends unknownpatternTStepsgeneric to properly useTEngineTypeinstead ofanyTool Changes:
ToolExecutionContextand related interfacesTSuspendSchema extends ZodLikeSchematoTSuspendandTResumeType Utilities:
This change maintains backward compatibility while improving type consistency and preparing for Zod v4 support across all affected packages.
Remove
getMessagesPaginated()and addperPage: falsesupport (#9670)Removes deprecated
getMessagesPaginated()method. ThelistMessages()API and score handlers now supportperPage: falseto fetch all records without pagination limits.Storage changes:
StoragePagination.perPagetype changed fromnumbertonumber | falseperPage: false:listMessages()listScoresBySpan(),listScoresByRunId(),listScoresByExecutionId()"false"string (e.g.,?perPage=false)Memory changes:
memory.query()parameter type changed fromStorageGetMessagesArgtoStorageListMessagesInputpage,perPage,include,filter,vectorSearchString) instead ofselectByobjectStricter validation:
listMessages()requires non-empty, non-whitespacethreadId(throws error instead of returning empty results)Migration:
Removed
storage.getMessages()(#9695)The
getMessages()method has been removed from all storage implementations. UselistMessages()instead, which provides pagination support.Migration:
Message ordering default
listMessages()defaults to ASC (oldest first) ordering bycreatedAt, matching the previousgetMessages()behavior.To use DESC ordering (newest first):
Renamed
client.getThreadMessages()→client.listThreadMessages()Migration:
The response format remains the same.
Removed
StorageGetMessagesArgtypeUse
StorageListMessagesInputinstead:9e1911d)outputoption has been removed entirely, in favour ofstructuredOutput.Method renames to clarify the API surface:
Bump minimum required Node.js version to 22.13.0 (#9706)
Replace
getThreadsByResourceIdPaginatedwithlistThreadsByResourceIdacross memory handlers. Update client SDK to uselistThreads()withoffset/limitparameters instead of deprecatedgetMemoryThreads(). Consolidate/api/memory/threadsroutes to single paginated endpoint. (#9508)Add new list methods to storage API:
listMessages,listMessagesById,listThreadsByResourceId, andlistWorkflowRuns. Most methods are currently wrappers around existing methods. Full implementations will be added when migrating away from legacy methods. (#9489)Update tool execution signature (#9587)
Consolidated the 3 different execution contexts to one
Before:
After:
The
@mastra/corepackage no longer allows top-level imports except forMastraandtype Config. You must use subpath imports for all other imports. (#9544)For example:
import { Mastra, type Config } from "@​mastra/core"; - import { Agent } from "@​mastra/core"; - import { createTool } from "@​mastra/core"; - import { createStep } from "@​mastra/core"; + import { Agent } from "@​mastra/core/agent"; + import { createTool } from "@​mastra/core/tools"; + import { createStep } from "@​mastra/core/workflows";This simplifies the Memory API by removing the confusing rememberMessages method and renaming query to recall for better clarity. (#9701)
The rememberMessages method name implied it might persist data when it was actually just retrieving messages, same as query. Having two methods that did essentially the same thing was unnecessary.
Before:
After:
All usages have been updated across the codebase including tests. The agent now calls recall directly with the appropriate parameters.
Rename RuntimeContext to RequestContext (#9511)
Implement listMessages API for replacing previous methods (#9531)
Rename
defaultVNextStreamOptionstodefaultOptions. Add "Legacy" suffix to v1 option properties and methods (defaultGenerateOptions→defaultGenerateOptionsLegacy,defaultStreamOptions→defaultStreamOptionsLegacy). (#9535)Breaking Change: Convert OUTPUT generic from
OutputSchemaconstraint to plain generic (#11741)This change removes the direct dependency on Zod typings in the public API by converting all
OUTPUT extends OutputSchemageneric constraints to plainOUTPUTgenerics throughout the codebase. This is preparation for moving to a standard schema approach.OutputSchema(e.g.,<OUTPUT extends OutputSchema = undefined>) are now plain generics with defaults (e.g.,<OUTPUT = undefined>)Agent,MastraModelOutput,AgentExecutionOptions, and stream/generate methodsInferSchemaOutput<OUTPUT>replaced withOUTPUTthroughoutPartialSchemaOutput<OUTPUT>replaced withPartial<OUTPUT>NonNullable<OutputSchema<OUTPUT>>instead ofOUTPUTdirectlyFullOutput<OUTPUT>type representing complete output with all fieldsAgentExecutionOptionsBase<OUTPUT>typegetFullOutput()method now returnsPromise<FullOutput<OUTPUT>>Agentclass now generic:Agent<TAgentId, TTools, TOutput>agent.generate()andagent.stream()methods have updated signaturesMastraModelOutput<OUTPUT>no longer requiresOutputSchemaconstraintBefore:
Remove
getThreadsByResourceIdandgetThreadsByResourceIdPaginatedmethods from storage interfaces in favor oflistThreadsByResourceId. The new method usesoffset/limitpagination and a nestedorderByobject structure ({ field, direction }). (#9536)Remove
getMessagesByIdmethod from storage interfaces in favor oflistMessagesById. The new method only returns V2-format messages and removes the format parameter, simplifying the API surface. Users should migrate fromgetMessagesById({ messageIds, format })tolistMessagesById({ messageIds }). (#9534)Experimental auth -> auth (#9660)
Renamed a bunch of observability/tracing-related things to drop the AI prefix. (#9744)
Removed MastraMessageV3 intermediary format, now we go from MastraDBMessage->aiv5 formats and back directly (#9094)
Breaking Change: Remove legacy v1 watch events and consolidate on v2 implementation. (#9252)
This change simplifies the workflow watching API by removing the legacy v1 event system and promoting v2 as the standard (renamed to just
watch).What's Changed
watch-v2towatchthroughout the codebase.watch()method from client-js SDK (WorkflowandAgentBuilderclasses)/watchHTTP endpoints from server and deployerWorkflowWatchResultand v1WatchEventtypesRemove various deprecated APIs from agent class. (#9257)
agent.llm→agent.getLLM()agent.tools→agent.getTools()agent.instructions→agent.getInstructions()agent.speak()→agent.voice.speak()agent.getSpeakers()→agent.voice.getSpeakers()agent.listen→agent.voice.listen()agent.fetchMemory→(await agent.getMemory()).query()agent.toStep→ Add agent directly to the step, workflows handle the transformationPagination APIs now use
page/perPageinstead ofoffset/limit(#9592)All storage and memory pagination APIs have been updated to use
page(0-indexed) andperPageinstead ofoffsetandlimit, aligning with standard REST API patterns.Affected APIs:
Memory.listThreadsByResourceId()Memory.listMessages()Storage.listWorkflowRuns()Migration:
Additional improvements:
pagevalues in all storage implementationsperPagevalidation to handle edge cases (negative values,0,false)Instead of:
Also renamed a bunch of:
Tracingthings toObservabilitythings.AI-things to just things.Changing getAgents -> listAgents, getTools -> listTools, getWorkflows -> listWorkflows (#9495)
Removed old tracing code based on OpenTelemetry (#9237)
Remove deprecated vector prompts and cohere provider from code (#9596)
Renamed MastraStorage to MastraCompositeStore for better clarity. The old MastraStorage name remains available as a deprecated alias for backward compatibility, but will be removed in a future version. (#12093)
Migration:
Update your imports and usage:
The new name better reflects that this is a composite storage implementation that routes different domains (workflows, traces, messages) to different underlying stores, avoiding confusion with the general "Mastra Storage" concept.
Mark as stable (
83d5942)Changed
.branch()result schema to make all branch output fields optional. (#10693)Breaking change: Branch outputs are now optional since only one branch executes at runtime. Update your workflow schemas to handle optional branch results.
Before:
After:
Why: Branch conditionals execute only one path, so non-executed branches don't produce outputs. The type system now correctly reflects this runtime behavior.
Related issue: #10642
Enforcing id required on Processor primitive (#9591)
Breaking Changes: (#9045)
generateTitlefromthreads.generateTitleto top-level memory optiontruetofalsethreads.generateTitlenow throws an errorMigration:
Replace
threads: { generateTitle: true }withgenerateTitle: trueat the top level of memory options.Playground:
The playground UI now displays thread IDs instead of "Chat from" when titles aren't generated.
Renamed
MastraMessageV2toMastraDBMessage(#9255)Made the return format of all methods that return db messages consistent. It's always
{ messages: MastraDBMessage[] }now, and messages can be converted after that using@mastra/ai-sdk/ui'stoAISdkV4/5Messages()functionmoved ai-tracing code into @mastra/observability (#9661)
Remove legacy evals from Mastra (#9491)
Use tool's outputSchema to validate results and return an error object if schema does not match output results. (#9664)
When validation fails, the tool returns a
ValidationError:Removes deprecated input-processor type and processors. (#9200)
Minor Changes
Add context parameter to
idGeneratorto enable deterministic ID generation based on context. (#10964)The
idGeneratorfunction now receives optional context about what type of ID is being generated and from which Mastra primitive. This allows generating IDs that can be shared with external databases.Existing
idGeneratorfunctions without parameters continue to work since the context is optional.Fixes #8131
Added
flush()method toObservabilityExporter,ObservabilityBridge, andObservabilityInstanceinterfaces (#12003)Add
hideInputandhideOutputoptions toTracingOptionsfor protecting sensitive data in traces. (#11969)When set to
true, these options hide input/output data from all spans in a trace, including child spans. This is useful for protecting sensitive information from being logged to observability platforms.The options can be used independently (hide only input or only output) or together. The settings are propagated to all child spans via
TraceState, ensuring consistent behavior across the entire trace.Fixes #10888
Add
onErrorhook to server configuration for custom error handling. (#11403)You can now provide a custom error handler through the Mastra server config to catch errors, format responses, or send them to external services like Sentry:
If no
onErroris provided, the default error handler is used.Fixes #9610
Add stored agents support (#10953)
Agents can now be stored in the database and loaded at runtime. This lets you persist agent configurations and dynamically create executable Agent instances from storage.
Also adds a memory registry to Mastra so stored agents can reference memory instances by key.
Added human-in-the-loop (HITL) tool approval support for
generate()method. (#12056)Why: This provides parity between
stream()andgenerate()for tool approval flows, allowing non-streaming use cases to leveragerequireToolApprovalwithout needing to switch to streaming.Previously, tool approval with
requireToolApprovalonly worked withstream(). Now you can use the same approval flow withgenerate()for non-streaming use cases.Using tool approval with generate()
Declining a tool call
New methods added:
agent.approveToolCallGenerate({ runId, toolCallId })- Approves a pending tool call and returns the complete resultagent.declineToolCallGenerate({ runId, toolCallId })- Declines a pending tool call and returns the complete resultServer routes added:
POST /api/agents/:agentId/approve-tool-call-generatePOST /api/agents/:agentId/decline-tool-call-generateThe playground UI now also supports tool approval when using generate mode.
Memory system now uses processors. Memory processors (
MessageHistory,SemanticRecall,WorkingMemory) are now exported from@mastra/memory/processorsand automatically added to the agent pipeline based on your memory config. Core processors (ToolCallFilter,TokenLimiter) remain in@mastra/core/processors. (#9254)Add reserved keys in RequestContext for secure resourceId/threadId setting from middleware (#10657)
This allows middleware to securely set
resourceIdandthreadIdvia reserved keys in RequestContext (MASTRA_RESOURCE_ID_KEYandMASTRA_THREAD_ID_KEY), which take precedence over client-provided values for security.Removed the deprecated
AISDKV5OutputStreamclass from the public API. (#11845)What changed: The
AISDKV5OutputStreamclass is no longer exported from@mastra/core. This class was previously used with theformat: 'aisdk'option, which has already been removed from.stream()and.generate()methods.Who is affected: Only users who were directly importing
AISDKV5OutputStreamfrom@mastra/core. If you were using the standard.stream()or.generate()methods without theformatoption, no changes are needed.Migration: If you were importing this class directly, switch to using
MastraModelOutputwhich provides the same streaming functionality:Changed JSON columns from TEXT to JSONB in
mastra_threadsandmastra_workflow_snapshottables. (#11853)Why this change?
These were the last remaining columns storing JSON as TEXT. This change aligns them with other tables that already use JSONB, enabling native JSON operators and improved performance. See #8978 for details.
Columns Changed:
mastra_threads.metadata- Thread metadatamastra_workflow_snapshot.snapshot- Workflow run statePostgreSQL
Migration Required - PostgreSQL enforces column types, so existing tables must be migrated. Note: Migration will fail if existing column values contain invalid JSON.
LibSQL
No Migration Required - LibSQL now uses native SQLite JSONB format (added in SQLite 3.45) for ~3x performance improvement on JSON operations. The changes are fully backwards compatible:
json_extract, etc.) work on both formatsNew installations automatically use JSONB. Existing applications continue to work without any changes.
Memory scope defaults changed from 'thread' to 'resource' (#8983)
Both
workingMemory.scopeandsemanticRecall.scopenow default to'resource'instead of'thread'. This means:Migration: To maintain the previous thread-scoped behavior, explicitly set
scope: 'thread':Also fixed issues where playground semantic recall search could show missing or incorrect results in certain cases.
Add support for AI SDK v6 (LanguageModelV3) (#11191)
Agents can now use
LanguageModelV3models from AI SDK v6 beta providers like@ai-sdk/openai@^3.0.0-beta.New features:
reasoningTokens,cachedInputTokens, and raw data preserved in arawfieldBackward compatible: All existing V1 and V2 models continue to work unchanged.
Respect structured outputs for v2 models so tool schemas aren’t stripped (#11038)
Deprecate
default: { enabled: true }observability configuration (#11674)The shorthand
default: { enabled: true }configuration is now deprecated and will be removed in a future version. Users should migrate to explicit configuration withDefaultExporter,CloudExporter, andSensitiveDataFilter.Before (deprecated):
After (recommended):
The explicit configuration makes it clear exactly what exporters and processors are being used, improving code readability and maintainability.
A deprecation warning will be logged when using the old configuration pattern.
Exported
isProcessorWorkflowfunction from @mastra/core/processors. AddedgetConfiguredProcessorWorkflows()method to agents andlistProcessors()method to the Mastra class for programmatic access to processor information. (#12059)Adds a new
suspendDataparameter to workflow step execute functions that provides access to the data originally passed tosuspend()when the step was suspended. This enables steps to access context about why they were suspended when they are later resumed. (#10734)New Features:
suspendDataparameter automatically populated in step execute function when resumingsuspendSchemaExample:
Configuration
📅 Schedule: Branch creation - "every weekday" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.