2025-10-28
Fixed a critical bug in @mastra/core where tool input validation used the original Zod schema while LLMs received a transformed version. This caused validation failures with models like OpenAI o3 and Claude 3.5 Haiku that send valid responses matching the transformed schema (e.g., converting .optional() to .nullable()).
Fixed import isssues in exporters. (#9331)
fix(@mastra/arize): Auto-detect arize endpoint when endpoint field is not provided
When spaceId is provided to ArizeExporter constructor, and endpoint is not, pre-populate endpoint with default ArizeAX endpoint. (#9250)
Fix agent onChunk callback receiving wrapped chunk instead of direct chunk (#9402)
Ensure model_generation spans end before agent_run spans. (#9393)
Fix OpenAI schema validation errors in processors (#9400)
Don't call os.homedir() at top level (but lazy invoke it) to accommodate sandboxed environments (#9211)
Detect thenable objects returned by AI model providers (#8905)
Bug fix: Use input processors that are passed in generate or stream agent options rather than always defaulting to the processors set on the Agent class. (#9407)
Fix tool input validation to use schema-compat transformed schemas
Previously, tool input validation used the original Zod schema while the LLM received a schema-compat transformed version. This caused validation failures when LLMs (like OpenAI o3 or Claude 3.5 Haiku) sent arguments matching the transformed schema but not the original.
For example:
OpenAI o3 reasoning models convert .optional() to .nullable(), sending null values
Claude 3.5 Haiku strips min/max string constraints, sending shorter strings
Validation would reject these valid responses because it checked against the original schema
The fix ensures validation uses the same schema-compat processed schema that was sent to the LLM, eliminating this mismatch. (#9258)
Add import for WritableStream in execution-engine and dedupe llm.getModel in agent.ts (#9185)
pass writableStream parameter to workflow execution (#9139)
Save correct status in snapshot for all workflow parallel steps.
This ensures when you poll workflow run result using getWorkflowRunExecutionResult(runId), you get the right status for all parallel steps (#9379)
Add ability to pass agent options when wrapping an agent with createStep. This allows configuring agent execution settings when using agents as workflow steps. (#9199)
Fix network loop iteration counter and usage promise handling:
Fixed usage promise resolution in RunOutput stream by properly resolving or rejecting the promise on stream close, preventing hanging promises when streams complete. (#9408)
Workflow validation zod v4 support (#9319)
Fix usage tracking with agent network (#9226)
mastra build for ERR_MODULE_NOT_FOUND cases. (#9127)Implemented AI tracing and observability features
Added batchCreateAISpans, batchUpdateAISpans, batchDeleteAITraces
Automatic performance indexes for AI spans
Implemented workflow update methods
Added updateWorkflowState with row-level locking
Concurrent update protection for parallel workflow execution
Added index management API
Exposed index management methods directly on store instance
Support for composite indexes, unique constraints, and filtered indexes
Documentation improvements
Detailed feature descriptions for all storage capabilities
Index management examples and best practices
Updated to reflect all atomic transaction usage (#9280)
Fix Zod v4 toJSONSchema bug with z.record() single-argument form
Zod v4 has a bug in the single-argument form of z.record(valueSchema) where it incorrectly assigns the value schema to keyType instead of valueType, leaving valueType undefined. This causes toJSONSchema() to throw "Cannot read properties of undefined (reading '_zod')" when processing schemas containing z.record() fields.
This fix patches affected schemas before conversion by detecting records with missing valueType and correctly assigning the schema to valueType while setting keyType to z.string() (the default). The patch recursively handles nested schemas including those wrapped in .optional(), .nullable(), arrays, unions, and objects. (#9265)
Improved reliability of string field types in tool schema compatibility (#9266)
mastra start and throw them with Mastra's logger. Also add special error handling for ERR_MODULE_NOT_FOUND cases. (#9127)mastra init also installs the mastra CLI package (if not already installed) (#9179)Fetched April 7, 2026