December 24, 2025
Changelog
@mastra/core@1.0.0-beta.17
Patch Changes
-
Fix Zod 4 compatibility for storage schema detection (#11431)
If you're using Zod 4,
buildStorageSchemawas failing to detect nullable and optional fields correctly. This causedNOT NULL constraint failederrors when storing observability spans and other data.This fix enables proper schema detection for Zod 4 users, ensuring nullable fields like
parentSpanIdare correctly identified and don't cause database constraint violations.
@mastra/schema-compat@1.0.0-beta.4
Patch Changes
-
Fix OpenAI structured output compatibility for fields with
.default()values (#11434)When using Zod schemas with
.default()fields (e.g.,z.number().default(1)), OpenAI's structured output API was failing with errors likeMissing '<field>' in required. This happened becausezod-to-json-schemadoesn't include fields with defaults in therequiredarray, but OpenAI requires all properties to be required.This fix converts
.default()fields to.nullable()with a transform that returns the default value whennullis received, ensuring compatibility with OpenAI's strict mode while preserving the original default value semantics.
Full Changelog: 4cbe850