0
Fork 0
mirror of https://github.com/mastra-ai/mastra.git synced 2026-11-17 08:44:46 +00:00
Commit graph

291 commits

Author SHA1 Message Date
dane-ai-mastra[bot]
d60ba71be0 chore: version - exit prerelease mode 2026-11-12 21:12:29 +00:00
dane-ai-mastra[bot]
5c87442ed7
chore: version packages (alpha) (#30203)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`main` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `main`.

⚠️⚠️⚠️⚠️⚠️⚠️

# Releases

> The changelog information of each package has been omitted from this
message, as the content exceeds the size limit.

## @mastra/auth-auth0@1.3.0-alpha.0


## @mastra/auth-clerk@1.4.0-alpha.0


## @mastra/auth-okta@0.3.0-alpha.0


## @mastra/auth-supabase@1.2.0-alpha.0


## @mastra/client-js@1.60.0-alpha.13


## @mastra/auth@1.2.0-alpha.0


## @mastra/core@1.83.0-alpha.13


## @mastra/playground-ui@69.0.0-alpha.15


## @mastra/rag@2.8.0-alpha.3


## @mastra/server@1.83.0-alpha.13


## @mastra/server-adapters-test-suite@0.3.0-alpha.5


## @mastra/auth-better-auth@1.1.11-alpha.2


## @mastra/auth-cloud@1.2.9-alpha.0


## @mastra/auth-neon@0.3.6-alpha.1


## @mastra/auth-workos@1.6.9-alpha.0


## @mastra/discord@1.3.4-alpha.0


## @mastra/react@1.15.0-alpha.13


## @mastra/deployer-cloud@1.83.0-alpha.13


## @mastra/deployer-cloudflare@1.2.42-alpha.3


## @mastra/deployer-netlify@1.2.42-alpha.1


## @mastra/deployer-sandbox@0.3.27-alpha.1


## @mastra/deployer-vercel@1.2.42-alpha.1


## @mastra/longmemeval@1.1.42-alpha.13


## @mastra/opencode@0.1.42-alpha.13


## @mastra/factory@0.28.0-alpha.15


## create-factory@0.4.3-alpha.15


## @mastra/code-sdk@1.19.0-alpha.15


## mastracode@0.50.0-alpha.14


## @mastra/agent-builder@1.2.1-alpha.5


## mastra@1.39.0-alpha.15


## @mastra/connect@1.4.0-alpha.6


## @mastra/deployer@1.83.0-alpha.13


## @mastra/editor@0.17.1-alpha.7


## @mastra/mcp@2.9.0-alpha.5


## @mastra/mcp-docs-server@1.3.13-alpha.17


## @mastra/memory@1.41.1-alpha.5


## @mastra/schema-compat@1.4.0-alpha.2


## @mastra/elysia@0.1.23-alpha.13


## @mastra/express@1.5.27-alpha.13


## @mastra/fastify@1.5.27-alpha.13


## @mastra/hono@1.7.25-alpha.13


## @mastra/koa@1.7.27-alpha.13


## @mastra/nestjs@0.3.0-alpha.13


## @mastra/next@0.2.41-alpha.13


## @mastra/tanstack-start@0.2.41-alpha.13


## @mastra/voice-google-gemini-live@0.14.19-alpha.2


## @mastra/voice-openai-realtime@0.14.9-alpha.3


## @mastra/voice-xai-realtime@0.2.18-alpha.2


## @mastra/inngest@1.11.2-alpha.9


## @mastra/temporal@0.6.0-alpha.13


## create-mastra@1.39.0-alpha.15


## @internal/playground@1.39.0-alpha.15

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-12 12:07:03 -08:00
mastra-platform[bot]
e1a20364af
Fix OpenAPI request schemas for defaulted and transformed fields (#30187)
## Summary
- Generate request path, query, and body JSON Schemas from input types
while retaining output types for responses.
- Pass input/output mode through the Zod v4 adapter to represent
defaults and transformations accurately.
- Add regressions for OpenAPI documents, API schema manifests, and Zod
v4 conversion, plus patch changesets for both packages.

## Test plan
- `pnpm exec vitest run` in `packages/schema-compat` (1089 passed, 9
skipped)
- `pnpm exec vitest run` in `packages/server` (3406 passed, 3 skipped, 1
todo)
- `pnpm exec tsc --noEmit -p tsconfig.json` in both packages
- `pnpm exec oxlint --type-aware` on modified files; `pnpm exec prettier
--check` on modified files

Fixes #30050

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

**ELI5:** Mastra builds an API document that tells client programs what
data to send. Before this change, the document described the cleaned-up
data the server produces, not the data the client sends. This change
makes the document describe what clients send for requests, and keeps
the cleaned-up form for responses.

## Summary

This pull request changes how OpenAPI documents describe request and
response schemas for Zod schemas. It addresses issue `#30050`.

### Problem

The OpenAPI conversion used the Zod output side for all schemas. Request
data needs the input side. This caused two errors:

- Fields with `.default()` appeared as required in request bodies.
- Parameters with `.transform()` appeared as `{}` in path and query
schemas.

On Zod versions before 4.2, and through the 3.25 v4 compatibility layer,
the `@mastra/schema-compat` Zod v4 adapter also dropped the input/output
mode.

### Changes

- **`packages/server/src/server/server-adapter/openapi-utils.ts`:**
`schemaToJsonSchema` accepts an optional `io` argument (`'input' |
'output'`, default `'output'`) and passes it to
`standardSchemaToJSONSchema`. Path parameters, query parameters, and
request bodies use `'input'`. Response schemas keep the default
`'output'`.
-
**`packages/server/src/server/server-adapter/api-schema-manifest.ts`:**
`convertSchema` accepts a direction and passes it to
`schemaToJsonSchema`. The manifest builder converts response schemas as
output. It converts path, query, and body schemas as input.
- **`packages/schema-compat/src/standard-schema/adapters/zod-v4.ts`:**
`convertToJsonSchema` accepts a direction and passes it to Zod's
`toJSONSchema` options. The `input` converter uses `'input'`. The
`output` converter uses `'output'`.
- **Generated CLI schemas:**
`packages/cli/src/commands/api/feedback-score-schemas.generated.ts` and
`route-metadata.generated.ts` are regenerated to match the OpenAPI
request-schema change.
- **Changeset:** Adds patch releases for `@mastra/schema-compat` and
`@mastra/server`.

### Tests

- `openapi-utils.test.ts`: Adds a test for a `createRoute` POST route.
It checks that transformed path and query inputs use string schemas,
that the defaulted query parameter is optional, and that only
non-defaulted body and response fields are required.
- `api-schema-manifest.test.ts`: Adds a test that checks property
schemas and required fields for path, query, body, and response schemas
with defaults and transforms.
- `zod-v4.test.ts`: Changes the input/output comparison. It now checks
that properties and required fields match for a schema without defaults
or transforms. It adds a test for a defaulted, transformed field through
the routed adapter.

### Scope

- 9 files changed, 155 lines added, 62 lines removed (from `git diff
--stat` against the merge base).
- Two of the nine files are generated CLI schema files.
- No exported declarations changed except the `schemaToJsonSchema`
signature, which gained an optional parameter.

### Verification

The PR objectives report these local checks by the author:
`schema-compat` and `server` Vitest runs, `tsc --noEmit` in both
packages, and `oxlint` and `prettier --check` on modified files. These
results come from the PR description. CI results on the current head are
not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: mastra-platform[bot] <mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-12 06:33:48 -08:00
dane-ai-mastra[bot]
9e82af0237
chore: version packages (alpha) (#30074)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-11 14:21:14 -08:00
mastra-platform[bot]
056d35d943
Enforce JSON Schema formats in MCP tool validation (#30113) 2026-11-11 14:16:55 -08:00
dane-ai-mastra[bot]
23cc34a9c5
chore: version packages (alpha) (#29938)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`main` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `main`.

⚠️⚠️⚠️⚠️⚠️⚠️

# Releases

> The changelog information of each package has been omitted from this
message, as the content exceeds the size limit.

## @mastra/factory@0.28.0-alpha.6


## @mastra/code-sdk@1.19.0-alpha.6


## @mastra/playground-ui@69.0.0-alpha.7


## @mastra/client-js@1.60.0-alpha.6


## @mastra/react@1.15.0-alpha.6


## @mastra/deployer-cloud@1.83.0-alpha.6


## @mastra/longmemeval@1.1.42-alpha.6


## @mastra/opencode@0.1.42-alpha.6


## create-factory@0.4.3-alpha.6


## mastracode@0.50.0-alpha.6


## @mastra/agent-builder@1.2.1-alpha.3


## mastra@1.39.0-alpha.6


## @mastra/core@1.83.0-alpha.6


## @mastra/deployer@1.83.0-alpha.6


## @mastra/editor@0.17.1-alpha.4


## @mastra/mcp@2.9.0-alpha.3


## @mastra/mcp-docs-server@1.3.13-alpha.9


## @mastra/memory@1.41.1-alpha.3


## @mastra/rag@2.7.3-alpha.2


## @mastra/schema-compat@1.3.18-alpha.0


## @mastra/server@1.83.0-alpha.6


## @mastra/elysia@0.1.23-alpha.6


## @mastra/express@1.5.27-alpha.6


## @mastra/fastify@1.5.27-alpha.6


## @mastra/hono@1.7.25-alpha.6


## @mastra/koa@1.7.27-alpha.6


## @mastra/nestjs@0.3.0-alpha.6


## @mastra/next@0.2.41-alpha.6


## @mastra/server-adapters-test-suite@0.3.0-alpha.3


## @mastra/tanstack-start@0.2.41-alpha.6


## @mastra/upstash@1.6.1-alpha.0


## @mastra/vectorize@1.1.5-alpha.0


## @mastra/voice-google-gemini-live@0.14.19-alpha.0


## @mastra/voice-openai-realtime@0.14.9-alpha.0


## @mastra/voice-xai-realtime@0.2.18-alpha.0


## @mastra/inngest@1.11.2-alpha.4


## @mastra/temporal@0.6.0-alpha.6


## create-mastra@1.39.0-alpha.6


## @internal/playground@1.39.0-alpha.6

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-10 15:51:29 -08:00
Leo
04803ea00e
fix(schema-compat): send Gemini-valid enums for numeric, boolean and empty-string literals (#29416)
## Summary

A tool whose input schema has a numeric, boolean or empty-string literal
(`z.literal(1)`, `z.literal(true)`, `z.union([z.string(),
z.literal('')])`) makes every Gemini request from that agent fail with
HTTP 400. `GoogleSchemaCompatLayer.postProcessJSONNode` rewrites each
`const` into `enum: [const]` and passes other enums through, but Gemini
only accepts `enum` as non-empty strings on a string node. This PR
normalizes enums in `@mastra/schema-compat`'s Google layer right after
that rewrite. Both the `processToCompatSchema` / `applyCompatLayer` path
that tools use and the `processToAISDKSchema` path go through it.

```diff
 postProcessJSONNode (packages/schema-compat/src/provider-compats/google.ts)
   const: v  ->  enum: [v]
+  toGeminiEnum(node)
+    string enum on a string (or untyped) node -> keep it, type: 'string'; a null value -> nullable: true
+    anything else -> drop enum, keep or infer type (boolean / string / integer / number,
+                     anyOf when mixed), append "Must be 1." / "Must be one of: 1, 2." to description
   nullable anyOf collapse
+    when either side carries that note, keep the parent description in front of it
```

Tool-call arguments are still validated against the original schema, so
this changes only what is sent to Gemini, not which inputs are accepted.

## Evidence

The issue's reproduction snippet, run against the package source:

- **Before** (main):
  ```json

{"type":"object","properties":{"v":{"type":"number","enum":[1]}},"required":["v"]}

{"type":"object","properties":{"flag":{"type":"boolean","enum":[true]}},"required":["flag"]}

{"type":"object","properties":{"x":{"anyOf":[{"type":"string"},{"type":"string","enum":[""]}]}},"required":["x"]}
  ```
  **After:**
  ```json
{"type":"object","properties":{"v":{"type":"number","description":"Must
be 1."}},"required":["v"]}

{"type":"object","properties":{"flag":{"type":"boolean","description":"Must
be true."}},"required":["flag"]}

{"type":"object","properties":{"x":{"anyOf":[{"type":"string"},{"type":"string","description":"Must
be \"\"."}]}},"required":["x"]}
  ```

The new test file
`packages/schema-compat/src/provider-compats/google-literal-enums.test.ts`
runs the real layer through `applyCompatLayer`, `processToAISDKSchema`
and `processToCompatSchema`, with no mocks. Every case walks the output
and fails on any `const`, any enum value that isn't a non-empty string,
or any enum on a node that isn't `type: 'string'`. It covers the three
cases from the issue; a nullable mixed union of `z.enum` and a numeric
literal; `z.literal(['a', 'b', null])`; `z.literal(null)`; mixed
`z.literal([1, 'a'])`; external JSON Schema with typeless or integer
enums; descriptions on literals, nullable and doubly nullable wrappers;
zod v3; and validation of the original literal values.

- **Before** (main's `google.ts` swapped in): `Tests 15 failed | 3
passed (18)`. The 3 that pass check behaviour that must not change:
valid string enums are untouched, ordinary nullable descriptions are
untouched, and arguments are still validated.
  **After:** `Tests  18 passed (18)`.

Other checks: the rest of the package's unit suites, including
`google.test.ts` and the #25086 / #17179 nullable-enum tests, pass
(`1044 passed | 9 skipped`); `tsc --noEmit`, `oxlint --type-aware
--deny-warnings`, `oxfmt` and prettier are clean.

Not checked: a live Gemini request (no API key here). Also not run
locally: the CommonJS `dist` tests, which need a package build that this
machine's Node can't run (tsdown can't load its `.ts` config); CI builds
and runs them. `z.literal(null)` alone still emits `type: 'null'`, as
main does: the node keeps that type so a parent `anyOf` can recognise
and drop it.

## Merge Danger

**Door:** two-way. Only the JSON Schema sent to Google models changes;
nothing is stored or published, and a revert restores the old output.

**Blast radius:** tools and structured output sent to Gemini through
`GoogleSchemaCompatLayer`. Schemas without non-string or empty enums
produce the same output as before, except that an external JSON Schema
enum with no `type` now gets `type: "string"`. If the new shape were
wrong, Gemini requests that fail today with HTTP 400 would keep failing.

Closes #29167

## Follow-ups

- On the `processToAISDKSchema` path, `fixAISDKNullableUnionTypes` still
drops `nullable` from `anyOf` nodes. An existing test in
`google.test.ts` (from #16129) asserts that behaviour, so this PR leaves
it alone.
- A live Gemini check that it accepts a standalone `{ "type": "null",
"nullable": true }` property.

## Council review

Rounds: 6

| Seat | Round 1 | Round 2 | Round 3 | Round 4 | Round 5 | Round 6 |
| --- | --- | --- | --- | --- | --- | --- |
| GPT-6.1 Sol | 7 / 8 / 10 / 9 | 9 / 9 / 10 / 10 | 9 / 10 / 10 / 10 | 8
/ 9 / 10 / 8 | 8 / 9 / 10 / 9 | 9.5 / 10 / 10 / 9.5 |
| Claude Opus 5.5 | not run | not run | 8 / 9 / 8 / 9 | 9 / 9 / 10 / 8 |
9 / 9 / 10 / 9 | 9 / 9 / 10 / 9 |
| Grok 4.7 | empty seat | empty seat | empty seat | empty seat | empty
seat | empty seat |

Scores are Correctness / Tests / Scope / Code quality.

Created with Claude Opus 5.5 in T3 Code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## ELI5

Gemini only accepts certain kinds of allowed-value lists. This change
converts other literal values into descriptions so Gemini can read the
tool schemas, while Mastra still checks tool arguments against the
original schema.

## Changes

- Keep enums only when all values are non-empty strings and the schema
node is string-typed. Represent `null` with `nullable: true` where
applicable.
- For other enum values, remove the enum, preserve or infer the schema
type, and add the allowed values to the description.
- Preserve parent descriptions when nullable `anyOf` schemas collapse.
- Add tests for Zod v3 and v4, external JSON Schema, the compatibility
and AI SDK paths, and validation against original schemas.
- Add a changeset for `@mastra/schema-compat`.

## Verification

The PR description reports 18 new tests passing, 1044 package tests
passing, and 9 skipped. It also reports clean TypeScript, Oxlint,
formatting, and Prettier checks. A live Gemini request was not checked.
Local CommonJS `dist` tests were not run; the PR description says CI
builds and runs them.

The change does not address `fixAISDKNullableUnionTypes` dropping
`nullable` from `anyOf` on the `processToAISDKSchema` path. Testing a
standalone `{ "type": "null", "nullable": true }` schema remains a
follow-up.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:16:46 -05:00
Arthur Fiorette
3568a29203
test: unblock alpha publish CI (#29639) 2026-11-06 18:30:53 -03:00
Dane - AI (Mastra)
47a6cd82e5
chore(deps): update ai sdk (#29242)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-11-03 16:12:54 +01:00
Dane - AI (Mastra)
278ecceb2d
chore(deps): update ai sdk (#28928)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-10-30 17:19:19 +01:00
dane-ai-mastra[bot]
6a191d46dc chore: version - exit prerelease mode 2026-10-28 13:15:52 +00:00
Damien Schneider
976fde7416
refactor(lint): enable no-else-return at root (#28601)
Enables `no-else-return: error` in the root Oxlint config and removes
186 redundant `else` branches across 111 source/test files. Existing
rule defaults are retained.

Reviewed every code diff for behavior preservation. An independent
TypeScript AST comparison confirms that changes are limited to removing
`else` after returning branches, with the same expressions, statement
order, return values, and `try`/`catch`/`finally` boundaries. All
181,158 identifier occurrences retain their bindings. The recorder
replay path keeps an explicit block: flattening it would shadow the
earlier request `body` with the response `body` and introduce a
temporal-dead-zone error.

Extends the existing monorepo optimized-dependency test to assert that a
raw TypeScript workspace package, including its enum and transitive
dependency, still executes in the production bundle.

Validation: the root rule-only scan passes on 15,273 files with zero
diagnostics; formatting and `git diff --check` pass. Schema
compatibility tests: 1,060 passed, 9 skipped. Recorder runtime tests: 21
passed. The core selection initially passed 3,513 tests; rerunning the
suites requiring local server/cache access passed 185 tests, with one
remaining cache-file assertion also reproduced on unchanged `main`.

Remaining validation limits: four asset-download cases cannot reach
`placehold.co`; the changed-file lint run reports six import-order
errors reproduced on unchanged files from `main`. Deployer unit tests
and the monorepo test could not run because this checkout lacks required
package dependencies (`fs-extra`/workspace links and `get-port`,
respectively). These limits are left visible for CI. No changeset is
included because this is a behavior-preserving lint cleanup.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## ELI5
This PR makes the code easier to read by removing `else` branches that
are not needed after a return. It also enables a rule that catches those
branches and adds a test for loading a raw TypeScript workspace package
in a production bundle.

## Summary
- Enables Oxlint’s `no-else-return` rule at error severity and removes
186 redundant `else` branches across 111 files.
- Extends the monorepo optimized-dependencies test to check a raw
TypeScript workspace package, its enum, and a transitive dependency.
- Updates the deployer’s transpile-package path pattern.
- In workflow event processing, a truthy branch index with no matching
child now falls through to publish a skipped-step end event. Previously,
this case published no event.
- Keeps the recorder replay block explicit to avoid request/response
`body` shadowing and a temporal-dead-zone error.

## Validation
Reported checks passed: the rule-only scan across 15,273 files,
formatting, `git diff --check`, schema compatibility tests (1,060
passed, 9 skipped), recorder runtime tests (21 passed), and an initial
core test selection (3,513 passed).

Some test limits remain. Four asset-download cases could not reach
`placehold.co`. Changed-file lint reported six import-order errors that
also occur on unchanged files from `main`. Deployer unit tests and the
monorepo test could not run because dependencies were unavailable. On
rerun, suites requiring local server/cache access had 185 passes; one
cache-file assertion also reproduced on unchanged `main`.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-28 12:30:27 +01:00
dane-ai-mastra[bot]
2c646b53d0
chore: version packages (alpha) (#28399)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`main` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `main`.

⚠️⚠️⚠️⚠️⚠️⚠️

# Releases

> The changelog information of each package has been omitted from this
message, as the content exceeds the size limit.

## @mastra/factory@0.25.0-alpha.5


## @mastra/langsmith@1.4.0-alpha.2


## @mastra/connect@1.2.0-alpha.2


## @mastra/core@1.80.0-alpha.4


## @mastra/playground-ui@66.0.0-alpha.4


## @mastra/acp@0.4.4-alpha.0


## @mastra/claude@0.3.4-alpha.0


## @mastra/cursor@0.3.4-alpha.0


## @mastra/openai@1.1.4-alpha.0


## @mastra/auth-auth0@1.2.6-alpha.0


## @mastra/auth-better-auth@1.1.9-alpha.0


## @mastra/auth-clerk@1.3.2-alpha.0


## @mastra/auth-cloud@1.2.8-alpha.0


## @mastra/auth-firebase@1.1.5-alpha.0


## @mastra/auth-google@0.1.7-alpha.0


## @mastra/auth-neon@0.3.5-alpha.0


## @mastra/auth-okta@0.2.6-alpha.0


## @mastra/auth-studio@1.3.11-alpha.1


## @mastra/auth-supabase@1.1.6-alpha.0


## @mastra/auth-workos@1.6.8-alpha.0


## @mastra/agent-browser@0.5.5-alpha.0


## @mastra/browser-viewer@0.2.6-alpha.0


## @mastra/browser-firecrawl@0.2.5-alpha.1


## @mastra/stagehand@0.3.7-alpha.1


## @mastra/discord@1.3.2-alpha.0


## @mastra/slack@1.8.0-alpha.1


## @mastra/teams@0.1.3-alpha.0


## @mastra/telegram@0.2.4-alpha.0


## @mastra/client-js@1.57.0-alpha.4


## @mastra/react@1.13.0-alpha.4


## @mastra/isolated-vm@0.1.4-alpha.0


## @mastra/quickjs@0.1.5-alpha.0


## @mastra/deployer-cloud@1.80.0-alpha.4


## @mastra/deployer-cloudflare@1.2.39-alpha.1


## @mastra/deployer-netlify@1.2.39-alpha.1


## @mastra/deployer-sandbox@0.3.24-alpha.1


## @mastra/deployer-vercel@1.2.39-alpha.1


## @mastra/voyageai@0.4.3-alpha.0


## @mastra/longmemeval@1.1.39-alpha.4


## @mastra/livekit@0.5.2-alpha.0


## @mastra/opencode@0.1.39-alpha.4


## @mastra/parallel@0.1.4-alpha.0


## create-factory@0.3.1-alpha.4


## @mastra/code-sdk@1.15.1-alpha.5


## mastracode@0.48.1-alpha.4


## @mastra/arize@1.3.27-alpha.2


## @mastra/arthur@0.4.27-alpha.2


## @mastra/braintrust@1.3.24-alpha.2


## @mastra/datadog@1.4.19-alpha.2


## @mastra/deepeval@0.1.21-alpha.2


## @mastra/laminar@1.3.29-alpha.2


## @mastra/langfuse@1.6.3-alpha.2


## @mastra/observability@1.21.1-alpha.2


## @mastra/otel-bridge@1.5.19-alpha.2


## @mastra/otel-exporter@1.4.10-alpha.2


## @mastra/posthog@1.4.4-alpha.2


## @mastra/sentry@1.2.29-alpha.2


## @mastra/agent-builder@1.1.31-alpha.2


## @mastra/auth@1.1.5-alpha.0


## mastra@1.36.0-alpha.4


## @mastra/codemod@1.1.8-alpha.0


## create-mastra@1.36.0-alpha.4


## @mastra/deployer@1.80.0-alpha.4


## @mastra/editor@0.16.5-alpha.2


## @mastra/evals@1.10.9-alpha.0


## @mastra/fastembed@1.3.5-alpha.2


## @mastra/loggers@1.3.10-alpha.1


## @mastra/mcp@2.6.0-alpha.1


## @mastra/mcp-docs-server@1.3.10-alpha.7


## @mastra/mcp-registry-registry@1.1.7-alpha.0


## @mastra/memory@1.39.1-alpha.2


## @mastra/rag@2.7.1-alpha.0


## @mastra/schema-compat@1.3.17-alpha.0


## @mastra/server@1.80.0-alpha.4


## @mastra/google-cloud-pubsub@1.1.5-alpha.1


## @mastra/redis-streams@0.6.5-alpha.1


## @mastra/valkey-streams@0.5.7-alpha.1


## @mastra/elysia@0.1.20-alpha.4


## @mastra/express@1.5.24-alpha.4


## @mastra/fastify@1.5.24-alpha.4


## @mastra/hono@1.7.22-alpha.4


## @mastra/koa@1.7.24-alpha.4


## @mastra/nestjs@0.2.39-alpha.4


## @mastra/next@0.2.38-alpha.4


## @mastra/server-adapters-test-suite@0.1.4-alpha.2


## @mastra/tanstack-start@0.2.38-alpha.4


## @mastra/astra@1.1.3-alpha.0


## @mastra/azure-ai-search@0.1.2-alpha.1


## @mastra/chroma@1.1.5-alpha.0


## @mastra/clickhouse@1.27.0-alpha.1


## @mastra/cloudflare@1.7.6-alpha.0


## @mastra/cloudflare-d1@1.4.5-alpha.1


## @mastra/convex@1.7.6-alpha.0


## @mastra/couchbase@1.1.4-alpha.1


## @mastra/dsql@1.5.5-alpha.0


## @mastra/duckdb@1.16.0-alpha.1


## @mastra/dynamodb@1.4.5-alpha.1


## @mastra/elasticsearch@1.4.6-alpha.1


## @mastra/lance@1.5.2-alpha.1


## @mastra/libsql@1.27.1-alpha.0


## @mastra/mongodb@1.24.1-alpha.1


## @mastra/mssql@1.10.6-alpha.0


## @mastra/mysql@0.14.1-alpha.0


## @mastra/opensearch@1.1.4-alpha.1


## @mastra/oracledb@0.5.5-alpha.0


## @mastra/pg@1.33.0-alpha.2


## @mastra/pinecone@1.1.3-alpha.0


## @mastra/qdrant@1.1.6-alpha.0


## @mastra/redis@1.4.12-alpha.1


## @mastra/s3vectors@1.1.5-alpha.0


## @mastra/spanner@1.10.1-alpha.1


## @mastra/turbopuffer@1.2.3-alpha.0


## @mastra/turso@0.1.18-alpha.0


## @mastra/upstash@1.5.5-alpha.1


## @mastra/valkey@0.2.8-alpha.1


## @mastra/vectorize@1.1.4-alpha.0


## @mastra/weaviate@0.1.4-alpha.0


## @mastra/voice-aws-nova-sonic@0.2.6-alpha.0


## @mastra/voice-azure@0.12.3-alpha.0


## @mastra/voice-cloudflare@0.13.4-alpha.0


## @mastra/voice-deepgram@0.13.3-alpha.0


## @mastra/voice-elevenlabs@0.13.3-alpha.0


## @mastra/voice-gladia@0.13.3-alpha.0


## @mastra/voice-google@0.14.4-alpha.0


## @mastra/voice-google-gemini-live@0.14.18-alpha.0


## @mastra/voice-inworld@0.4.6-alpha.0


## @mastra/voice-mistral@0.1.3-alpha.0


## @mastra/voice-modelslab@0.2.3-alpha.0


## @mastra/voice-murf@0.13.3-alpha.0


## @mastra/voice-openai@0.13.4-alpha.0


## @mastra/voice-openai-realtime@0.14.8-alpha.0


## @mastra/voice-playai@0.13.3-alpha.0


## @mastra/voice-sarvam@1.1.4-alpha.0


## @mastra/voice-speechify@0.14.3-alpha.0


## @mastra/voice-xai-realtime@0.2.17-alpha.0


## @mastra/inngest@1.10.8-alpha.3


## @mastra/temporal@0.4.18-alpha.4


## @mastra/agentcore@0.5.3-alpha.0


## @mastra/agentfs@0.2.3-alpha.0


## @mastra/apple-container@0.5.2-alpha.0


## @mastra/archil@0.3.2-alpha.0


## @mastra/azure@0.3.3-alpha.1


## @mastra/blaxel@0.10.2-alpha.0


## @mastra/cloudflare-sandbox@0.5.4-alpha.0


## @mastra/daytona@0.11.4-alpha.0


## @mastra/docker@0.12.1-alpha.0


## @mastra/e2b@0.15.1-alpha.1


## @mastra/e2b-desktop@0.1.10-alpha.1


## @mastra/files-sdk@0.3.3-alpha.0


## @mastra/gcs@0.3.5-alpha.1


## @mastra/google-drive@0.2.4-alpha.0


## @mastra/mesa@0.3.3-alpha.0


## @mastra/modal@0.7.3-alpha.0


## @mastra/platform-workspace@1.10.0-alpha.1


## @mastra/railway@0.10.2-alpha.1


## @mastra/s3@0.6.5-alpha.1


## @mastra/sprites@0.1.2-alpha.0


## @mastra/vercel@1.6.2-alpha.0


## @internal/playground@1.36.0-alpha.4

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-26 13:49:15 -07:00
Damien Schneider
0f82b38ed4
refactor(lint): flatten lone if statements in else branches (#28431)
Enable `no-lonely-if` in the shared Oxlint config and flatten 38 lone
`if` statements in `else` blocks across 35 files. For example, `else {
if (condition) { ... } }` becomes `else if (condition) { ... }`.
Conditions, evaluation order, statements, comments, and local bindings
are preserved. No package filters or lint exceptions are added.

Strengthen the existing monorepo test to execute another named export
from an optimized dependency. Comparisons of TypeScript syntax, emitted
JavaScript, raw template text, comments, and local bindings pass for all
35 migrated files after normalizing only the redundant else blocks. The
rule clears all 15,094 scanned files.

[CI lint and formatting
pass](https://github.com/mastra-ai/mastra/actions/runs/40344286057/job/121647174331)
for `36ca4471f9`. All 634 focused tests, four package typechecks (core,
playground, connect, and deployer), 57 packaged build tasks, and two
selected published-package monorepo E2E cases pass. The broader local
lint run hit a Tailwind design-system precomputation timeout; CI lint
succeeds. Live vendor and external-database suites were not run locally.

[DuckDB CI has two existing capability-list assertion
failures](https://github.com/mastra-ai/mastra/actions/runs/40344286246/job/121649643109):
its implementation advertises `span-aggregate`, while the expected lists
omit it. The failures reproduce locally, and the relevant implementation
and tests are unchanged from the base commit.

This maintenance PR intentionally contains no changeset and requests no
package releases. The missing-changeset check may fail.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## ELI5
This PR turns on a lint rule that asks for simpler branching in code. It
updates the affected code and adds a leap-year check to an existing
test.

## Changes
- Enables Oxlint’s `no-lonely-if` rule in the shared configuration.
- Flattens 38 lone `if` statements across 35 files. The PR description
reports that the changes preserve behavior.
- Extends the optimized-dependency monorepo test to check `isLeapYear`.

## Validation
- The PR description reports that CI lint and formatting pass.
- It also reports 634 focused tests, four package typechecks, 57
packaged build tasks, and two selected monorepo E2E cases pass.
- The PR description notes two existing DuckDB CI capability-list
assertion failures. It reports that the related implementation and tests
are unchanged from the base commit.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-26 18:44:48 +01:00
Ward Peeters
ce5d4731ee
chore(deps): update dependencies across the monorepo (#28417)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-26 16:59:30 +01:00
Dane - AI (Mastra)
40a522c142
chore(deps): update build tools (#27997) 2026-10-22 14:33:21 +02:00
Damien Schneider
e5c433b792
refactor(lint): prefer explicit reduce accumulator types (#27984)
Enable `typescript/prefer-reduce-type-parameter` across the repository,
including tests, and move 31 accumulator assertions across 24 files into
explicit `reduce<T>` arguments. For example, `items.reduce(callback, {}
as Record<string, string>)` becomes `items.reduce<Record<string,
string>>(callback, {})`. Emitted JavaScript ASTs match for every
migrated file, and 66 reducer return/accumulator type snapshots remain
equivalent.

Adds monorepo coverage that executes exports from multiple optimized
dependencies through the built HTTP server. CI lint/formatting, all 14
affected package typechecks, 235 focused tests, and the 55-task
publish-root build pass. All 81 monorepo E2E cases passed across the
full run and a 19-case targeted retry; retries disabled telemetry and
used writable package-manager caches after DNS/cache failures and a
shutdown timeout. No production changes were needed for that test setup.

This maintenance PR intentionally includes no changeset and requests no
package releases. The Changesets status check may therefore fail. The
follow-up commit removes only release metadata; source code and tests
are unchanged from the validated revision.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## ELI5

This PR updates TypeScript code to state reducer result types more
clearly. It keeps the same runtime behavior and adds a test for
optimized dependencies in the monorepo build.

## Summary

- Enabled `typescript/prefer-reduce-type-parameter` for TypeScript
files, including tests.
- Replaced 31 reducer accumulator assertions across 24 files with
explicit `reduce<T>` type parameters.
- Added monorepo E2E coverage for `lodash` and `date-fns` imports
through the built HTTP server.
- Removed release changesets because this maintenance change does not
require package releases.
- Reported validation includes linting, formatting, 14 package
typechecks, 235 focused tests, the publish-root build, and all 81
monorepo E2E cases.
- Reported JavaScript ASTs and 66 reducer type snapshots remain
equivalent.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-22 12:10:17 +02:00
Damien Schneider
fbd27197d7
refactor(lint): simplify literal strings and const assertions (#27982)
Enable `no-useless-concat` and `typescript/prefer-as-const` in the
shared Oxlint config. Simplify 15 string concatenations and use const
assertions for four readonly SDK specification versions. Existing
package filters stay as configured.

String contents and expression evaluation order are preserved, and the
SDK fields keep their readonly `v1`–`v4` literal types. A documented
exception keeps NUL-delimited fixture records separate so the next
record’s leading digit cannot become an octal escape.

261 focused tests pass. A fresh scan clears both rules across 14,747
files, and emitted-JavaScript and declaration comparisons preserve
values and public field types. [CI lint and formatting
pass](https://github.com/mastra-ai/mastra/actions/runs/39583377036/job/119166317139)
for `93eb6e19d5`. The full core typecheck also passes after refreshing
workspace dependency declarations.

This maintenance PR intentionally includes no changeset and requests no
package releases. The Changesets status check may therefore fail. The
follow-up commit removes only release metadata; source code and tests
are unchanged from the validated revision.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## ELI5

This PR enables two lint rules and updates existing code to follow them.
It keeps the same runtime behavior, string values, and SDK version
types.

## Changes

- Enables `no-useless-concat` and `typescript/prefer-as-const` in
`oxlint.config.ts`.
- Simplifies 15 unnecessary string concatenations.
- Adds const assertions for the readonly SDK specification versions `v1`
through `v4`.
- Documents the intentional NUL-delimited fixture concatenation in
`mastracode/factory/src/routes/fs.test.ts`.
- Preserves public APIs, emitted values, evaluation order, and literal
types.

## Validation

- 261 focused tests pass.
- A fresh scan clears both lint rules across 14,747 files.
- Emitted JavaScript and declaration comparisons preserve values and
public field types.
- Core typecheck passes after refreshing workspace dependency
declarations.
- CI lint and formatting checks pass.

No changeset or package release is included because this is a
maintenance change.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-21 19:10:56 +02:00
dane-ai-mastra[bot]
4c22623ea3 chore: version - exit prerelease mode 2026-10-21 11:26:39 +00:00
Dane - AI (Mastra)
dbde4bf36a
chore(deps): update ai sdk (#27728)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-10-19 19:04:28 -07:00
Max Katz
9a423dae48
refactor(lint): replace ESLint with type-aware oxlint (#27476) 2026-10-18 10:38:35 -07:00
dane-ai-mastra[bot]
a15924e709 chore: version packages 2026-10-16 04:04:12 +00:00
dane-ai-mastra[bot]
fe516094f5 chore: version - exit prerelease mode 2026-10-15 21:33:45 +00:00
dane-ai-mastra[bot]
e478d86cea
chore: version packages (alpha) (#27054)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`main` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `main`.

⚠️⚠️⚠️⚠️⚠️⚠️

# Releases

> The changelog information of each package has been omitted from this
message, as the content exceeds the size limit.

## @mastra/factory@0.23.0-alpha.3


## @mastra/code-sdk@1.14.0-alpha.3


## @mastra/core@1.78.0-alpha.3


## @mastra/memory@1.38.0-alpha.0


## @mastra/playground-ui@63.1.0-alpha.3


## @mastra/client-js@1.54.1-alpha.3


## @mastra/react@1.10.1-alpha.3


## @mastra/deployer-cloud@1.78.0-alpha.3


## @mastra/deployer-cloudflare@1.2.37-alpha.1


## @mastra/longmemeval@1.1.37-alpha.3


## @mastra/opencode@0.1.37-alpha.3


## create-factory@0.2.10-alpha.3


## mastracode@0.47.1-alpha.3


## @mastra/agent-builder@1.1.29-alpha.0


## mastra@1.34.2-alpha.3


## @mastra/deployer@1.78.0-alpha.3


## @mastra/editor@0.16.3-alpha.0


## @mastra/mcp-docs-server@1.3.8-alpha.4


## @mastra/schema-compat@1.3.15-alpha.0


## @mastra/server@1.78.0-alpha.3


## @mastra/elysia@0.1.18-alpha.3


## @mastra/express@1.5.22-alpha.3


## @mastra/fastify@1.5.22-alpha.3


## @mastra/hono@1.7.20-alpha.3


## @mastra/koa@1.7.22-alpha.3


## @mastra/nestjs@0.2.37-alpha.3


## @mastra/next@0.2.36-alpha.3


## @mastra/tanstack-start@0.2.36-alpha.3


## @mastra/clickhouse@1.25.1-alpha.1


## @mastra/duckdb@1.14.1-alpha.0


## @mastra/pg@1.31.2-alpha.1


## @mastra/voice-google-gemini-live@0.14.16-alpha.0


## @mastra/voice-openai-realtime@0.14.6-alpha.0


## @mastra/voice-sarvam@1.1.2-alpha.0


## @mastra/voice-xai-realtime@0.2.15-alpha.0


## @mastra/temporal@0.4.16-alpha.3


## @mastra/e2b@0.14.1-alpha.0


## @mastra/e2b-desktop@0.1.8-alpha.0


## @mastra/platform-workspace@1.8.1-alpha.0


## create-mastra@1.34.2-alpha.3


## @internal/playground@1.34.2-alpha.3

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-14 17:11:14 -07:00
Abhi Aiyer
cb015a1be6
fix: accept null for optional anyOf tool inputs and support z.record() in OpenAI structured output (#26979)
Fixes #26703, fixes #25235. Related: #25343.

## What
- **#26703**: Plain JSON Schema tools (e.g. MCP) with an optional
`anyOf` property were marked required in OpenAI strict mode without a
`null` branch, so the model had to invent a value. Optional typeless
`anyOf` properties now get a `null` alternative (required unions
unchanged; existing null branches not duplicated).
- **#25235**: OpenAI strict mode can't express free-form keys. It
rejects `propertyNames`, and an object with `additionalProperties:
false` and no listed keys is also rejected. Structured-output schemas
containing a record are now sent non-strict to OpenAI (Mastra still
validates the result). Users can force strict with
`providerOptions.openai.strictJsonSchema: true`. `propertyNames` is also
added to the strict-mode dropped keywords.

## Live verification (real OpenAI `gpt-5-mini`, same script)
| | main | this PR |
|---|---|---|
| `z.record()` structured output | 400 `'propertyNames' is not
permitted` | ✅ `{labels: {order_id, issue_type, priority}}` |
| optional `anyOf` tool field, 5 runs | invented in 5/5 (`0`, `""`,
`"unchanged"`) | left unset in 5/5 |

Raw API probes confirmed strict + record fails both with and without
`propertyNames`; non-strict succeeds.

## Tests
- New unit tests in `openai.test.ts`, `zod-to-json.test.ts`,
`execute.test.ts`; each fails without its fix.
- `@mastra/schema-compat`: 1009 passed. `stream/aisdk/v5`: 155 passed.
Core typecheck clean.
- Scenario repros through a real agent pass.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5

This change helps Mastra send OpenAI schemas that match the data they
describe. Optional union values can still be empty, and schemas with
free-form object keys use non-strict mode by default.

## Changes

- Optional typeless `anyOf` properties in OpenAI tool schemas accept
`null`. Existing null branches are not duplicated, and required unions
remain unchanged.
- When an optional union has sibling `enum` or `const` constraints,
those constraints apply to non-null values while still allowing `null`.
- Strict-mode schema processing drops `propertyNames`.
- OpenAI structured-output schemas with free-form objects, such as
`z.record()`, use non-strict mode by default. Mastra still validates the
result.
- Set `providerOptions.openai.strictJsonSchema: true` to force strict
mode.

## Reported verification

The author reports that record structured output succeeded with
`gpt-5-mini`, where `main` returned a 400. In five runs, optional
`anyOf` fields were left unset; `main` produced values in all five. The
author also reports 1010 schema-compat tests passed, 9 skipped, 407 core
stream tests passed, and core typecheck completed without errors. The
author reports 36/36 OpenAI e2e tests passed live and 36/36 passed on
replay after re-recording.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Also fixes #25343: OM working-memory extraction (`manageWorkingMemory:
true`) uses a `z.record` structured-output schema. Live gpt-5-mini run —
main: 2× `400 json_schema strict=true` (propertyNames) then fallback;
this PR: 2× `200 json_schema strict=false`, working memory
`{"name":"Priya","city":"Lisbon"}`.

---------

Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-14 11:34:07 -07:00
mastra-platform[bot]
c6230e30f7
fix(schema-compat): apply OpenAI compat layers to Azure OpenAI models (#26680)
> Opened by @abhiaiyer91

Fixes #26311

## What

Models created with `@ai-sdk/azure` report their provider as
`azure.responses` or `azure.chat`, and Azure deployment names usually
don't contain "openai". The OpenAI compat layers only matched the
substring `openai`, so Azure GPT and o-series models got no compat
layer. Without one, optional tool inputs were never made nullable.
GPT-5.x then filled every optional field (enums, numeric bounds) with
made-up values, and tools treated those values as real filters.

## Change

- Added an internal `isOpenAICompatibleModel()` helper in
`provider-compats/openai.ts`.
  - It returns true for `openai` providers and model IDs, as before.
  - For Azure, it returns true only when all three hold:
- The provider is an OpenAI-protocol entry point: `azure.chat`,
`azure.responses` or `azure.completion`. `azure.deepseek()` models never
match.
- The deployment name contains an OpenAI model token: `gpt`, `chatgpt`
or an o-series token such as `o3`. Examples: `gpt-4o`,
`my-gpt5-deployment`, `o3-mini`.
- The name contains no non-OpenAI family token: `claude`, `deepseek`,
`meta`, `llama`/`codellama`,
`mistral`/`ministral`/`mixtral`/`codestral`, `phi`, `grok` or `cohere`.
- Tokens match case-insensitively and only as whole tokens: at the start
of the ID or after `-_./:`, followed by the end, a separator or a
version digit. So `metadata-gpt` and `graphic-gpt` get the OpenAI layer,
while `llama3-70b`, `Phi-4` and `gptzero-clone` don't.
- Deployments with neutral names (`production`, `my-deployment`) and
excluded families keep their previous behavior: their own layer if they
have one, otherwise no layer.
- `OpenAISchemaCompatLayer.shouldApply()`,
`OpenAIReasoningSchemaCompatLayer.shouldApply()` and
`applyOpenAICompatTransforms()` now use this helper.
- Reasoning detection is now a single `isReasoningModel()` shared by
both layers and the transform selector. It matches `o1`–`o9` only as a
standalone token (`/(^|[-_./:])o[1-9](?=$|[-_.:])/i`):
  - It matches `o3-mini`, `my-o3-deployment` and `ft:o4-mini-…`.
  - It does not match `demo1-gpt` or `proto3-chat`.
- Router-style `azure-openai/<deployment>` models are unchanged.

## Tests

- `shouldApply` cases for:
- GPT deployments, including names that contain a family word
(`graphic-gpt`, `sophia-gpt-4o`, `metadata-gpt`, `grokking-gpt-4o`),
`chatgpt-4o-latest`, `sales-gpt5-prod`, and `azure.completion`.
- Neutral or look-alike names that stay off the OpenAI layer:
`production`, `my-deployment`, `proto3-chat`, `solo4`, `gptzero-clone`.
  - o-series IDs and prefixed deployments.
- Mixed-case Azure catalog IDs: `DeepSeek-V3`,
`Meta-Llama-3.1-405B-Instruct`, `Llama-3.3-70B-Instruct`,
`Mistral-Large-2411`, `Phi-4`, `grok-3`, `Cohere-command-r-plus`,
`Codestral-2501`, `Ministral-3B`, `Mixtral-8x7B-Instruct`,
`CodeLlama-34b-Instruct-hf`.
  - `azure.deepseek` with neutral and o-series-looking deployment names.
- End-to-end compat check on `azure.responses`: optional fields become
required and nullable, and `null` maps back to `undefined`.
- `applyOpenAICompatTransforms` transforms Azure models, including
prefixed reasoning deployments.
- The full schema-compat suite passes (1056 passed, no snapshot changes)
and `tsc --noEmit` is clean.

## Known limitation

The model family is still inferred from the deployment name, because
`@ai-sdk/azure` exposes nothing else. An Azure GPT deployment with a
neutral name (e.g. `production`) does not get the OpenAI layer, so it
keeps the old behavior. An explicit model-family setting is tracked in
#27041.

Verified end to end by @abhiaiyer91 against Azure `azure.responses` /
`azure.chat` deployments.

---------

Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>
2026-10-14 10:35:51 -07:00
dane-ai-mastra[bot]
f88217d19b chore: version - exit prerelease mode 2026-10-14 05:19:31 +00:00
dane-ai-mastra[bot]
1f1f1a479f chore: version packages 2026-10-14 04:06:24 +00:00
mastra-platform[bot]
ca92c02696
fix(core): infer output types for transformed Standard Schemas (#26815)
> Opened by @abhiaiyer91

Fixes #26766

## Summary
Standard Schemas that transform their input (e.g. Effect's
`Schema.toStandardSchemaV1(Schema.DateFromString)`) validated correctly
at runtime but had wrong types on tools:

- As a tool `inputSchema`, `execute` received `string | Date` instead of
`Date`.
- As a tool `requestContextSchema`, the schema was rejected because its
input and output types differ.

## Changes
- `InferPublicSchema` (`@mastra/schema-compat`) now treats
`~standard.types` as optional, as the Standard Schema spec defines it,
and reads its `output`. When `types` is missing it falls back to the
previous behavior. The Zod and AI SDK branches still run first, so those
schemas are unaffected.
- Tool `requestContextSchema` is now `PublicSchema<TRequestContext,
any>`. The context type comes from the schema's output, and the input
type is allowed to differ. Tools decode request context at runtime
(`TransformedRequestContext`), so the output type matches what `execute`
receives.
- Agents, workflows and workflow steps validate request context but
don't decode it, so their request-context typing keeps its previous
behavior:
- `AgentConfig` and `WorkflowConfig` still reject transforming
`requestContextSchema`s.
- `createStep` and inferred `createWorkflow` use a new
`InferWorkflowRequestContext`. It keeps the previous inference, so step
context is never typed as decoded values it doesn't receive at runtime.
- New type tests in
`packages/core/src/tools/standard-schema-transform-types.test-d.ts`,
plus a patch changeset.

## Test plan
- [x] The new type tests fail on `main` with the errors from the issue
(e.g. `'toISOString' does not exist on type 'string | Date'`) and pass
with this change.
- [x] Tests assert that agent and workflow configs still reject a
transforming `requestContextSchema`.
- [x] Tests assert that step request context is not typed as the decoded
output. The test fails if workflows use `InferPublicSchema`.
- [x] `vitest --project typecheck:packages/core` passes (41 files, 236
tests, no type errors).
- [x] `tsc --noEmit -p tsconfig.build.json` in core.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5

Some schemas turn one kind of value into another, such as text into a
`Date`. This change helps TypeScript use the transformed value in tool
code while keeping agent and workflow request-context types consistent
with how those components validate context.

## Changes

- `InferPublicSchema` now infers the output type from Standard Schemas
when `~standard.types` is optional. Existing Zod and AI SDK inference
paths remain in place.
- Tool `execute` inputs and request contexts use transformed output
types. Tool `requestContextSchema` accepts schemas with different input
and output types.
- Agent and workflow request-context schemas retain their existing
restrictions on transformations. Workflow-step request-context inference
does not use decoded output types.
- Added type-level tests for Standard Schema inference, Zod transforms,
tool inputs and request contexts, and agent and workflow request-context
behavior.
- Added patch changesets for `@mastra/schema-compat` and `@mastra/core`.

## Verification

The PR description reports that the new type tests fail on `main` and
pass with this change. It also reports that `vitest --project
typecheck:packages/core` passed: 41 files, 236 tests, and no type
errors. The core `tsc --noEmit -p tsconfig.build.json` check also
passed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-13 17:02:21 -07:00
NikAiyer
e138cd4c92
test(core): replay real-provider completion-feedback test (T78) from recordings (#26010)
## Summary

Ports harness case T78 to a keyless-replay Vitest test: a real-provider
agent whose `isTaskComplete` scorer fails once, run on the plain,
durable and evented engines against Anthropic and OpenAI over real
`@mastra/memory` `Memory` with LibSQL storage. The six runs are replayed
from committed recordings, so PR CI exercises the real prefill-rejection
→ repair path with no API keys. Also stops the recorder writing
Anthropic account identifiers into fixtures.

## Changes

- Add
`packages/memory/integration-tests/src/durable-agent-completion-feedback.test.ts`
plus 6 recordings (the Anthropic ones include the rejected 400 and the
repaired retry).
- Skip `anthropic-organization-id` / `anthropic-workspace-id` response
headers in the recorder, and strip values already present in 9
recordings; cover it with a recorder unit test.

## Test plan

- `pnpm vitest run src/durable-agent-completion-feedback.test.ts` from
`packages/memory/integration-tests` (keyless replay). Re-record with
`LLM_TEST_MODE=record` and `OPENAI_API_KEY` + `ANTHROPIC_API_KEY`.
- `pnpm vitest run src/llm-recorder.test.ts` from
`packages/_llm-recorder`.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5

This PR checks how agents respond when a model says a task is incomplete
or rejects a follow-up request. It also removes provider account details
from saved test recordings.

## Summary

- Adds a replayable T78 integration test for plain, durable, and evented
agents. It uses Anthropic and OpenAI with `Memory` and LibSQL storage.
- Checks completion feedback and stored conversation history. Anthropic
rejects assistant-ended requests and triggers a repair; OpenAI accepts
them without that repair.
- Updates the LLM recorder to omit Anthropic organization and workspace
ID headers. Adds a recorder test and removes those headers from existing
recordings.
- Adds six provider recordings for the integration test. The supplied
test plan describes replay without API keys and recording with both
provider API keys. Test execution results were not provided.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-06 15:43:22 -05:00
dane-ai-mastra[bot]
8b35a6c1d6 chore: version - exit prerelease mode 2026-10-01 08:22:20 +00:00
dane-ai-mastra[bot]
de967f00ab chore: version packages 2026-10-01 04:06:35 +00:00
mastra-platform[bot]
4ac8bc76e9
fix(schema-compat): allow Object.prototype property names when flattening allOf (#25655)
Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>
2026-09-30 18:34:09 -07:00
dane-ai-mastra[bot]
5306a14346 chore: version - exit prerelease mode 2026-09-29 23:50:38 +00:00
dane-ai-mastra[bot]
81817c032a chore: version packages 2026-09-28 04:06:31 +00:00
mastra-platform[bot]
3f50f2a590
fix(schema-compat): convert optional nulls inside nullable objects and arrays (#25276)
Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>
2026-09-27 18:53:21 -07:00
dane-ai-mastra[bot]
6a8425cf64 chore: version packages 2026-09-25 16:15:32 +00:00
mastra-platform[bot]
08a0aea2f2
fix(schema-compat): keep numeric format keywords inside the nullable anyOf branch for OpenAI (#25067)
Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>
2026-09-25 08:31:35 -07:00
breken
3913a33fd5
fix(schema-compat): keep null valid for nullable enums and literals (#25086) 2026-09-24 23:26:25 -07:00
dane-ai-mastra[bot]
429d7b9f93 chore: version - exit prerelease mode 2026-09-22 10:43:03 +00:00
dane-ai-mastra[bot]
d696deb43e chore: version packages 2026-09-16 16:06:16 +00:00
mastra-platform[bot]
6c781fda62
fix(schema-compat): route Vertex Claude models to Anthropic compatibility (#24108)
Co-authored-by: dane-ai-mastra[bot] <199668360+dane-ai-mastra[bot]@users.noreply.github.com>
Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>
2026-09-16 08:56:48 -07:00
Lennart
5085475c0d
fix: reduce dependency footprint across core and integrations (#23998) 2026-09-16 11:38:54 +02:00
Lennart
202a4e16d9
test(schema-compat): refresh fixtures for Zod 4.6 output (#24119)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-09-16 11:19:24 +02:00
dane-ai-mastra[bot]
adf6cc46fb chore: version packages 2026-09-16 04:05:24 +00:00
Daniel Lew
fef227a8b7
fix(schema-compat): json-to-zod works from CommonJS and generates Zod v4-safe records (#24049)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-09-15 15:33:45 -07:00
dane-ai-mastra[bot]
871bdaa595 chore: version - exit prerelease mode 2026-09-15 09:04:59 +00:00
Ward Peeters
61ce4d0492
test(schema-compat): cover nullable typed scalar constraints (#23898)
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-09-14 20:26:48 +02:00
dane-ai-mastra[bot]
ba200359a9 chore: version packages 2026-09-14 16:07:45 +00:00
Grayson Hicks
ffe16f1744
fix(schema-compat): reduce Zod schema type instantiation (#23677) 2026-09-14 17:43:12 +02:00