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

627 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
Lennart
171e27355f
fix(code-sdk): fire SessionStart again when a session binds a different thread (#30223)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-12 11:03:36 -07:00
dane-ai-mastra[bot]
05a6931471
chore: version packages (alpha) (#30172)
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
## @mastra/client-js@1.60.0-alpha.12

### Minor Changes

- Allow `querySpans()` to sort by `model` or `provider`.
([#30096](https://github.com/mastra-ai/mastra/pull/30096))

  ```ts
  orderBy: [{ field: 'model', direction: 'asc' }];
  ```

### Patch Changes

- The generated route types for scores now include the `SCORER` and
`PROCESSOR` entity types, matching the entity types experiments can
emit. ([#30145](https://github.com/mastra-ai/mastra/pull/30145))

- Add span-local error counts.
([#30088](https://github.com/mastra-ai/mastra/pull/30088))

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
## @mastra/factory@0.28.0-alpha.14

### Minor Changes

- A card's sandbox now stops as soon as the card is done with that
context, instead of idling until the provider times it out.
([#29981](https://github.com/mastra-ai/mastra/pull/29981))

- When a card moves out of the last phase of a context into a phase that
runs in another one, Factory stops that context's sandbox. Triage →
Planning stops the triage sandbox; Planning → Building keeps the shared
`work` sandbox running. A run still in flight on the session keeps its
sandbox until it ends.
- When a card finishes, Factory stops every sandbox it holds, from any
Factory process, by identity through the configured sandbox provider.
Before, only the process that had opened a sandbox stopped it.
- A card that comes back to a context resumes the same sandbox with its
files.

Stopping never fails the move. Sandboxes are stopped, not destroyed;
deleting a session still destroys its sandbox.

- Added two read routes that answer what the new session page shows
without sending a project's cards.
([#30097](https://github.com/mastra-ai/mastra/pull/30097))

`GET /web/factory/projects/:id/work-items/starters` counts the cards
behind each starter on the project's default board, such as the cards
whose run failed, the pull requests awaiting review and the cards not
yet triaged.

`GET /web/factory/projects/:id/work-items/activity?since=<instant>`
returns how many cards the project has, and when cards were created and
completed since that instant. `since` is required and must be an ISO
date-time such as `2026-06-01T00:00:00.000Z`. The answer carries an
`ETag`, so asking again for the same `since` with `If-None-Match`
returns a 304 with no body when nothing changed.

### Patch Changes

- Fixed environment templates that could stop rebuilding for good. When
a build start was never recorded and the sandbox provider can't list its
builds (Mastra Platform), every later Build now, schedule and push run
used to skip with `unresolved` forever. Factory now treats that start as
failed 30 minutes after its lease lapsed and the next trigger builds.
([#30148](https://github.com/mastra-ai/mastra/pull/30148))

Saving a change to a template input (setup commands, the working
directory, settings, environment repositories, source-control
connections or Build variables) now rebuilds the template once the
project has one, so new sandboxes stop rerunning setup on every boot.
Saves that change nothing don't build, and a change saved during any
build, scheduled ones included, is built when that build ends.

- Factory sessions and MCP clients can now read the Factory's audit
trail with `factory_list_audit_events`: who did what to which work item,
run, branch or setting, and when. Filter by actor (`me`, a user id, or
an agent, optionally with the agent runs a person started), namespace or
exact actions, work item and time range, and page back with a cursor.
The tool only returns this Factory's events and never returns request
context (IP address, user agent), actor emails or event metadata beyond
who started an agent run. It leaves out events from or about other
people's private sessions.
([#30165](https://github.com/mastra-ai/mastra/pull/30165))

- Added a "Join the issue's card instead" switch to intake routes in the
Factory UI. A route for pull requests that close an issue can now put
the pull request on that issue's card instead of giving it a card of its
own; until now only the route Factory seeds could do this. The switch
shows on new and saved routes whose conditions include "Source kind is
Pull request" and "Pull request closes an issue is Yes".
([#30197](https://github.com/mastra-ai/mastra/pull/30197))

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/code-sdk@1.19.0-alpha.14
  - @mastra/mcp@2.9.0-alpha.4
## @mastra/observability@1.24.0-alpha.7

### Minor Changes

- Add span-local error counts.
([#30088](https://github.com/mastra-ai/mastra/pull/30088))

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
## @mastra/core@1.83.0-alpha.12

### Minor Changes

- Add model and provider as span query sort fields.
([#30096](https://github.com/mastra-ai/mastra/pull/30096))

  ```ts
  orderBy: [{ field: 'model', direction: 'asc' }];
  ```

- Add span-local error counts.
([#30088](https://github.com/mastra-ai/mastra/pull/30088))

### Patch Changes

- Name the agent in the missing-storage error thrown by `Memory`. When
an agent's memory never received storage because the agent was never
attached to a Mastra instance, accessing `memory.storage` now fails with
`[Agent:<name>] Memory requires a storage provider to function. ...`, so
it is clear which agent is misconfigured. The registration and
standalone-storage guidance added in #29972 is unchanged, and agents
that inherit storage from their Mastra or configure it directly on
`Memory` are unaffected.
([#30164](https://github.com/mastra-ai/mastra/pull/30164))

- Experiments with a scorer or processor target now save their scores,
and workflow step scorers in experiments now save their step scores.
Previously these scores were silently discarded.
([#30145](https://github.com/mastra-ai/mastra/pull/30145))
## @mastra/mcp-apps-components@0.1.0-alpha.7

### Minor Changes

- Dashboards authored in chat now accept the same widgets as the
dashboard editor: KPIs that combine values (ratio, difference, max,
fallback), read trace, span or score aggregates (for example p95 span
duration) and use duration, percent or score formats; line charts of
scores; six more chart colors (blue, orange, pink, yellow, red, purple);
and optional KPI icon and detail, series color and table empty message.
([#30192](https://github.com/mastra-ai/mastra/pull/30192))

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
## @mastra/playground-ui@69.0.0-alpha.14

### Minor Changes

- Widened what dashboard widgets can show:
([#30192](https://github.com/mastra-ai/mastra/pull/30192))

- KPIs can combine values with `ratio`, `minus`, `max` and `coalesce`,
read trace and span aggregates (for example `duration.p95`) and score
aggregates, and are formatted as `duration`, `percent` or `score`.
Combined values are compared with the previous window.
- Charts accept six more colors: `blue`, `orange`, `pink`, `yellow`,
`red` and `purple`.
- KPI `icon` and `detail`, series `color` and table `emptyMessage` are
optional. Series without a color pick one from a palette, and tables
without an empty message show "No data".

### Patch Changes

- Fixed hover highlights on cards and other surfaces stopping short of
the edge. The highlight now covers the whole surface and follows its
rounded corners exactly, including the sidebar credits card and
clickable cards. Hover highlights on these surfaces now switch instantly
instead of fading.
([#30047](https://github.com/mastra-ai/mastra/pull/30047))

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`987566e`](987566e882),
[`72abae6`](72abae68eb),
[`987566e`](987566e882),
[`f071044`](f0710446e0)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/client-js@1.60.0-alpha.12
  - @mastra/react@1.15.0-alpha.12
## @mastra/server@1.83.0-alpha.12

### Minor Changes

- Support model and provider sorting in span queries.
([#30096](https://github.com/mastra-ai/mastra/pull/30096))

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
## @mastra/clickhouse@1.30.0-alpha.4

### Minor Changes

- Sort span queries by model or provider in ascending or descending
order. ([#30096](https://github.com/mastra-ai/mastra/pull/30096))

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
## @mastra/duckdb@1.19.0-alpha.5

### Minor Changes

- Sort span queries by model or provider in ascending or descending
order. ([#30096](https://github.com/mastra-ai/mastra/pull/30096))

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
## @mastra/pg@1.36.0-alpha.6

### Minor Changes

- Sort span queries by model or provider in ascending or descending
order. ([#30096](https://github.com/mastra-ai/mastra/pull/30096))

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
## @mastra/react@1.15.0-alpha.12

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`987566e`](987566e882),
[`72abae6`](72abae68eb),
[`987566e`](987566e882),
[`f071044`](f0710446e0)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/client-js@1.60.0-alpha.12
## @mastra/deployer-cloud@1.83.0-alpha.12

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/deployer@1.83.0-alpha.12
## @mastra/longmemeval@1.1.42-alpha.12

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/libsql@1.30.0-alpha.3
## @mastra/opencode@0.1.42-alpha.12

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/libsql@1.30.0-alpha.3
## create-factory@0.4.3-alpha.14

### Patch Changes

- Updated dependencies
[[`1fbc69a`](1fbc69aa9a),
[`4e378c3`](4e378c3e26),
[`1fbc69a`](1fbc69aa9a)]:
  - mastra@1.39.0-alpha.14
## @mastra/code-sdk@1.19.0-alpha.14

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`987566e`](987566e882),
[`72abae6`](72abae68eb),
[`987566e`](987566e882),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/observability@1.24.0-alpha.7
  - @mastra/duckdb@1.19.0-alpha.5
  - @mastra/client-js@1.60.0-alpha.12
  - @mastra/pg@1.36.0-alpha.6
  - @mastra/mcp@2.9.0-alpha.4
  - @mastra/libsql@1.30.0-alpha.3
## mastracode@0.50.0-alpha.13

### Patch Changes

- Fix `/settings` crashing when mouse preferences are missing from saved
settings by defaulting to Off.
([#30184](https://github.com/mastra-ai/mastra/pull/30184))

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882),
[`f071044`](f0710446e0)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/observability@1.24.0-alpha.7
  - @mastra/duckdb@1.19.0-alpha.5
  - @mastra/pg@1.36.0-alpha.6
  - @mastra/code-sdk@1.19.0-alpha.14
  - @mastra/mcp@2.9.0-alpha.4
  - @mastra/libsql@1.30.0-alpha.3
## @mastra/arize@1.3.30-alpha.7

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/otel-exporter@1.5.2-alpha.7
## @mastra/arthur@0.4.30-alpha.7

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/otel-exporter@1.5.2-alpha.7
## @mastra/braintrust@1.3.27-alpha.7

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/observability@1.24.0-alpha.7
## @mastra/datadog@1.4.22-alpha.7

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/observability@1.24.0-alpha.7
## @mastra/deepeval@0.1.24-alpha.7

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/observability@1.24.0-alpha.7
## @mastra/laminar@1.3.32-alpha.7

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/observability@1.24.0-alpha.7
## @mastra/langfuse@1.6.6-alpha.7

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/observability@1.24.0-alpha.7
  - @mastra/otel-exporter@1.5.2-alpha.7
## @mastra/langsmith@1.4.3-alpha.7

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/observability@1.24.0-alpha.7
## @mastra/otel-bridge@1.5.22-alpha.7

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/observability@1.24.0-alpha.7
  - @mastra/otel-exporter@1.5.2-alpha.7
## @mastra/otel-exporter@1.5.2-alpha.7

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/observability@1.24.0-alpha.7
## @mastra/posthog@1.4.7-alpha.7

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/observability@1.24.0-alpha.7
## @mastra/sentry@1.2.32-alpha.7

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/observability@1.24.0-alpha.7
  - @mastra/otel-exporter@1.5.2-alpha.7
## mastra@1.39.0-alpha.14

### Patch Changes

- Added `mastra api factory work-item starters` and `mastra api factory
work-item activity`. The first counts the cards behind each new-session
starter on a project's default board. The second lists when a project's
cards were created and completed since an instant:
([#30097](https://github.com/mastra-ai/mastra/pull/30097))

  ```bash
  mastra api factory work-item starters <project-id>
mastra api factory work-item activity <project-id>
'{"since":"2026-06-01T00:00:00.000Z"}'
  ```

- Added a "Join the issue's card instead" switch to intake routes in the
Factory UI. A route for pull requests that close an issue can now put
the pull request on that issue's card instead of giving it a card of its
own; until now only the route Factory seeds could do this. The switch
shows on new and saved routes whose conditions include "Source kind is
Pull request" and "Pull request closes an issue is Yes".
([#30197](https://github.com/mastra-ai/mastra/pull/30197))

- Improved the Factory new session page on large boards. Its starters
and its activity band now load the counts and dates they show instead of
downloading every card of the project. They show the same content as
before. ([#30097](https://github.com/mastra-ai/mastra/pull/30097))

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/deployer@1.83.0-alpha.12
## @mastra/deployer@1.83.0-alpha.12

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/server@1.83.0-alpha.12
## @mastra/mcp-docs-server@1.3.13-alpha.16

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
## @mastra/elysia@0.1.23-alpha.12

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/server@1.83.0-alpha.12
## @mastra/express@1.5.27-alpha.12

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/server@1.83.0-alpha.12
## @mastra/fastify@1.5.27-alpha.12

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/server@1.83.0-alpha.12
## @mastra/hono@1.7.25-alpha.12

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/server@1.83.0-alpha.12
## @mastra/koa@1.7.27-alpha.12

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/server@1.83.0-alpha.12
## @mastra/nestjs@0.3.0-alpha.12

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/server@1.83.0-alpha.12
## @mastra/next@0.2.41-alpha.12

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/server@1.83.0-alpha.12
  - @mastra/hono@1.7.25-alpha.12
## @mastra/tanstack-start@0.2.41-alpha.12

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/server@1.83.0-alpha.12
  - @mastra/hono@1.7.25-alpha.12
## @mastra/voice-openai-realtime@0.14.9-alpha.2

### Patch Changes

- Use gpt-realtime-2.1-mini by default for OpenAI Realtime voice
connections instead of the retired
gpt-4o-mini-realtime-preview-2024-12-17 model.
([#30183](https://github.com/mastra-ai/mastra/pull/30183))
## @mastra/inngest@1.11.2-alpha.8

### Patch Changes

- Support span-local error counts in Inngest workflows.
([#30088](https://github.com/mastra-ai/mastra/pull/30088))

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
## @mastra/temporal@0.6.0-alpha.12

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/deployer@1.83.0-alpha.12
## create-mastra@1.39.0-alpha.14


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

### Patch Changes

- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`987566e`](987566e882),
[`72abae6`](72abae68eb),
[`f9088d8`](f9088d8510),
[`987566e`](987566e882),
[`f071044`](f0710446e0),
[`43d1e9c`](43d1e9c16d)]:
  - @mastra/core@1.83.0-alpha.12
  - @mastra/client-js@1.60.0-alpha.12
  - @mastra/playground-ui@69.0.0-alpha.14
  - @mastra/react@1.15.0-alpha.12

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-12 14:42:02 +01:00
dane-ai-mastra[bot]
a4258a989c
chore: version packages (alpha) (#30127)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-11 21:12:19 -08:00
dane-ai-mastra[bot]
055a8c3b82 chore: version packages 2026-11-12 04:17:40 +00:00
mastra-platform[bot]
2d4284603a
Fix MCP core compatibility, Windows browser paths, and AI SDK tool titles (#30125) 2026-11-11 15:45:01 -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
Caleb Barnes
0b3514eb8a
fix(code-sdk): keep schedule summaries on one line (#30108)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-11 13:57:39 -08:00
mastra-platform[bot]
38327de07a
Avoid Event-Loop Stalls in Instruction Lookup (#30104) 2026-11-11 13:54:28 -08:00
Damien Schneider
067314bcb3
perf(code-sdk): cache base-branch instruction reads by git object in review sessions (#29551)
**─────── TLDR ───────**
> A review session on an untrusted checkout stops running a git process
for every instruction file on every model step, which blocked every
session in the same process.

On an untrusted checkout, `AGENTS.md` and `CLAUDE.md` are read from the
base branch with synchronous `git` calls. Each step rebuilt the prompt
and ran the reminder check, and the reminder check loaded the
instructions again for every file it looked at. Reads are now cached by
git object id: each folder's listing by its tree, the content by blob.
Ids are content-addressed, so a cached read cannot go stale, and a file
the base branch did not touch is not read again when it moves. The cache
is shared by every session in the process, so nothing is cached until it
matches its id: git checks each folder it lists, and the reader hashes
file content itself. The injector also loads the instruction paths it
skips once per step instead of once per file.

### Behavior changed

each model step of a review session, 8 folders touched
&nbsp;&nbsp;├─ **was** — 107 git processes, each blocking the event loop
&nbsp;&nbsp;└─ **now** — 3: the ref lookups; file reads come from the
cache

the base branch moves during a session
&nbsp;&nbsp;└─ **unchanged** — the ref resolves every step, so an edited
file is read again

a file a blobless clone failed to fetch
&nbsp;&nbsp;└─ **unchanged** — retried on the next step; failures are
never cached

a checkout with a `git replace` ref on an instruction file
&nbsp;&nbsp;├─ **was** — that checkout read the replacement
&nbsp;&nbsp;└─ **now** — read as committed, so the cache cannot carry it
to other checkouts

a checkout whose `.git/objects` holds a rewritten instruction file or
folder
&nbsp;&nbsp;├─ **was** — that checkout read the rewritten content
&nbsp;&nbsp;└─ **now** — read as absent, so the cache cannot carry it to
other checkouts

### Tradeoff

Real injector and prompt load on this repo, main → this branch, 8
folders touched:

> git calls per settled step — `107 → 3`
> git calls until a new session settles — `368 → 114`
> first step after the base branch moves a commit — `107 → 20`
> first step of a fresh process — `14 → 16`
> settled step time in the test harness — `0.4–0.5 s → 0.02 s`

The fresh-process step pays for listing each folder on its own, which is
what lets git check it. It happens once per process, and its time stayed
within noise.

### Decisions

- **listings cached per folder, content by blob, successes only, capped
at 16 MB** — ids never change, so entries never go stale; a failed fetch
retries
- **entries checked against their id before caching** — the cache spans
checkouts; keying it per checkout is the undo, and loses the sharing
- **`getIgnoredInstructionPaths` called once per step, in core** — it
ran per candidate file; same set, computed lazily once

### Not verified

- [ ] a live Factory review session — measured with the real injector on
this repo

---

> ██████████████████ **tests** `+200 −1`
> █████████ **source** `+100 −37` — net +63
> █ **changeset** `+10`


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

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

## ELI5

The assistant now reuses verified Git data when it reads instruction
files from a branch. This reduces repeated Git work while keeping
untrusted checkout content out of the review, and it checks ignored
paths only once per processing step.

## Summary

- Cache Git tree listings and blob contents by object identity.
- Limit cached keys and outputs to 16 MiB with oldest-first eviction.
- Cache only successful reads that pass identity checks.
- Resolve files from `origin/<ref>` first, then `<ref>`.
- Retry failed reads and reread files when the base branch changes.
- Use `--no-replace-objects` to isolate checkouts from replace refs.
- Load ignored instruction paths once per processor request.
- Add tests for caching, cache eviction, ref handling, retries, tampered
objects, checkout isolation, and ignored-path loading.

**Changes:** 6 files; 310 lines added and 38 removed.  
**CI, build, and test results:** not available.  
**Review finding counts:** not available.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Damien Schneider <damienschneider@damiens-MacBook-Pro.local>
2026-11-11 10:42:02 -08:00
dane-ai-mastra[bot]
3a6ca42696
chore: version packages (alpha) (#30026)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-11 08:16:57 -08:00
dane-ai-mastra[bot]
71fb4b9795
chore: version packages (alpha) (#30023)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-10 23:42:54 -08:00
NikAiyer
cd5b131d4d
fix(code-sdk): reject empty MASTRACODE_AGENT_STREAMS and check it before startup work (#30024)
Co-authored-by: review <review@local>
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-10 23:39:31 -08:00
NikAiyer
13b47281ca
feat(code-sdk): add MASTRACODE_AGENT_STREAMS=off switch (#30020)
Co-authored-by: review <review@local>
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-10 23:10:34 -08:00
dane-ai-mastra[bot]
695599b8ab
chore: version packages (alpha) (#30013)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-10 22:48:39 -08:00
dane-ai-mastra[bot]
8bce7717eb
chore: version packages (alpha) (#29986)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-10 20:51:40 -08:00
Aamish
ac40e762db
fix(code-sdk): retry stream cuts after HTTP 200 instead of declaring an outage (#29462)
Co-authored-by: Aamish <your@email.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 20:06:59 -08:00
Aamish
210458a144
fix(code-sdk): embed observations in a short-lived worker process (#29464)
Co-authored-by: Aamish <your@email.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 20:06:34 -08:00
mastra-platform[bot]
d41d7ac33d
feat(mastracode): approving a plan starts it as a goal (#28037) 2026-11-10 22:36:39 -05: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
931c2bb605
fix(workspace): search template and lock files in grep, add SandboxFilesystem textExtensions (#29417)
## Description

Workspace `grep` skipped common plain-text files because their
extensions weren't on the built-in text list. In a Rails project, a grep
for `class="panel"` over `app/views/_header.html.erb` returned 0 matches
with "1 file skipped: unsupported extension". Agents working through
`SandboxFilesystem` couldn't fix this themselves, because it had no
`textExtensions` option.

```diff
 // @mastra/core: packages/core/src/workspace/filesystem/fs-utils.ts
 TEXT_EXTENSIONS = { ..., '.log', '.jsonl',
+  '.erb', '.hbs', '.handlebars', '.haml', '.slim', '.ejs', '.mustache',
+  '.jinja', '.j2', '.twig', '.cshtml',
+  '.gemspec', '.lock', '.proto', '.gradle', '.properties' }

 // @mastra/code-sdk: mastracode/sdk/src/agents/sandbox-filesystem.ts
 new SandboxFilesystem({ sandbox, workdir,
+  textExtensions: ['.sasx'],   // same normalization as LocalFilesystem: 'sasx', '.SASX' also work
 })
+isTextFile(name) -> built-in list + textExtensions   // grep checks this on its native and fallback paths
```

This takes the issue's first option, adding the listed formats to the
allowlist. Switching to a binary denylist or NUL-byte sniffing would
change behavior for every filesystem, so that's left for maintainers to
decide.

`SandboxFilesystem.isTextFile` hands the check to a private
`LocalFilesystem` and never uses it to touch files. That gives the same
built-in list and normalization as `LocalFilesystem`, and it only uses
core APIs that exist in published `@mastra/core` 1.82.0, the SDK's peer
floor. Exporting core's helpers instead would have broken the SDK on
1.82.0, and `validate-peerdeps.mjs` doesn't allow raising the floor
until core's version is bumped.

## Evidence

New tests, each run against the original sources and then against this
branch:

-
`packages/core/src/workspace/tools/__tests__/grep-text-extensions.test.ts`
runs the real grep tool over a temporary directory through
`LocalFilesystem`.
**Before:** 3 failed, 1 passed. Failing: the Rails `_header.html.erb`
case, an explicitly targeted `.erb` file, and all 18 file names from the
issue (including `yarn.lock`, `Gemfile.lock`, `Cargo.lock`).
**After:** 4 passed. The test that passed before checks that `.png` and
`.zip` are still skipped.
- `mastracode/sdk/src/agents/sandbox-filesystem.text-extensions.test.ts`
runs the grep tool over `SandboxFilesystem`, which runs real `sh -c`
commands on the host.
**Before:** 3 failed, 1 passed. Failing: `textExtensions: ['SASX']` on
the native grep path; the host-walk fallback path (a pattern every
native engine rejects, plus a check that the file was read host-side);
and an explicitly targeted `.sasx` file.
**After:** 4 passed. The test that passed before checks that
unregistered extensions are still skipped by default.

Existing suites still pass on the rebased head: core `grep.test.ts`,
`fs-utils.test.ts`, `mastra-filesystem.test.ts`,
`local-filesystem.test.ts` and the skills tests (650 tests); SDK
`sandbox-filesystem.test.ts` and
`sandbox-filesystem.conformance.test.ts` (189 tests). These also pass:
`tsc --noEmit` and `oxlint --type-aware` for both packages, `pnpm
check:core-imports mastracode/sdk` (every core import exists in 1.82.0)
and `node scripts/validate-peerdeps.mjs`.

Not run: the full core and SDK suites. Everything above ran on Linux
with ripgrep installed.

## Merge Danger

**Door:** two-way. It adds entries to a list and an optional constructor
option, and reverting the commit undoes both.

**Blast radius:** workspace `grep` for every filesystem, plus
`SandboxFilesystem` users. The riskiest part is `.lock`: a whole-repo
grep now also searches `yarn.lock`, `Gemfile.lock` and `Cargo.lock`, so
a search for a package name can fill part of the 1000-match cap with
lockfile lines. `pnpm-lock.yaml` and `package-lock.json` were already
searched, and the issue asks for `.lock` files. `SandboxFilesystem` with
no `textExtensions` behaves as before, apart from the new built-in
extensions.

## Related issue(s)

Closes #28365

## Type of change

- [x] Bug fix (non-breaking change that fixes an issue)
- [x] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update

## Checklist

- [x] I have linked the related issue(s) in the description above
- [ ] I have made corresponding changes to the documentation (if
applicable). No docs page covers `textExtensions` or
`SandboxFilesystem`; both changesets describe the change.
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have addressed all Coderabbit comments on this PR

## Council review

Each seat scored out of 10: Correctness / Tests / Scope / Code quality.

| Round | GPT 6.1 Sol | Claude Opus 5.5 | Grok 4.7 | Change after the
round |
|---|---|---|---|---|
| 1 | 8 / 9 / 10 / 10 | (not run) | empty seat | Added a host-walk
fallback test |
| 2 | 7 / 8 / 10 / 9 | (not run) | empty seat | Dropped new core exports
so the SDK works on core 1.82.0; made the fallback test's pattern fail
on every native engine; removed `as` casts |
| 3 | 10 / 9 / 10 / 10 | (not run) | empty seat | Tests now check which
grep path ran |
| 4 | 10 / 10 / 10 / 10 | 9 / 9 / 10 / 9 | empty seat | None (passed) |

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

Workspace grep can now find more common template, build, and lock files
by default. `SandboxFilesystem` can also search extra file types when
you configure `textExtensions`.

## Changes

- Added `.erb`, `.hbs`, `.handlebars`, `.haml`, `.slim`, `.ejs`,
`.mustache`, `.jinja`, `.j2`, `.twig`, `.cshtml`, `.gemspec`, `.lock`,
`.proto`, `.gradle`, and `.properties` to the built-in text-extension
list.
- Added optional `textExtensions` to `SandboxFilesystemOptions`.
`SandboxFilesystem` uses `LocalFilesystem` to classify files, including
on native and fallback grep paths.
- Added tests for supported extensions, targeted file searches, and
excluded binary formats.

## Validation

The PR description reports that the new core and SDK tests each passed 4
tests after failing 3 before the change. It also reports passing
targeted suites and type, lint, import, and peer-dependency checks. Full
core and SDK suites were not run.

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

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:18:11 -05:00
mastra-platform[bot]
023455e2d4
fix(mastracode): default build and plan modes to gpt-5.6-sol (#29940) 2026-11-10 12:53:32 -08:00
Aamish
ec60314974
fix(code-sdk,core): keep surrogate pairs whole when truncating tool output (#29473)
Co-authored-by: Aamish <your@email.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 12:34:43 -08:00
dane-ai-mastra[bot]
779d2875b1
chore: version packages (alpha) (#29912)
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-studio@1.4.0-alpha.1


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


## @mastra/mcp-apps-components@0.1.0-alpha.5


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


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


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


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


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


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


## create-factory@0.4.3-alpha.5


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


## mastracode@0.50.0-alpha.5


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


## mastra@1.39.0-alpha.5


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


## @mastra/libsql@1.30.0-alpha.2


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


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


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


## create-mastra@1.39.0-alpha.5


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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-10 10:50:08 -08:00
Damien Schneider
9730315a2f
perf(core): refresh remote model catalogs in the background (#29432)
## Description

**─────── TLDR ───────**
> Reopening a model list no longer waits for the 6 MB models.dev catalog
to download again: calls answer from the last download.

Settings › Models, the status-bar model picker, `/web/config/models`,
provider access and the session model tools all read
`AgentController.listAvailableModels()`. Its cache lasted 10 s, so most
calls after a short idle waited for models.dev and Netlify to download
one after the other, then for one auth check per provider.

The router's default gateways (models.dev, Netlify, Mastra) now keep
their last good download. A call that finds it older than 5 minutes
starts a new one and returns without waiting. Configured gateways and
the per-provider auth check keep the 10 s window, because they read
state the app changes at runtime (stored credentials, custom providers,
logins).

### Behavior changed

a model list opened more than 10 s after the last one
&nbsp;&nbsp;├─ **was** — waits for models.dev and Netlify to download
again
&nbsp;&nbsp;└─ **now** — answers from the last download in about 10 ms

a model just published on models.dev
&nbsp;&nbsp;├─ **was** — listed within 10 s
&nbsp;&nbsp;└─ **now** — listed within about 5 minutes, downloaded in
the background

models.dev is down when a refresh is due
&nbsp;&nbsp;├─ **was** — its providers drop out of the list until it
answers
&nbsp;&nbsp;└─ **now** — the last good catalog stays; a call a minute
later retries

an app stores a key, then calls `invalidateAvailableModelsCache()`
&nbsp;&nbsp;├─ **was** — the next call downloads models.dev again
&nbsp;&nbsp;└─ **now** — it rechecks configured gateways and auth only

Factory in local mode, deleting a saved API key
&nbsp;&nbsp;├─ **was** — the provider stays connected until the server
restarts
&nbsp;&nbsp;└─ **now** — disconnected in the same response

Factory or TUI, deleting a saved key that overrode the key the server
was started with
&nbsp;&nbsp;├─ **was** — that key is gone too, and the provider shows as
not set
&nbsp;&nbsp;└─ **now** — the provider goes back to that key

The last two were separate bugs. Saving a key exports it to its env var
(`AuthStorage.setStoredApiKey`), overwriting any value already there,
and the delete route only removed it from `auth.json`, so model auth
kept finding it. `AuthStorage` now records each key it exports, from
`setStoredApiKey` or `loadStoredApiKeysIntoEnv`, with the value the
variable held before. `AuthStorage.removeStoredApiKey(provider)` puts
that value back, or unsets the variable if it had none, and leaves a
variable that changed since the export. It needs no env var name, so the
Factory delete route doesn't read the model catalog to find one. The TUI
`/api-keys` command had the old unset logic inline and uses it too. Both
Factory key routes now invalidate the catalog. OAuth sign-in and
sign-out in local mode still don't, and the 10 s window covers them as
it does today.

Two smaller changes ride along. Calls that arrive together share one
build: on a cold cache, Factory's `buildModelCatalog` used to start two
full rebuilds in the same request. Use counts are read on every call
instead of being frozen with the cache, and the built list is reused
while the catalog and the counts are unchanged, so a warm call stays at
~0.05 ms.

### Shape changed

| | | |
|---|---|---|
| **+** | `ModelCatalogCache` | internal: the two refresh speeds and one
shared build |
| **+** | `GatewayManager.fetchGatewayProviders` | split from
`listProviders`; tells a failure apart from `{}` |
| **+** | `GatewayManager.mergeProviders` · `listModelsForProviders` |
split from `listAvailableModels`; merges cached providers without
refetching |
| **+** | `AuthStorage.removeStoredApiKey` | undoes `setStoredApiKey`
and restores the value it overrode; the TUI had it inline |

### Decisions

- **only the default gateways get the slow schedule** — their model
lists don't depend on credentials; configured ones read credentials at
runtime; one `Set` entry if one should join
- **refresh on the next call, no timer** — an idle server downloads
nothing; a timer would need shutdown wiring in every host
- **no catalog warm-up at Factory startup** — it would download 6 MB on
every boot, tests included; the first call still waits
- **one cache per controller, not per process** — Mastra Code runs one
controller per process, so sharing saves nothing and would add module
state every test has to reset
- **exports are tracked per process, not in `auth.json`** —
`process.env` is per process, and a key loaded at startup is recorded by
`loadStoredApiKeysIntoEnv`

### Gain

Measured from my machine against the real models.dev, where one download
takes about 300 ms (two runs each):

> ██████████████████ **main**, a call after 11 s idle `531–576 ms`
> █ **this branch**, same call `8–12 ms`
> ██████████████ **main**, a call after
`invalidateAvailableModelsCache()` `292–435 ms`
> █ **this branch**, same call `5–6 ms`

The first call drops from 639–1,093 ms to about 420 ms, since models.dev
and Netlify now download in parallel. On a slow link each `main` row
pays a full download: the earlier Shipyard run measured 1.1–14.6 s per
rebuild.

## Related issue(s)

None. This came out of a performance pass on Settings › Models.

## Type of change

- [x] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [x] Performance improvement
- [ ] Test update

## Checklist

- [ ] I have linked the related issue(s) in the description above
- [x] I have made corresponding changes to the documentation (if
applicable)
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have addressed all Coderabbit comments on this PR

---

> ██████████████████ **tests** `+331 −10` — 53% of the additions
> ███████████████ **source** `+268 −47`
> █ **changeset** `+22`
> █ **docs** `+4 −2`

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: Damien Schneider <damienschneider@damiens-MacBook-Pro.local>
2026-11-10 10:22:09 -08:00
Max Katz
b3801a79d3
feat(factory): default new factories to the Mastra Gateway (#29183)
New factories can run on the Mastra Gateway in one click instead of
bringing provider keys. Factory already signs users in with their Mastra
account, so **Connect Mastra Gateway** creates a gateway key on the
user's Mastra organization (as that user) and stores it with the
Factory's model credentials. Every `mastra/...` model then runs on the
organization's Mastra credits, and new setups start on Claude Opus 5.5.

The gateway option says what it bills and how much is left. At $0,
Factory says so where you pick the model, in Settings and on a failed
run, with **Add credits** opening the organization's add-credits page on
Mastra in a new tab (the same page the CLI uses). The balance is read
again when you come back to Factory.

## Before / After

Dark mode, local Factory signed in through local Platform. Before is
`main`.

**Choosing a provider**

| Before | After |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/9ba10a45-e43b-48c6-87ab-2093cc7bbd87"
width="420"> | <img
src="https://github.com/user-attachments/assets/51510a44-6023-4c75-ab81-42fceeb7c5de"
width="420"><br>Onboarding |
| <img
src="https://github.com/user-attachments/assets/2f5ebaab-990c-4ac6-8db2-af64bbc74c4e"
width="420"> | <img
src="https://github.com/user-attachments/assets/8696d2fd-b1f2-4b07-83bf-496de71cc538"
width="420"><br>New factory palette |
| <img
src="https://github.com/user-attachments/assets/c2493dd8-16b6-49be-8bcf-ee0b1a5974ee"
width="420"> | <img
src="https://github.com/user-attachments/assets/61b3447e-a5eb-4ca5-b928-50252c516019"
width="420"><br>Settings › Models › Add provider |
| <img
src="https://github.com/user-attachments/assets/022cb25b-de82-4834-abaf-ec76ca07b5d6"
width="420"> | <img
src="https://github.com/user-attachments/assets/a924bee2-1d76-4719-9e2c-90c86a6bd2e7"
width="420"><br>Settings, connected |

**After connecting, and at $0** (the $0 balance is stubbed locally)

| With credits | No credits left |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/a60e9bd2-bc0e-4db2-a252-b2c3fe084314"
width="420"><br>Starts on Claude Opus 5.5 | <img
src="https://github.com/user-attachments/assets/d3bce67b-3e8a-401f-80c6-63a4e7ac4d14"
width="420"><br>Add credits opens Mastra in a new tab, Continue stays
enabled |
| <img
src="https://github.com/user-attachments/assets/9f3d0b6d-1c16-4476-ac7b-fa113e0f3238"
width="420"><br>The option at $0, before connecting | <img
src="https://github.com/user-attachments/assets/f402c60d-db14-4247-9370-1ac439cdce03"
width="420"><br>Settings |
| <img
src="https://github.com/user-attachments/assets/4b58590b-80d9-427c-999e-b11576231efe"
width="420"><br>New factory palette | <img
src="https://github.com/user-attachments/assets/c60c0556-e7a6-451e-bc54-83c46646c776"
width="420"><br>A run at $0 (from Damien's stubbed run) |

## What changed

- `POST /web/config/providers/mastra/connect` creates the key on Mastra
as the signed-in user (new `MastraAuthStudio.fetchAsRequestUser`), only
when their Mastra session is on the Factory's organization, and stores
it as the scope's `mastra-gateway` credential (org-wide for admins, or
personal). Keys are labeled `Factory · Shared` or `Factory · <email>`.
`GET .../mastra/credits` reads the balance the way the dashboard does.
- Model resolution uses the tenant's own gateway key for `mastra/...`
models (the server key still works as before), web search included. The
catalog lists the gateway's models once a scope has a key.
- UI: the gateway is listed first under Recommended in onboarding, the
new factory palette and Settings, with its billing line; one-row "No
gateway credits left" warning; a gateway-specific run error for the
gateway's 402. Members who aren't Mastra admins are told to ask an
admin.

No Platform changes.

## Scope

- Adding credits happens on Mastra, not inside Factory. A shared credits
component for both is a separate piece of work.
- Factory gets its key from Gateway project provisioning
(`/v1/gateway/projects/provision`), the same v1 project key the CLI
creates, because organization (v2) keys aren't released yet. Each
connect creates a small `Factory · …` project on Mastra, and removing
the gateway in Factory doesn't revoke its key there.
- Not covered: orgs that bring their own provider keys to the gateway
(no credits needed) still see the $0 warning.
- Not verified: a model run through the hosted gateway with a key
Factory created (a local Platform key isn't valid there). Everything up
to the model call was run against local Platform.

## Testing

1. Sign in to Factory with a Mastra account. On a fresh org,
`/onboarding` › company account › Model shows Mastra Gateway with the
balance; **Connect Mastra Gateway** goes to the model picker on Claude
Opus 5.5.
2. Mastra shows a new `Factory · Shared` key; Settings › Models shows
Mastra Gateway · Key saved and `mastra/...` models in the pickers.
3. With $0, the model step, Settings and the new factory palette show
"No gateway credits left"; **Add credits** opens
`projects.mastra.ai/add-credits/<org>` in a new tab, and the warning
clears after adding credits and coming back.
4. A run on a gateway model at $0 shows "Out of Mastra Gateway credits"
with Add credits, Continue and Change model.

Fixes PLTFRM-2941



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

## ELI5

Factory users can connect Mastra Gateway and use their organization’s
Mastra credits to run models. Factory shows the available balance and
provides guidance when credits run out.

## What changed

- Added Mastra Gateway connection options to onboarding, Factory
creation, and provider settings.
- Set Claude Opus 5.5 as the preferred model for new Gateway setups.
- Added credit balance details, zero-credit warnings, an Add credits
action, and guidance for members who cannot add credits.
- Added Gateway-specific run errors and recovery options for exhausted
credits.
- Added Factory routes to create user- or organization-scoped Gateway
credentials and read credit balances. Removing a credential in Factory
does not revoke the Mastra key.
- Updated model routing so `mastra/...` models use a tenant’s stored
Gateway key when available, with the server key as fallback.
- Updated Gateway routing to skip custom-provider lookup when a model
uses Mastra Gateway.
- Added `MastraAuthStudio.fetchAsRequestUser` and Factory route support
for Platform requests made as the signed-in user.

## Validation

The PR description reports tests with a stubbed API and route tests. It
does not report verification against a live Mastra Platform or Stripe.
CI and build results are not available.

## Scope

44 files changed: 1,377 lines added and 59 removed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Damien Schneider <damien.schneider01@gmail.com>
2026-11-10 20:19:40 +04:00
dane-ai-mastra[bot]
7c4dd88400
chore: version packages (alpha) (#29889)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-10 15:48:17 +01:00
dane-ai-mastra[bot]
6deb16047f
chore: version packages (alpha) (#29719)
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/slack@1.9.0-alpha.0


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


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


## mastracode@0.50.0-alpha.3


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


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


## @mastra/mcp-apps-components@0.1.0-alpha.3


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


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


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


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


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


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


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


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


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


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


## create-factory@0.4.3-alpha.3


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


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


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


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


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


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


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


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


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


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


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


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


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


## mastra@1.39.0-alpha.3


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


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


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


## @mastra/fastembed@1.3.7-alpha.0


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


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


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


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


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


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


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


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


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


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


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


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


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


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


## create-mastra@1.39.0-alpha.3


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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-10 10:33:29 +01:00
mastra-platform[bot]
f6bd8089ba
fix(code-sdk): explain sandbox reads outside the workspace and document scratch worktrees (#29821)
> Opened by @DSchau

Closes #29812

## Problem
In a Factory sandbox, file tools treat absolute paths as
workspace-relative: `/tmp/x/a.ts` resolves to `<workdir>/tmp/x/a.ts`.
Agents that create scratch git worktrees under `/tmp` (with `git
worktree add /tmp/...`) then get a plain `File not found` when they read
those files, with no hint about why. The new worktrees also have no
`node_modules`, so tests can't run until the agent works out how to
install dependencies.

## Fix
- **Clearer not-found error:** when `stat` or `readFile` misses on an
absolute path outside the workdir and that path does exist in the
sandbox, the error now says what happened. Example: `File not found:
/tmp/x/a.ts (resolved to <workdir>/tmp/x/a.ts). File tools only reach
files under <workdir>; absolute paths are workspace-relative. Put
scratch worktrees under <workdir>/.worktrees/.` Other misses keep the
plain error. Both the native sandbox filesystem and the shell-based
fallback get the fix. `stat` needs it because `view` calls `stat` before
`readFile`.
- **Instructions:** the sandbox filesystem instructions now tell agents
to create scratch worktrees under `<workdir>/.worktrees/`, run `pnpm
install --prefer-offline --frozen-lockfile` in them, and build the
dependencies they test against with `pnpm turbo build
--filter="<package>^..."`.

## Test plan
- New tests in `mastracode/sdk/src/agents/sandbox-filesystem.test.ts`:
- The error explains the miss from both `readFile` and `stat`, on the
shell-based and native filesystems.
  - The plain error is kept when the path exists nowhere.
  - The instructions mention the worktree recipe.
- `vitest run src/agents/sandbox-filesystem.test.ts`: 69/69 pass. The
`stat` tests fail without the fix.
- `tsc --noEmit` and oxlint are clean.

---------

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-09 20:01:44 -08:00
Tyler Barnes
6bd8cc4c05
fix(code-sdk): name the closest saved peer when agent_signal_send gets an id no saved peer has (#29840) 2026-11-09 20:24:46 -07:00
NikAiyer
94d6258078
feat(mastracode): add mouse support to pickers and the input box (#29701)
This adds opt-in mouse support to the Mastra Code TUI without taking
over the terminal's own scrolling and text selection.

There's a new **Mouse** row in `/settings` with four choices: Off (the
default), Dialogs only, Input box only, and Dialogs + input box.
Everything here is opt-in: with Mouse at Off, MC never turns on mouse
tracking, never sends cursor position queries, shows no status
indicator, and leaves any stray mouse input untouched, so the TUI
behaves exactly as it did before. Changes to the setting apply right
away.

With dialogs on, you can click a row in dialogs and slash command
suggestions to pick it (same as Enter, or toggling the checkbox in
multi-choice lists), scroll with the wheel, and see a hover marker on
the row a click will hit. This covers the model picker,
`/threads`/`/resume`, `/github` PR lists, `/login`, `/mcp`, `/settings`,
`/om` and the other list dialogs. The mouse is only captured while a
dialog or suggestion list is open, so the transcript scrolls and selects
natively the rest of the time. Pointer rows are lined up with a cursor
position query, so clicks land on the right row even when the inline
render has drifted from the bottom of the screen.

With the input box on, typing or editing captures the mouse so you can
click to move the cursor and drag to select (the selection is copied via
OSC 52, and typing or Backspace replaces it). Sending a message, a wheel
tick, or a click outside the box hands the mouse back to the terminal.
The status line shows `mouse mode: auto` / `mouse mode: off` on the
right while it's enabled.

This reads a few private pi-tui fields (safe while it's pinned at
0.80.6), and a new shape test fails if an upgrade moves them. Test plan:
unit tests with headless xterm for hit-testing, selection and the mode
rules, e2e scenarios for modal/autocomplete clicks and input mouse mode
(each opting in through the setting), mutation checks on the new rules,
and manual checks in tmux and a real terminal.


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

## ELI5
Mastra Code now lets users choose where the mouse works: in menus, in
the input box, or in both. Mouse support is off by default, so users can
keep using the keyboard or turn mouse support on in settings.

## Summary
- Added four mouse settings: Off, Dialogs only, Input box only, and
Dialogs + input box. Changes apply immediately.
- When dialog mouse support is enabled, users can click dialog and
slash-suggestion rows, scroll lists, and hover to mark a row.
- When input-box mouse support is enabled, users can click to position
the cursor and drag to select text. Releasing a selection copies it
through OSC 52.
- Scrolling or clicking outside the input box returns mouse control to
the terminal. Sending a message also disables input mouse mode.
- Added a mouse controller for event handling, hit-testing,
cursor-position replies, and cleanup. Added a status-line indicator for
input mouse mode.
- Updated picker and selector components for mouse activation. Added
unit and E2E coverage, mouse-event helpers in the E2E harness, and a
test for the `pi-tui` internals used by this feature.
- Test and CI results: not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: review <review@local>
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-09 11:34:25 -08:00
dane-ai-mastra[bot]
009f632534 chore: version packages 2026-11-09 04:19:07 +00:00
dane-ai-mastra[bot]
f21e0742ce chore: version packages 2026-11-07 04:18:11 +00:00
Damien Schneider
8d07b0b293
feat(factory): live Mistral dictation, Slack voice clip failure card, and voice fixes (#29573)
## Description

**─────── TLDR ───────**
> With Mistral, the Factory composer now writes your words while you
speak, and a Slack voice clip that can't be transcribed tells its sender
why instead of reaching the agent.

This is the one follow-up to the voice stack (#29363, #29366, #29372):
live dictation, the fixes the reviews turned up, and three dedups. It
also brings `main`'s factory unit tests back: #29317 landed first with a
test importing `factoryMemorySettingsUserId`, which #29366 renamed to
`factoryProjectSettingsUserId`.

### Behavior changed

composer mic, Mistral chosen
&nbsp;&nbsp;├─ **was** — records, and the text lands after you stop
&nbsp;&nbsp;├─ **now** — words appear in the draft as you speak
&nbsp;&nbsp;├─ **if Mistral won't mint a token for a key that still
works** — records a clip with the same key, like before
&nbsp;&nbsp;└─ **if the key is rejected or out of credit** — says so
before the mic opens

composer mic, any other provider
&nbsp;&nbsp;└─ **unchanged** — records a clip and transcribes it on stop

a Slack voice clip that can't be transcribed
&nbsp;&nbsp;├─ **was** — stays attached; the agent reads a note and may
relay it
&nbsp;&nbsp;└─ **now** — dropped; a card only the sender sees says why

a Slack message that was only failed clips
&nbsp;&nbsp;├─ **was** — the agent runs, and a new thread starts a
session
&nbsp;&nbsp;└─ **now** — no run, just the card

a member dictating more than 20 times in a minute
&nbsp;&nbsp;└─ **new** — 429 `voice_rate_limited` with `Retry-After`,
before the mic opens

For a missing, rejected or out-of-credit key the card has an **Open
voice settings** button to
`/factories/<id>/settings/models#voice-input`; for a busy or slow
provider it says to send the clip again shortly. A recorded dictation
counts once against the limit: the live-session check for a batch
provider doesn't charge.

### Fixes

> speech-to-text calls stop after 1 minute and retry once, instead of up
to 10 minutes and 2 retries
> a stored OpenAI key no longer sends the server's `OPENAI_ORG_ID` /
`OPENAI_PROJECT_ID`
> picking Deepgram works: `@mastra/voice-deepgram` stopped sending
`diarize=undefined`
> `recordMicrophoneToFile` labels Safari clips `.m4a` and releases the
mic when recording can't start
> web transcription errors show the same fixed reason as Slack, never
the provider's text

### Shape changed

| | | |
|---|---|---|
| **+** | `POST /web/voice/live-session` | mints the Mistral token;
answers `batch` for other providers |
| **+** | `STTModel.realtimeModel` | only Mistral has one, so the
registry decides live mode |
| **−** | Factory's own recorder | `@mastra/react`'s
`recordMicrophoneToFile`, fixed, replaces it |
| **~** | thread → Factory lookup | 3 copies become `threadRunBinding`
in `session-threads.ts` |
| **~** | `loose()` | 26 copies become one in `routes/route.ts` |
| **~** | drawer placement | 4 copies become `useSidePanelDrawer()` |

new surface the browser and other packages now rely on
&nbsp;&nbsp;&nbsp;&nbsp;`{ mode: 'batch' } | { mode: 'live', url, token,
expiresAt }` · `transcriptionFailureReason(error)` ·
`voiceRateLimiter()` · `voiceClipFailureCard(report, retryHint)`

### Decisions

- **the browser streams to Mistral directly** — a token keeps audio off
Factory and the key on it; it lasts ~15 minutes, one model only
- **the limit lives in memory per process** — nothing shared exists yet;
each replica allows 20 a minute
- **a stored OpenAI key drops the env org/project** — those vars belong
to the `OPENAI_API_KEY` account; one comparison to undo

### Watch

> [!WARNING]
> Live dictation opens `wss://api.mistral.ai` and loads its capture
worklet from a `blob:` URL. Nothing in `mastracode/` sets a
Content-Security-Policy today, but <mark>a CSP added later has to allow
both</mark> or the mic stops connecting.

### Not verified

- [ ] the composer in a real browser — capture and live text run in MSW
tests with a fake `AudioContext`; real Mistral ran from a script driving
the same `liveDictation.ts`, 19 deltas and the exact sentence back
- [ ] the card in a real Slack thread — rendered and unit-tested only
- [ ] a real out-of-credit response — the wording comes from
`classifyProviderError` on a simulated 429 `insufficient_quota`

---

> ██████████████████ **tests** `+1095 −212` — 54% of the additions
> ███████████████ **source** `+912 −376`
> █ **changeset** `+24`
> █ **docs** `+2 −2`

## Related issue(s)

No issue. Follow-up to #29363, #29366 and #29372.

## Type of change

- [x] Bug fix (non-breaking change that fixes an issue)
- [x] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [x] Code refactoring
- [ ] Performance improvement
- [ ] Test update

## Checklist

- [ ] I have linked the related issue(s) in the description above
- [x] I have made corresponding changes to the documentation (if
applicable)
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have addressed all Coderabbit comments on this PR





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

## ELI5
Factory can show words as someone speaks when they use a supported
Mistral model. If transcription fails, Slack now tells the sender what
happened and removes the failed clip so it does not reach the agent.

## What changed
- Added live Mistral dictation to the Factory composer. Other providers
use batch transcription. If live setup falls back, Mistral also uses
batch transcription.
- Added `POST /web/voice/live-session`. The server checks Mistral
credentials before recording and applies a per-process limit of 20 voice
requests per member per minute. Requests over the limit return `429`
with `Retry-After`.
- Changed Slack voice-clip failures to remove failed clips and send the
sender a private failure card. Messages with no remaining content do not
start an agent run.
- Reduced speech-to-text timeouts to one minute and configured one
retry. OpenAI organization and project IDs are omitted when the request
uses a stored key.
- Fixed Deepgram requests that included unset options. Improved
recording MIME types, file extensions, and microphone cleanup.
- Standardized web transcription error messages. Consolidated route
context casting and thread-to-Factory lookup, and added a shared drawer
configuration helper.

## Validation
- Added or updated tests for live dictation, voice routes, Slack failure
cards, rate limiting, transcription retries, Deepgram options, and
microphone recording.
- The author reports testing browser capture and live text with MSW and
a fake `AudioContext`, and testing `liveDictation.ts` against Mistral.
The live composer was not verified in a real browser.
- A real Slack thread card and a real out-of-credit response were not
verified.
- Current-head build, test, and CI results: not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-05 23:57:25 +01:00
mastra-platform[bot]
592a9071ca
feat(mastracode): add Mistral Voxtral as a speech-to-text provider (#29363)
## Description

**─────── TLDR ───────**
> Mastra Code can dictate with Mistral Voxtral, and every speech-to-text
provider is now built in one place in `@mastra/code-sdk`.

Voxtral is added to the STT registry by hand, like Deepgram, because the
models.dev STT snapshot doesn't list Mistral. The new
`@mastra/code-sdk/voice/transcribe` module turns a registry entry and a
key into a working transcriber, so the TUI `/voice` command, the Factory
composer (#29366) and Slack voice clips (#29372) all build providers the
same way.

`/voice` with provider `mistral`
&nbsp;&nbsp;└─ **new** — transcribes with `voxtral-mini-latest` on
`MISTRAL_API_KEY` or a stored key

dictating with Groq or another OpenAI-compatible host, no
`OPENAI_API_KEY`
&nbsp;&nbsp;├─ **was** — threw `No API key provided for speech model`
&nbsp;&nbsp;└─ **now** — transcribes with that provider's key alone

NEAR AI key from the environment
&nbsp;&nbsp;├─ **was** — read `NEAR_AI_API_KEY`
&nbsp;&nbsp;└─ **now** — reads `NEARAI_API_KEY`, the name the provider
registry uses

dictating with no key set
&nbsp;&nbsp;├─ **was** — the hint guessed `<PROVIDER>_API_KEY`, wrong
for Alibaba
&nbsp;&nbsp;└─ **now** — names the registry's env var, or only
`/api-keys` when there is none

### Shape changed

new public module `@mastra/code-sdk/voice/transcribe`
&nbsp;&nbsp;&nbsp;&nbsp;`createSTTTranscriber(entry, apiKey)` ·
`resolveSTTApiKey(provider, authStorage?)` · `sttApiKeyEnvVar(provider)`

`@mastra/code-sdk` now owns `@mastra/voice-deepgram`,
`@mastra/voice-mistral` and `@mastra/voice-openai`; `mastracode` drops
them.

### Decisions

- **the transcription key doubles as the speech key** — `OpenAIVoice`
otherwise builds a TTS client from `OPENAI_API_KEY` and throws; one
argument to drop if that changes
- **`NEAR_AI_API_KEY` stops working** — the registry name wins so chat
and voice agree; the changeset tells people to rename it

### Not verified

- [ ] `/voice` → `mistral` in the TUI with a real key; the Factory path
ran Voxtral for real, the TUI only against MSW

---

> ██████████████████ **tests** `+144 −92`
> ███████████████ **source** `+118 −153` — net −35
> ███ **changeset** `+26`

## Related issue(s)

No issue. First step of voice input for the Factory; #29366 and #29372
are stacked on this one, so merge it first.

## Type of change

- [x] Bug fix (non-breaking change that fixes an issue)
- [x] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update

## Checklist

- [ ] I have linked the related issue(s) in the description above
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have addressed all Coderabbit comments on this PR


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

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

## ELI5

Mastra Code can now use Mistral Voxtral to turn speech into text. The
code SDK provides a shared way to choose a speech provider and find its
API key, and the TUI uses that shared path.

## Changes

- Added `mistral` and the `voxtral-mini-latest` model to the
speech-to-text registry.
- Added `@mastra/code-sdk/voice/transcribe` with `createSTTTranscriber`,
`resolveSTTApiKey`, and `sttApiKeyEnvVar`.
- Added support for Deepgram, Mistral, OpenAI, and OpenAI-compatible
transcription. Calls time out after two minutes.
- Updated the TUI voice transcription flow to use the SDK transcriber
and registry-based credential hints.
- Added `providerApiKeyEnvVar` to derive API-key environment variable
names from the provider registry.
- Moved Deepgram, Mistral, and OpenAI voice dependencies to
`@mastra/code-sdk` and removed the duplicate TUI dependencies.
- Added changesets for the SDK transcriber and Voxtral support.

## Validation

The diff adds SDK transcription tests and updates TUI voice tests.
Completed test or CI results 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>
Co-authored-by: Damien Schneider <damien.schneider01@gmail.com>
2026-11-05 19:51:14 +01:00
dane-ai-mastra[bot]
675caf0613
chore: version packages (alpha) (#29336)
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/client-js@1.60.0-alpha.0


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


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


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


## mastra@1.39.0-alpha.0


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


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


## @mastra/mcp-apps-components@0.1.0-alpha.0


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


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


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


## @mastra/clickhouse@1.30.0-alpha.0


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


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


## @mastra/pg@1.36.0-alpha.0


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


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


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


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


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


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


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


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


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


## create-factory@0.4.3-alpha.0


## mastracode@0.49.1-alpha.0


## @mastra/arize@1.3.30-alpha.0


## @mastra/arthur@0.4.30-alpha.0


## @mastra/braintrust@1.3.27-alpha.0


## @mastra/datadog@1.4.22-alpha.0


## @mastra/deepeval@0.1.24-alpha.0


## @mastra/laminar@1.3.32-alpha.0


## @mastra/langfuse@1.6.6-alpha.0


## @mastra/langsmith@1.4.3-alpha.0


## @mastra/observability@1.23.2-alpha.0


## @mastra/otel-bridge@1.5.22-alpha.0


## @mastra/otel-exporter@1.5.2-alpha.0


## @mastra/posthog@1.4.7-alpha.0


## @mastra/sentry@1.2.32-alpha.0


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


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


## create-mastra@1.39.0-alpha.0


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


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


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


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


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


## @mastra/redis-streams@0.8.1-alpha.0


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


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


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


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


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


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


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


## @mastra/spanner@1.11.2-alpha.0


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


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


## @mastra/gcs@0.3.6-alpha.0


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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-04 14:40:27 -08:00
Tony Kovanen
4afeceaf2d
feat(pg, libsql): add experimental storage v2 for workflow runs (Postgres and libSQL) (#28299)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: review <review@local>
2026-11-04 21:12:40 +01:00
Damien Schneider
d8f11cb21e
chore(mastracode): run Mastra Code on AI SDK v7 (#28738) 2026-11-03 18:29:32 -08:00
mastra-platform[bot]
f9feb98ba3
fix(core,mcp): keep submitted values out of tool validation logs (#29331)
> Opened by @user_01KN2T7F5T2WYEMHY58VJGPZ8R

Fixes #29318

## Problem
When a tool rejects its input, output, suspend data, or resume data, the
validation error message repeats the submitted values (for example
`Provided arguments: {"email": "person@example.com"}`). That's on
purpose, so the model can see what it sent and fix the call. But the
same message was also written to the logs, which put user data such as
email addresses into log output.

## Change
- **Core** (`tools/validation.ts`, `tool-builder/builder.ts`,
`tool.ts`): a new `getValidationIssuePaths()` helper returns the dotted
field paths that failed validation (or `root` for top-level issues).
Validation-failure logs now contain the tool metadata plus `issuePaths`
and no longer include the full message. This covers input, output,
suspend-data, and resume-data validation.
- **MCP** (`server/server.ts`): the "rejected its input" warnings for
plain tools and `run_` workflow tools log `issuePaths` instead of the
message. `MCP_SERVER_TOOL_EXECUTE_FAILED` no longer puts the serialized
`args` into exception details.
- The error returned to the model or MCP caller is the same as before.

## Tests
- `builder.test.ts`: five new tests (input, resume data, suspend data,
AI SDK tool output, Mastra tool output). Each one checks that no logger
call contains the sensitive value and that `issuePaths` is logged. All
five fail without the fix.
- `server-validation-logging.test.ts`: a new MCP end-to-end test over
HTTP. It checks that the caller still gets the validation error and that
server logs only contain `issuePaths`. It fails without the fix.
- Two existing assertions in `validation.test.ts` expected the old
message in the log. They now expect the sanitized form.
- Results: `packages/core` `src/tools` 531 passed, `tsc` clean.
`packages/mcp` `src/server` 565 passed. One stdio events test failed
only when the full suite ran in parallel; it passed when rerun on its
own.


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

## ELI5

When a tool rejects information, its logs should not repeat the
information people sent. This change logs the tool and the fields that
failed, while keeping errors available to callers.

## Summary

- Updated core validation logs for tool input, output, suspend data, and
resume data. Logs include tool metadata and failing field paths instead
of validation messages that may contain submitted values.
- Added the public `getValidationIssuePaths` helper. It returns dotted
paths, uses `root` for top-level errors, and masks undeclared property
names.
- Updated MCP server validation logs to report failing field paths. MCP
tool-execution failure details no longer include serialized arguments.
- Updated MCP client logs to omit submitted arguments, server error
text, and full error messages or stacks. Output-validation logs report
issue paths. Other error logs use `errorKind`, which filters error names
and codes.
- Sanitized tracked exceptions for remote MCP tool and task failures.
Caller-facing errors remain available.
- Added core and MCP logging tests.
- Raised the minimum `@mastra/core` peer version to `1.82.0-0` for
`@mastra/mcp`, `@mastra/connect`, and `@mastra/code-sdk`.

## Test results

The PR reports 531 passing core tool tests and a clean TypeScript check.
It reports 565 passing MCP server tests. One stdio events test failed in
a parallel full-suite run, then passed when rerun alone.
<!-- 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-04 01:59:48 +00:00
Damien Schneider
6650c2687c
perf(factory): load Factories and their repositories in one request (#29322)
**─────── TLDR ───────**
> The Factory web UI now gets every Factory's repositories from the
project list, so it leaves its page loader after one request instead of
one per Factory.

Until now the UI called `GET /web/factory/projects`, then `GET
/web/factory/projects/:id/source-control-connections` for each Factory,
and stayed on the loader until the slowest one answered. Each of those
ran at least 8 queries plus 2 per linked repository, mostly one after
another, and under load that endpoint reached 20 s (#29248). The list
now returns each project's `repositories`, read in the same number of
queries for one Factory as for twenty.

### Behavior changed

opening the Factory web UI in an org with several Factories
&nbsp;&nbsp;├─ **was** — the loader waits for the list, then one request
per Factory
&nbsp;&nbsp;└─ **now** — the loader waits for the list alone

a Factory whose GitHub App was uninstalled
&nbsp;&nbsp;└─ **unchanged** — its orphaned connection is skipped, the
list still loads

`/factory` in the TUI
&nbsp;&nbsp;├─ **was** — the list, then one request per project
&nbsp;&nbsp;└─ **now** — one request; an older server still gets one per
project

`mastra api` printing the project-list response schema
&nbsp;&nbsp;├─ **was** — project fields only
&nbsp;&nbsp;└─ **now** — each project with its `repositories`

### Shape changed

what an API caller or a storage implementor now lives with
&nbsp;&nbsp;&nbsp;&nbsp;`projects[].repositories[]` on `GET
/web/factory/projects` · `ProjectListRepository` from
`@mastra/factory/routes/contracts` · `connections.listWithRepositories({
orgId, factoryProjectIds })` on every source-control storage handle

Each entry carries the link and repository fields
(`projectRepositoryId`, `connectionId`, `integrationId`, `repositoryId`,
`externalId`, `slug`, `defaultBranch`, `branch`, `sandboxWorkdir`),
never the installation. `GET
/web/factory/projects/:id/source-control-connections` keeps its
response, installation included, and reads through the same storage
call.

### Decisions

- **repositories ride on the project list, no batch endpoint** — every
client already waits on that list; a `?projectIds=` batch route is the
undo
- **per-project fallback in the SDK only** — the web UI ships with its
server, the TUI meets any version; delete it once old servers are gone

### Gain

With GitHub and GitLab linked, the list reads in 9 queries whether the
org has one Factory or twenty (LibSQL, real routes, the SDK and web UI
clients calling them over HTTP). Before, the same boot cost the list
plus one connections request per Factory.

### Watch

> [!WARNING]
> With a version-control integration configured, `GET
/web/factory/projects` now reads source-control storage, so <mark>a
source-control storage failure fails the project list</mark> for every
caller, `mastra api` included. The web UI already failed then, through
the per-project call.

### Not verified

- [ ] `listWithRepositories` on Postgres: ran on LibSQL only, no
Postgres here. The read has the same `in` + `orderBy` shape as
`listByProject`, which already runs there
- [ ] page load on a deployed Factory: not re-measured, the 20 s figure
comes from #29248

---

> ██████████████████ **tests** `+930 −974` — 83 files, mostly MSW stubs
moving repositories onto the list
> █████ **source** `+269 −79`
> █ **generated** `+76 −6` — `mastra api` route metadata
> █ **changesets** `+24`



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

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

## ELI5

The Factory project list now includes the repositories linked to each
project. This lets the web UI load projects and repositories together,
while the SDK still supports older servers that return repositories
through a separate request.

## Changes

- Added `repositories` to each project in `GET /web/factory/projects`
and defined the `ProjectListRepository` response contract.
- Added `connections.listWithRepositories({ orgId, factoryProjectIds })`
to source-control storage. It returns linked repositories for requested
projects and skips connections whose installations are missing or
outside the organization.
- Reused the storage read for `GET
/web/factory/projects/:id/source-control-connections` without changing
that endpoint’s response.
- Updated the web UI to read repositories from the project list. Updated
the SDK to use embedded repositories when present and fall back to
per-project requests when they are absent.
- Updated storage tests and project-list fixtures to cover the new
response shape and repository loading.

## Notes

- The author reports that the project-list read uses nine queries with
GitHub and GitLab configured, independent of whether the organization
has one or twenty Factories. The query-count comparison was run on
LibSQL; Postgres was not verified.
- Page-load performance on a deployed Factory was not re-measured.
- When a version-control integration is configured, a source-control
storage failure now fails the project-list request.
- Test execution results and review finding counts were not provided.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-04 01:57:13 +01:00
mastra-platform[bot]
b4fdcf59a5
fix(factory): write plans where the Factory UI can render them (#29132)
> Opened by @DSchau

## What

Plans written from Factory **user sessions** showed "The plan could not
be loaded from .mastracode/plans/…" in the Factory UI, with Approve &
build disabled.

**Cause:** the SDK picks the plans directory from `factoryProjectId` in
session state: `.artifacts/plans` when it's set, `.mastracode/plans`
otherwise. Factory user sessions don't have a `factoryProjectId`, so the
agent was told to write to `.mastracode/plans/`. But the Factory UI
(`normalizePlanPath`/`planFileUrl`) and the file route
(`APPROVED_RENDERED_ROOTS = ['.artifacts']`) only read from
`.artifacts/`. Making the UI read `.mastracode/plans/` wouldn't work:
that path is gitignored in many repos, and it sits outside any repo in
multi-repo `/workspace` sessions.

**Fix:**
- New `plansDir` option on `createMastraCode` /
`prepareAgentControllerMount`. When it's set, it takes priority over the
per-session default in:
  - the prompts (tool guidance and the plan-mode prompt)
  - the plan-mode write guard of the default workspace
- `createMastraCodeWorkspaceTools(backgroundToolsEnabled, plansDir)`
lets hosts with their own workspace apply the same guard.
- Factory sets one `FACTORY_PLANS_DIR = '.artifacts/plans'` and uses it
for both the mount's `plansDir` and its own workspace tools (new and
reused workspaces), so the prompt and the guard can't drift.
- `@mastra/core`'s `submit_plan` tool description no longer names
`.mastracode/plans/`. Its example is now `<plans
directory>/add-dark-mode.md`, pointing at the directory the agent's
instructions name. This changes the tool description for every consumer.
- Because the tool no longer names a directory, build-mode prompts now
always include a `submit_plan` section naming the plans directory,
**including the TUI** (`.mastracode/plans/`).
- When a host moves the directory, the section also says never to write
under `.mastracode/plans/`.
- The directory is named with forward slashes, so on Windows the default
(`.mastracode\plans`) is recognised as the default.
  - Explore (`fast`) mode is read-only, so it doesn't get the section.
- **Plan-mode write guard now actually runs.** It read the session from
a `harness` request-context key that nothing in production sets; the
agent controller sets `controller`. So the guard returned early, and
plan-mode writes went anywhere, including in the TUI. It now reads
`controller`.

## Screenshots

These show the real Factory UI `SubmitPlanCard`, rendered with the app's
own styles. The API responses (user session and workspace file) are
stubbed, so this isn't a deployed Factory. The UI code doesn't change in
this PR; what changes is the path the agent submits.

**Before:** the agent wrote to `.mastracode/plans/`. The card never
requests the file, shows "could not be loaded", and disables Approve &
build.

<img
src="c7ad76e6d6/.pr-assets/plan-before.png"
width="640" alt="Plan card showing 'The plan could not be loaded from
.mastracode/plans/ratecard-mvp.md' with Approve & build disabled">

**After:** the agent writes to `.artifacts/plans/`. The card fetches the
file and renders the plan, and Approve & build is enabled.

<img
src="c7ad76e6d6/.pr-assets/plan-after.png"
width="640" alt="Plan card rendering the Ratecard MVP plan with four
steps and Approve & build enabled">

## Proof

- New `mastracode/sdk/src/agents/__tests__/plans-dir.test.ts` (5 tests).
It drives real `getDynamicInstructions` and
`createMastraCodeWorkspaceTools` for a session with no
`factoryProjectId`. It checks that:
  - the build-mode and plan-mode prompts name `.artifacts/plans/`
- the default build-mode prompt names `.mastracode/plans/` with no
"never under" clause
  - a disabled `submit_plan` adds no guidance
- the guard, given a real `RequestContext` with `controller` set, allows
`.artifacts/plans/x.md` and refuses `.mastracode/plans/x.md`
- `tool-guidance.test.ts`:
- With the win32 default (`path.win32.join('.mastracode', 'plans')`),
build-mode guidance names `.mastracode/plans/` with no "never under"
clause.
  - Explore mode gets no plans guidance.
- `index.test.ts`: `config.plansDir` reaches both the instructions
callback and the default workspace callback.
- `factory-disable-builtin-tools.test.ts`: Factory passes `plansDir:
'.artifacts/plans'` to the mount.
- `workspace.test.ts`: a plan-mode write through a newly created and a
reused Factory workspace allows `.artifacts/plans/` and refuses
`.mastracode/plans/`.
- Each piece was reverted on its own and the tests re-run:
  - Reverting `tool-guidance.ts` fails the plans-dir and win32 tests.
  - Reverting the Explore-mode condition fails its test.
  - Reverting the guard's `controller` key fails 4 guard tests.
  - Reverting `utils/plans.ts` fails 3.
  - Reverting `instructions.ts` fails 2.
  - Removing the Factory mount line fails the Factory mount test.
  - Reverting the Factory workspace change fails the workspace test.
- These pass: the SDK prompts, tool-guidance, plan,
mode-available-tools, save-plan and plans-dir suites, core
`submit-plan.test.ts`, plus the Factory `workspace.test.ts` and mount
tests.
- oxlint and `oxfmt --check` are clean on every changed file.

## Unverified

- I didn't reproduce this end to end in a deployed Factory. I didn't
start a user session there and watch the plan card render.
- No native Windows run; the Windows case is covered by calling the
guidance builder with the win32 default.
- I didn't run the TUI in plan mode to watch the now-working guard
refuse a write; it's covered by unit tests against the controller
context shape.

## Risk: low–moderate

- TUI build-mode prompts gain a short `submit_plan` section naming
`.mastracode/plans/`, and the core `submit_plan` description is
directory-neutral. Agents in any host now rely on their instructions for
the plans path.
- The plan-mode guard was effectively off and is now on. TUI plan mode
will refuse `write_file`/`string_replace_lsp` outside the plans
directory, which is the intended behaviour, but it's new to users.
- In Factory, project runs already resolved to `.artifacts/plans`, so
only user sessions change where plans are written. Factory mounts with
`modes: false`, so the guard change there is consistency, not live
behaviour.

---------

Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: mastra-platform[bot] <mastra-platform[bot]@users.noreply.github.com>
2026-11-03 16:54:25 -08:00
dane-ai-mastra[bot]
6e8dfcb83f chore: version - exit prerelease mode 2026-11-03 23:45:58 +00:00
dane-ai-mastra[bot]
4bc3aa672f
chore: version packages (alpha) (#29255)
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.27.0-alpha.3


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


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


## @mastra/mcp@2.8.0-alpha.2


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


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


## @mastra/ring-signals@0.1.0-alpha.0


## @mastra/libsql@1.29.0-alpha.2


## @mastra/mongodb@1.26.0-alpha.2


## @mastra/mysql@0.16.0-alpha.3


## @mastra/pg@1.35.0-alpha.3


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


## @mastra/slack@1.8.1-alpha.0


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


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


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


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


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


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


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


## create-factory@0.4.2-alpha.3


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


## mastracode@0.49.0-alpha.3


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


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


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


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


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


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


## @mastra/sentry@1.2.31-alpha.3


## mastra@1.38.0-alpha.3


## @mastra/connect@1.3.1-alpha.1


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


## @mastra/editor@0.17.0-alpha.3


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


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


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


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


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


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


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


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


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


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


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


## @mastra/turso@0.1.20-alpha.2


## @mastra/inngest@1.11.1-alpha.2


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


## create-mastra@1.38.0-alpha.3


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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-03 13:59:38 -07:00
Aamish
5cdd5da94b
fix(code-sdk): preserve web search for gateway model aliases (#28802)
Fixes https://github.com/mastra-ai/mastra/issues/28801.

Switching from `openai/gpt-5.5` to its equivalent
`mastra/openai/gpt-5.5` route removes provider web search and its
guidance. Anthropic aliases have the same problem.

The search tool now follows the model's transport, resolved once next to
model resolution and shared by the tool list and the prompt guidance:
- `mastra/` alias with a gateway key and no OAuth (Mastra gateway,
OpenRouter chat): `openrouter:web_search`.
- Direct API keys, and Claude or Codex OAuth (native APIs, also through
the gateway): native Anthropic/OpenAI search.
- Other providers: no built-in search, as before. Explicit external
backends and disabled/denied tools still win.

Gateway acceptance of `openrouter:web_search` follows Mastra's own
templates
(`templates/template-starter-agent/src/mastra/tools/web-search.ts`). It
has not been tested against the live gateway.

Guidance lists `web_extract` only when a Parallel or Tavily backend
registers it. In deployed Factory, tenant credential policy is prepared
before tools and instructions pick the route, so they match the model's
transport.

Tests: `web-search-route.test.ts` runs an agent turn per route with a
stubbed `fetch` and checks the tool type in the request body and the
prompt guidance, including tenant-scoped credentials. The gateway and
tenant OAuth cases fail against the previous selection. A new TUI E2E
scenario (`gateway-web-search`) selects a `mastra/` alias with a gateway
key against AIMock and checks the request carries
`openrouter:web_search`; it fails against the previous tool selection.
`@mastra/code-sdk` and `mastracode` typecheck clean.

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

## ELI5
The app now keeps web search available when a model uses a `mastra/`
alias. It selects search tools and prompt guidance based on the model’s
route and credentials, so equivalent model names keep equivalent search
behavior.

## Changes
- Resolve the provider web-search route for both tool registration and
prompt guidance.
- Use `openrouter:web_search` for gateway aliases with a gateway key,
unless Claude or Codex OAuth credentials select native search.
- Use native Anthropic or OpenAI search for direct model IDs and gateway
aliases without a gateway key.
- Preserve configured Parallel or Tavily search tools. Include
`web_extract` guidance only when one of these backends provides it.
- Add route tests for selected tools and prompt guidance, including
tenant-scoped credentials.
- Add a TUI E2E scenario and fixture that verify a gateway request
includes `openrouter:web_search` and excludes native provider search
tools.
- Add a patch changeset for `@mastra/code-sdk`.

## Tests
The supplied context describes route tests and a TUI E2E scenario, but
does not provide test execution results. The gateway route has not been
tested against the live gateway.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Aamish <your@email.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:21:01 -08:00
Aamish
ab07a9a928
fix(code-sdk): accumulate final headless token usage (#28800)
Co-authored-by: Aamish <your@email.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:03:09 -08:00
Aamish
afff9b6059
fix(code-sdk): keep preview defaults out of loaded settings files (#28798)
Co-authored-by: Aamish <your@email.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:52:05 -08: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[bot]
886679eb10
chore: version packages (alpha) (#29205)
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/client-js@1.59.0-alpha.2


## @mastra/factory@0.27.0-alpha.2


## @mastra/code-sdk@1.18.0-alpha.2


## mastra@1.38.0-alpha.2


## @mastra/core@1.82.0-alpha.2


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


## @mastra/server@1.82.0-alpha.2


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


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


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


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


## @mastra/react@1.14.1-alpha.2


## @mastra/deployer-cloud@1.82.0-alpha.2


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


## @mastra/longmemeval@1.1.41-alpha.2


## @mastra/opencode@0.1.41-alpha.2


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


## create-factory@0.4.2-alpha.2


## mastracode@0.49.0-alpha.2


## @mastra/arize@1.3.29-alpha.1


## @mastra/arthur@0.4.29-alpha.1


## @mastra/braintrust@1.3.26-alpha.1


## @mastra/datadog@1.4.21-alpha.1


## @mastra/deepeval@0.1.23-alpha.1


## @mastra/laminar@1.3.31-alpha.1


## @mastra/langfuse@1.6.5-alpha.1


## @mastra/langsmith@1.4.2-alpha.1


## @mastra/observability@1.23.1-alpha.1


## @mastra/otel-bridge@1.5.21-alpha.1


## @mastra/otel-exporter@1.5.1-alpha.1


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


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


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


## @mastra/deployer@1.82.0-alpha.2


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


## @mastra/mcp-docs-server@1.3.12-alpha.3


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


## @mastra/playground-ui@68.0.0-alpha.2


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


## @mastra/elysia@0.1.22-alpha.2


## @mastra/express@1.5.26-alpha.2


## @mastra/fastify@1.5.26-alpha.2


## @mastra/hono@1.7.24-alpha.2


## @mastra/koa@1.7.26-alpha.2


## @mastra/nestjs@0.2.41-alpha.2


## @mastra/next@0.2.40-alpha.2


## @mastra/tanstack-start@0.2.40-alpha.2


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


## @mastra/libsql@1.29.0-alpha.1


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


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


## @mastra/mysql@0.16.0-alpha.2


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


## @mastra/spanner@1.11.1-alpha.0


## @mastra/turso@0.1.20-alpha.1


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


## @mastra/inngest@1.11.1-alpha.1


## @mastra/temporal@0.5.0-alpha.2


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


## create-mastra@1.38.0-alpha.2


## @internal/playground@1.38.0-alpha.2

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-02 20:29:47 -07:00
Ward Peeters
b30fd95abd
Revert "chore(deps): update dependency vscode-jsonrpc to v10" (#29239)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-03 01:14:59 +01:00