github mastra-ai/mastra @mastra/core@0.23.3
2025-10-28

one day ago

Highlights

Tool Schema Validation

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()).

Changelog

@mastra/ai-sdk

  • Fix usage tracking with agent network (#9226)

@mastra/arize

  • 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)

@mastra/braintrust

  • Fixed import isssues in exporters. (#9331)

@mastra/core

  • 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 iteration counter in network loop that was stuck at 0 due to falsy check. Properly handled zero values to ensure maxSteps is correctly enforced.
  • 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/deployer

  • Add exportConditions options to nodeResolve plugin to ensure proper handling of Node.js export condition resolution during production builds. (#9394)
  • Add better error handling during mastra build for ERR_MODULE_NOT_FOUND cases. (#9127)

@mastra/deployer-netlify

  • Do not apply ESM shim to output as Netlify should handle this already (#9239)

@mastra/inngest

  • Fix Inngest workflow tests by adding missing imports and updating middleware path. (#9259)

@mastra/lance

  • Fix eval filtering to use NULL checks instead of length function for compatibility with LanceDB 0.22.x (#9191)

@mastra/langfuse

  • Fixed import isssues in exporters. (#9331)

@mastra/langsmith

  • Fixed import isssues in exporters. (#9331)

@mastra/mssql

  • Implemented AI tracing and observability features

    • Added createAISpan, updateAISpan, getAITrace, getAITracesPaginated
  • Added batchCreateAISpans, batchUpdateAISpans, batchDeleteAITraces

  • Automatic performance indexes for AI spans

    Implemented workflow update methods

    • Added updateWorkflowResults with row-level locking (UPDLOCK, HOLDLOCK)
  • Added updateWorkflowState with row-level locking

  • Concurrent update protection for parallel workflow execution

    Added index management API

    • Added createIndex, listIndexes, describeIndex, dropIndex methods
  • Exposed index management methods directly on store instance

  • Support for composite indexes, unique constraints, and filtered indexes

    Documentation improvements

    • Comprehensive README with complete API reference (58 methods)
  • Detailed feature descriptions for all storage capabilities

  • Index management examples and best practices

  • Updated to reflect all atomic transaction usage (#9280)

@mastra/observability

  • Fixed import isssues in exporters. (#9331)

@mastra/otel-exporter

  • Fixed import isssues in exporters. (#9331)

@mastra/playground-ui

  • Update MainSidebar component to fit required changes in Cloud CTA link (#9318)
  • Render zod unions and discriminated unions correctly in dynamic form. (#9317)
  • Extract more components to playground-ui for sharing with cloud (#9241)
  • Move some components to playground-ui for usage in cloud (#9177)

@mastra/schema-compat

  • 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)

create-mastra

  • Update MainSidebar component to fit required changes in Cloud CTA link (#9318)

mastra

  • Use dynamic model for scorers in create cli (#9188)
  • Update MainSidebar component to fit required changes in Cloud CTA link (#9318)
  • Better handle errors during mastra start and throw them with Mastra's logger. Also add special error handling for ERR_MODULE_NOT_FOUND cases. (#9127)
  • Make sure that mastra init also installs the mastra CLI package (if not already installed) (#9179)

Don't miss a new mastra release

NewReleases is sending notifications on new releases.