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/code-sdk@1.12.0-alpha.9
### Minor Changes
- Added a `--pack <id>` flag to headless mode (`mastracode -p ... --pack
anthropic`). It resolves builtin pack ids and saved custom packs
(`custom:<name>` or bare name), exits with the list of valid packs on
unknown ids, and applies the pack like `/models` → Activate: mode
models, subagent models, model route, and thread `activeModelPackId`. An
explicit `--model` still wins over the pack for the active mode.
([#26691](https://github.com/mastra-ai/mastra/pull/26691))
**Example**
```bash
mastracode -p "summarize this repo" --pack anthropic
mastracode -p "fix the tests" --pack Kimi --model openai/gpt-5.5
```
### Patch Changes
- Fixed per-agent-type subagent model selections
(`subagentModelId_explore/plan/execute`) being stripped from session
state by schema validation. Pack activation (`/models` → Activate or
`--pack`) assigned subagent models, but the next session state update
silently dropped them, so subagents fell back to their default models.
([#26691](https://github.com/mastra-ai/mastra/pull/26691))
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
## mastracode@0.46.0-alpha.9
### Minor Changes
- Added a `--pack <id>` startup flag to the interactive TUI. It accepts
a builtin pack id (`anthropic`, `openai`, `github-copilot`) or a saved
custom pack by `custom:<name>` or bare name. Unknown ids fail fast with
the list of valid packs. Startup uses the pack's models for the session
and saves the pack as the global default. `--pack` takes precedence over
`MASTRACODE_MODEL_ID`.
([#26691](https://github.com/mastra-ai/mastra/pull/26691))
**Example**
```bash
mastracode --pack anthropic
mastracode --pack custom:Kimi
mastracode --pack Kimi
```
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`fdd4587`](fdd4587842),
[`fdd4587`](fdd4587842),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
- @mastra/code-sdk@1.12.0-alpha.9
## @mastra/e2b@0.13.0-alpha.3
### Minor Changes
- Added a `reattach` option to `RailwaySandbox`, `PlatformSandbox`, and
`E2BSandbox` to control what happens when a persisted `sandboxId` can't
be reattached on `start()`.
([#26675](https://github.com/mastra-ai/mastra/pull/26675))
- `'best-effort'` (default, unchanged behavior): carry on without the
lost sandbox. Railway and Platform provision a replacement; E2B first
looks for another sandbox with the same logical `id` and only creates a
new one if none is found.
- `'required'`: throw a `SandboxError` with code
`SANDBOX_REATTACH_FAILED` instead, so the caller can tell the user their
previous sandbox (and its state) is gone rather than silently starting a
fresh one.
Transient errors such as auth, rate limit, or network failures still
propagate unchanged. Clones inherit the parent's `reattach` setting.
```ts
const sandbox = new RailwaySandbox({ sandboxId: session.sandboxId,
reattach: 'required' });
try {
await sandbox.start();
} catch (error) {
if (error instanceof SandboxError && error.code ===
'SANDBOX_REATTACH_FAILED') {
// Previous sandbox is gone: ask the user to start fresh, then clear the
persisted sandboxId.
}
}
```
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
## @mastra/platform-workspace@1.7.0-alpha.2
### Minor Changes
- Added a `reattach` option to `RailwaySandbox`, `PlatformSandbox`, and
`E2BSandbox` to control what happens when a persisted `sandboxId` can't
be reattached on `start()`.
([#26675](https://github.com/mastra-ai/mastra/pull/26675))
- `'best-effort'` (default, unchanged behavior): carry on without the
lost sandbox. Railway and Platform provision a replacement; E2B first
looks for another sandbox with the same logical `id` and only creates a
new one if none is found.
- `'required'`: throw a `SandboxError` with code
`SANDBOX_REATTACH_FAILED` instead, so the caller can tell the user their
previous sandbox (and its state) is gone rather than silently starting a
fresh one.
Transient errors such as auth, rate limit, or network failures still
propagate unchanged. Clones inherit the parent's `reattach` setting.
```ts
const sandbox = new RailwaySandbox({ sandboxId: session.sandboxId,
reattach: 'required' });
try {
await sandbox.start();
} catch (error) {
if (error instanceof SandboxError && error.code ===
'SANDBOX_REATTACH_FAILED') {
// Previous sandbox is gone: ask the user to start fresh, then clear the
persisted sandboxId.
}
}
```
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
## @mastra/railway@0.10.0-alpha.0
### Minor Changes
- Added a `reattach` option to `RailwaySandbox`, `PlatformSandbox`, and
`E2BSandbox` to control what happens when a persisted `sandboxId` can't
be reattached on `start()`.
([#26675](https://github.com/mastra-ai/mastra/pull/26675))
- `'best-effort'` (default, unchanged behavior): carry on without the
lost sandbox. Railway and Platform provision a replacement; E2B first
looks for another sandbox with the same logical `id` and only creates a
new one if none is found.
- `'required'`: throw a `SandboxError` with code
`SANDBOX_REATTACH_FAILED` instead, so the caller can tell the user their
previous sandbox (and its state) is gone rather than silently starting a
fresh one.
Transient errors such as auth, rate limit, or network failures still
propagate unchanged. Clones inherit the parent's `reattach` setting.
```ts
const sandbox = new RailwaySandbox({ sandboxId: session.sandboxId,
reattach: 'required' });
try {
await sandbox.start();
} catch (error) {
if (error instanceof SandboxError && error.code ===
'SANDBOX_REATTACH_FAILED') {
// Previous sandbox is gone: ask the user to start fresh, then clear the
persisted sandboxId.
}
}
```
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
## @mastra/sprites@0.1.0-alpha.0
### Minor Changes
- Added `@mastra/sprites`, a workspace sandbox provider for [Fly.io
Sprites](https://sprites.dev). `SpritesSandbox` gets or creates a Sprite
by name, so files persist across sessions, and runs commands with
streaming output, timeouts, cancellation, and background processes with
stdin. `stop()` keeps the Sprite, `destroy()` deletes it, and
`snapshot()` captures a checkpoint. Requires Node.js 24 or later.
([#26650](https://github.com/mastra-ai/mastra/pull/26650))
```typescript
import { Workspace } from '@mastra/core/workspace';
import { SpritesSandbox } from '@mastra/sprites';
const workspace = new Workspace({
sandbox: new SpritesSandbox({ id: 'mastra-project', token:
process.env.SPRITES_TOKEN }),
});
```
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
## @mastra/client-js@1.53.0-alpha.9
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
## @mastra/react@1.9.0-alpha.9
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
- @mastra/client-js@1.53.0-alpha.9
## @mastra/deployer-cloud@1.76.0-alpha.9
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`3bb1a21`](3bb1a21ec9),
[`b7d95a4`](b7d95a4cac),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
- @mastra/loggers@1.3.6-alpha.5
- @mastra/deployer@1.76.0-alpha.9
## @mastra/longmemeval@1.1.35-alpha.9
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
## @mastra/opencode@0.1.35-alpha.9
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
## @mastra/factory@0.21.0-alpha.9
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`fdd4587`](fdd4587842),
[`fdd4587`](fdd4587842),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
- @mastra/code-sdk@1.12.0-alpha.9
## create-factory@0.2.8-alpha.9
### Patch Changes
- Updated dependencies:
- mastra@1.34.0-alpha.9
## mastra@1.34.0-alpha.9
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`3bb1a21`](3bb1a21ec9),
[`b7d95a4`](b7d95a4cac),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
- @mastra/loggers@1.3.6-alpha.5
- @mastra/deployer@1.76.0-alpha.9
## @mastra/core@1.76.0-alpha.9
### Patch Changes
- Fixed retried API errors leaking the failed attempt's partial text.
([#26654](https://github.com/mastra-ai/mastra/pull/26654))
A provider could stream some text, fail mid-stream, and then succeed
when an error processor retried. The final answer came out as the failed
prefix followed by the recovered answer, for example `"The answer is The
answer is 42."`. The retry request also sent the failed prefix back to
the model.
The failed attempt's partial text is now discarded, for both `Agent` and
durable agents. The final `text` and the retry prompt no longer include
it, and neither do `response.messages` and stored messages. Steps that
completed before the failed attempt are kept.
Text chunks already streamed live from the failed attempt still reach
`textStream` and `fullStream` consumers. The step that carries them
finishes with reason `retry`.
- Fixed `resumeStream` ignoring the `requestContext` and `delegation`
you pass when a supervisor run is resumed in the same process that
suspended it. The resumed delegation now calls the `onDelegationStart`
hook from the resume call, and sub-agent tools see the resume call's
`requestContext`. `DurableAgent` tools approved with `approveToolCall`
in the same process now also run with the request context passed to that
call. Fixes [#25960](https://github.com/mastra-ai/mastra/issues/25960).
([#26686](https://github.com/mastra-ai/mastra/pull/26686))
- Fixed agent steps that start directly with a tool call being merged
into the previous step in the conversation history sent to the model.
Calls that ran one after another, where the second used the first's
result, no longer look like parallel calls. Parallel tool calls within a
single step still stay together.
([#26685](https://github.com/mastra-ai/mastra/pull/26685))
## @mastra/deployer@1.76.0-alpha.9
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`cb0201a`](cb0201ab41),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
- @mastra/server@1.76.0-alpha.9
## @mastra/loggers@1.3.6-alpha.5
### Patch Changes
- Fixed `HttpTransport` log queries and `UpstashTransport` error results
returning `page: 0` when called with `page: 0`. They now report page
`1`, consistent with the other transports.
([#26678](https://github.com/mastra-ai/mastra/pull/26678))
- Fixed HTTP and Upstash log transports replacing a supplied `time: 0`
with the current time. Epoch-zero timestamps are now preserved; logs
without a `time` still get the current time.
([#26679](https://github.com/mastra-ai/mastra/pull/26679))
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
## @mastra/mcp-docs-server@1.3.6-alpha.17
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
## @mastra/playground-ui@62.0.0-alpha.9
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
- @mastra/client-js@1.53.0-alpha.9
- @mastra/react@1.9.0-alpha.9
## @mastra/server@1.76.0-alpha.9
### Patch Changes
- Fixed query parameter parsing to safely handle parameter names that
collide with built-in object properties
([#26683](https://github.com/mastra-ai/mastra/pull/26683))
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
## @mastra/elysia@0.1.16-alpha.9
### Patch Changes
- Fixed multipart form parsing to safely handle field names that collide
with built-in object properties
([#26683](https://github.com/mastra-ai/mastra/pull/26683))
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`cb0201a`](cb0201ab41),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
- @mastra/server@1.76.0-alpha.9
## @mastra/express@1.5.20-alpha.9
### Patch Changes
- Fixed multipart form parsing to safely handle field names that collide
with built-in object properties
([#26683](https://github.com/mastra-ai/mastra/pull/26683))
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`cb0201a`](cb0201ab41),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
- @mastra/server@1.76.0-alpha.9
## @mastra/fastify@1.5.20-alpha.9
### Patch Changes
- Fixed multipart form parsing to safely handle field names that collide
with built-in object properties
([#26683](https://github.com/mastra-ai/mastra/pull/26683))
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`cb0201a`](cb0201ab41),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
- @mastra/server@1.76.0-alpha.9
## @mastra/hono@1.7.18-alpha.9
### Patch Changes
- Fixed multipart form parsing to safely handle field names that collide
with built-in object properties
([#26683](https://github.com/mastra-ai/mastra/pull/26683))
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`cb0201a`](cb0201ab41),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
- @mastra/server@1.76.0-alpha.9
## @mastra/koa@1.7.20-alpha.9
### Patch Changes
- Fixed multipart form parsing to safely handle field names that collide
with built-in object properties
([#26683](https://github.com/mastra-ai/mastra/pull/26683))
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`cb0201a`](cb0201ab41),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
- @mastra/server@1.76.0-alpha.9
## @mastra/nestjs@0.2.35-alpha.9
### Patch Changes
- Fixed multipart form parsing to safely handle field names that collide
with built-in object properties
([#26683](https://github.com/mastra-ai/mastra/pull/26683))
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`cb0201a`](cb0201ab41),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
- @mastra/server@1.76.0-alpha.9
## @mastra/next@0.2.34-alpha.9
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`cb0201a`](cb0201ab41),
[`cb0201a`](cb0201ab41),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
- @mastra/server@1.76.0-alpha.9
- @mastra/hono@1.7.18-alpha.9
## @mastra/server-adapters-test-suite@0.1.2-alpha.0
### Patch Changes
- Added coverage for reserved field and parameter names in shared
adapter request parsing tests
([#26683](https://github.com/mastra-ai/mastra/pull/26683))
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`cb0201a`](cb0201ab41),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
- @mastra/server@1.76.0-alpha.9
## @mastra/tanstack-start@0.2.34-alpha.9
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`cb0201a`](cb0201ab41),
[`cb0201a`](cb0201ab41),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
- @mastra/server@1.76.0-alpha.9
- @mastra/hono@1.7.18-alpha.9
## @mastra/voice-openai-realtime@0.14.4-alpha.1
### Patch Changes
- Fixed the `speaker` stream never ending for responses that have no
audio. A response that only calls a tool, a text-only response, or a
response cut off by a dropped socket never got `output_audio.done`, so
its stream stayed open. Anything piping it or waiting for `end` hung,
and repeated tool turns piled up pipes until Node printed a
`MaxListenersExceededWarning`. The stream now ends on `response.done`
(before tools run), and all open streams end when the socket closes or
on `close()`/`disconnect()`.
([#26697](https://github.com/mastra-ai/mastra/pull/26697))
Fixes [#26693](https://github.com/mastra-ai/mastra/issues/26693).
## @mastra/temporal@0.4.14-alpha.9
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
- @mastra/deployer@1.76.0-alpha.9
## create-mastra@1.34.0-alpha.9
## @internal/playground@1.34.0-alpha.9
### Patch Changes
- Updated dependencies
[[`a65d0c7`](a65d0c7888),
[`e89310a`](e89310a8db),
[`590d6ca`](590d6ca9fa)]:
- @mastra/core@1.76.0-alpha.9
- @mastra/client-js@1.53.0-alpha.9
- @mastra/react@1.9.0-alpha.9
- @mastra/playground-ui@62.0.0-alpha.9
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>