Dynamic agent config callbacks now get the authenticated end user as an
optional `user` argument, so you can personalize an agent without
digging auth keys out of `requestContext` yourself. It works in any
`DynamicArgument` callback: instructions, model, tools, memory,
workspace, processors, scorers, and so on.
```ts
import { Agent } from '@mastra/core/agent';
const supportAgent = new Agent({
id: 'support-agent',
instructions: ({ user }) =>
user ? `You are helping ${user.name ?? user.id}.` : 'You are a helpful assistant.',
model: ({ user }) => (user?.role === 'admin' ? 'openai/gpt-5' : 'openai/gpt-5-mini'),
tools: ({ user }) => (user ? { accountTool, ...(user.role === 'admin' ? { adminTool } : {}) } : {}),
memory: ({ user }) => (user ? userMemory : undefined),
});
```
`user` always has the same `MastraUser` shape, no matter which auth
provider you use, and it's `undefined` for unauthenticated requests:
```ts
import type { MastraUser } from '@mastra/core/types';
// { id: string; name?: string; email?: string; avatarUrl?: string; role?: string }
```
The server auth middleware builds it through a new overridable
`toMastraUser()` on `MastraAuthProvider`. The default handles common
shapes (`id`/`sub`/`userId`, `name`, `email`, `avatarUrl`/`picture`,
`role`), and JWT, Cloud, Supabase, Neon and Better Auth ship overrides
for their user objects. Custom providers can map their own shape:
```ts
import { MastraAuthProvider } from '@mastra/core/server';
import type { MastraUser } from '@mastra/core/types';
class MyAuth extends MastraAuthProvider<MyUser> {
async authenticateToken(token: string) { /* ... */ }
async authorizeUser(user: MyUser) { return true; }
toMastraUser(user: MyUser): MastraUser {
return { id: user.accountId, name: user.profile.displayName, role: user.permissions.primaryRole };
}
}
```
Inline auth configs can pass `toMastraUser` too. If the provider user
has no role and an RBAC provider is configured, the primary RBAC role
fills it in, so `user.role` also works with WorkOS, Okta, Google and
Neon. The raw provider user is still available when you need
provider-specific fields, and the new context key is reserved, so
clients can't spoof it through the request body:
```ts
instructions: ({ requestContext }) => {
const rawUser = requestContext.get('mastra__user'); // provider-specific object, unchanged
// ...
},
```
Dynamic `vectorStore` resolvers on RAG tools get `user` as well:
```ts
createVectorQueryTool({
indexName: 'docs',
model: embedder,
vectorStore: ({ user }) => (user ? tenantStores.get(user.id)! : sharedStore),
});
```
Inside core, every place that invoked a `DynamicArgument` callback
inline now goes through a single `resolveDynamicArgument` helper, which
reads the user from `requestContext` at call time. This is non-breaking:
callbacks get an extra optional field, providers get a method with a
working default. Requests served through an `MCPServer` don't get `user`
yet, since MCP builds its own request context; that's documented.
Tested with unit tests for the helper, normalization and each provider
override, middleware tests (inline config, provider role, RBAC role,
CompositeAuth ordering, unauthenticated), regression tests for the
migrated call sites, and an end-to-end test where an agent behind a fake
auth provider gets personalized instructions. Core, server, rag and the
touched auth packages typecheck clean, and their suites pass.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
When a signed-in user makes a request, configuration callbacks can now
use a standard set of details about that user. When a workflow resumes,
it uses the new request’s user details instead of restoring them from
the earlier run.
## Summary
- Added optional `user` data to `DynamicArgument` callbacks and RAG
vector-store resolvers. Callbacks can also use `getRequestUser()` to
read the normalized user from request context.
- Added the `MastraUser` type and `toMastraUser()` normalization hooks
for auth providers and inline auth configs. The server stores the
normalized user in a reserved request-context key and uses the primary
RBAC role when the user has no role.
- Updated core dynamic configuration paths to use the shared resolver.
Added user support to agent scopes and migrated A2A memory resolution.
- Added `withoutLiveRequestKeys()` to remove live authentication and
authorization data from saved context during workflow resume, restart,
and time travel. Saved non-authentication context, such as tenant data,
remains available.
- Added documentation and changesets. Raised relevant `@mastra/core`
peer dependency minimums to 1.81.0. MCPServer requests do not receive
the normalized `user`.
## Validation
The author reports passing typechecks and test suites across core,
server, RAG, and several auth packages. The author also reports three
failing Inngest tests and earlier failures in evented workflow and
scheduler tests, which reportedly fail the same way on comparison
sources. These results are author-reported and have not been
independently verified.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
## Description
Previously the e2e type-check job ran the type tests, ignored the result
and stayed green with 33 failures. `test.ts` now fails the job when any
run fails. It also runs plain `tsc`, because vitest skips type errors
outside test bodies.
For example, [E2E Type check in run
42058855421](https://github.com/mastra-ai/mastra/actions/runs/42058855421/job/127363177526)
passed with this in its log:
```
Test Files 6 failed | 6 passed (12)
Type Errors 33 failed
```
Fixture tests that no longer matched the current types are updated. The
zero-argument `bail()` call is removed, since #12211 dropped that
overload on purpose. The `network()` tests now expect `undefined`
output, because `network()` ignores the agent's `defaultOptions`.
client-js `generateLegacy` typed `object` as `never` with `output` and
dropped `text` with `experimental_output`. It now infers both from the
schema:
```ts
const r = await agent.generateLegacy({ messages: 'hi', output: schema });
r.object; // before: never, now: inferred from schema
```
With #29581 merged, all type tests and both `tsc` runs pass.
## Related issue(s)
Fixes#29603Fixes#29604
## 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
- [ ] Performance improvement
- [x] 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)
- [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
This PR makes the e2e type-check job report failures from all its
checks, including errors that test-focused checks can miss. It also
updates type tests to match current API types and fixes the result types
for `client-js` `generateLegacy()`.
## Changes
- The e2e type-check runner now runs two Vitest suites and two `tsc`
checks. It continues after a check fails and sets a failing exit status.
- The `generateLegacy()` overloads now retain schema types for `output`
and `experimental_output`. New type tests check the inferred `object`
and `text` types.
- Updated e2e type-test expectations for schemas, tools, workflows, and
client workflow start results.
- Updated `network()` tests to expect `undefined` when no structured
output is passed. This does not add inference from the agent’s
`TOutput`.
- Added a patch Changeset for `@mastra/client-js`.
## Validation
Completed CI, build, and test results: not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary
`Mastra.shutdown()` left behind the agent thread runs it was still
holding. Thread leases stayed held, and kept renewing with the
in-process pubsub, so another process couldn't use the thread until the
lease expired. Anyone following the run saw it fail with
`AgentThreadLeaseLostError`. This is the last open case of #27364; the
other four were fixed earlier.
Shutdown now hands those runs back once durable executions are
abandoned, while pubsub and storage are still open:
- **Parked runs** (waiting on a tool approval or suspension) are
announced with `run-suspended`, so they stay resumable.
- **Runs still executing** are aborted and get the rest of the drain
budget, at least 500 ms, to wind down, so they start no further steps.
Then the run ends with an unpersisted `run-completed`.
- The thread lease is released only after that event is published, and
only if the run has stopped. A run that hasn't stopped in time, such as
one whose tool ignores the abort, keeps its lease until it expires. A
tool's step counts as running until the tool body settles, not just
until the 250 ms abort grace hands control back to the loop.
- Every lease renewal this Mastra started stops.
- **Only this Mastra's runs are touched.** A run whose lease now belongs
to someone else is left alone. So is an evented run a worker executes
over a broker: it is only detached at shutdown, same as
`abandonDurableAgentExecutions`, and the worker keeps the lease.
- Abandoned durable runs now release their thread lease right away.
Recovery on the next boot no longer has to wait for the lease to lapse.
Late stream parts, suspended-run publishes and the run's own end are
skipped for runs shutdown already handed back, so nothing is published
twice.
Out of scope: whether followers of an abandoned durable run should wait
for recovery instead of ending.
Fixes#27364
## Test plan
- New `thread-shutdown-lease-release.test.ts`: two Mastra instances
share events and a lease backend that expires like Redis. Covers a
streaming run and a run parked on an approval, on every engine (normal,
durable, evented, fs). Checks that the lease is free right after
`shutdown()`, renewals and tool ticks stop, and the follower sees no
lost-lease error. All 8 fail without the fix.
- Updated the durable fence test: after shutdown, the thread lease no
longer marks the abandoned run live, so recovery works without mocking.
- `evented-execution.test.ts` still passes: when the API instance shuts
down, the run its worker executes keeps its thread lease.
- `src/agent/durable`, `src/agent/__tests__`, `src/mastra`: 6818 passed.
`durable-agent-crash-recovery.test.ts` hits a worker SIGABRT in this
sandbox, but that happens on main too.
- `tsc --noEmit`, oxlint and oxfmt are clean.
- Deployer `shutdown.test.ts` updated for the 6.5s core shutdown budget
(room for the handback).
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
When Mastra shuts down, it tells other processes whether each agent run
is paused or has ended. It stops renewing the run’s thread lease and
releases it when the run has stopped and the lease backend confirms
ownership, so another process can use the thread sooner. If a tool keeps
running after an abort, Mastra keeps the lease until it expires to avoid
handing the thread over too early.
## Changes
- Added shutdown handback for thread runs owned by the shutting-down
Mastra instance. Handback runs after durable executions are abandoned
and before pubsub teardown.
- Shutdown publishes `run-suspended` for parked runs and an unpersisted
`run-completed` event for other runs. It aborts executing runs and waits
for output, broadcasts, and running steps to settle within the grace
period.
- Shutdown releases a lease only if the run stopped and the lease
backend confirms that the instance still owns the lease. If a tool
ignores abort or the lease backend does not respond in time, shutdown
stops renewal and leaves the lease to expire.
- Runs executing elsewhere keep their lease. Shutdown suppresses later
stream parts and duplicate terminal events for runs it handles.
- Added shutdown tests for streaming, approval-parked, and partially
resumed runs across engines. A slow-tool test verifies that shutdown
does not release the lease while the abort-ignoring tool is still
running. Updated durable recovery and generated-server SIGTERM tests,
deployment guidance, the deployer shutdown budget, and the changeset.
- Diff size: 15 files changed, 873 lines added, 38 removed.
## Validation
Current-head test, build, and lint results: 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>
With `server.auth` set and no `server.cors.origin`, the deployer server
reflected any request origin and also sent
`Access-Control-Allow-Credentials: true`. Any website could then make
cookie-authenticated requests to the server from a logged-in user's
browser and read the responses.
Now the origin is still reflected, but credentials are only on by
default when `server.cors.origin` lists allowed origins. An explicit
`server.cors.credentials` setting is respected either way. Without auth
nothing changes (`origin: '*'`, no credentials).
If you use cookie sessions from a browser app on another origin, set
`server.cors.origin` to that app's origin.
Updated the CORS tests for the three cases. Deployer server tests pass
(141), and `tsc` and lint are clean.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
When authentication is on, the server can still reply to requests from
other websites. If it reflects a website’s origin, it no longer lets
that website use a visitor’s saved login credentials by default. List
allowed origins or set `server.cors.credentials` to allow credentials.
## Changes
- With `server.auth` set and `server.cors.origin` unset, the server
reflects the request origin but disables credentials by default.
- With an explicitly configured origin and auth enabled, credentials
remain enabled by default.
- An explicit `server.cors.credentials` setting takes precedence,
including when no origin is configured.
- Without auth, the default origin remains `'*'`.
- Updated CORS documentation, unit and end-to-end tests, and patch
changesets for `@mastra/deployer` and `@mastra/core`.
Test and lint results were not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What
`e2e-tests/monorepo/monorepo.test.ts` held 85 tests that vitest ran on
one worker. That takes about 6.4 min in the E2E monorepo job. This PR
moves the auth, bundler and install suites into `monorepo-auth.test.ts`,
`monorepo-bundler.test.ts` and `monorepo-install.test.ts`. The shared
setup and helpers move to `helpers.ts`. vitest then runs the four files
on separate workers.
Each moved suite already built its own fixture (its own temp dir,
`setupMonorepo` and port), so none of them depended on the main file's
shared fixture. The test bodies are unchanged. `vitest.config.ts` adds
the three new files to `include`.
## Numbers
Measured in a 5-CPU container with 4 workers, the same as the CI runner,
on the same build and registry, two runs each:
| | Wall | Tests |
|---|---|---|
| before | 386 s / 381 s | 88 passed |
| after | 188 s / 188 s | 88 passed |
The CI Test step is about 396 s today, so the E2E monorepo job should
drop from about 7 min to about 4 min.
## Stacking
This is stacked on #29143 (the 3-way Affected UNIT split). Until that
lands, Affected UNIT is the long pole on core PRs, so this PR alone does
not shorten them. Retarget it to `main` after #29143 merges.
## Checks
- The test titles in the four files match the old single file one to
one: none dropped or duplicated.
- Prettier clean.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
The monorepo end-to-end tests now run from separate files, so Vitest can
run them in parallel. The affected unit-test workflow can also split
large test lists across three jobs.
## Changes
- Moved authentication, bundler, and install tests out of
`monorepo.test.ts` into three test files.
- Added `helpers.ts` for shared fixtures, server and process cleanup,
lockfile parsing, and output checks.
- Added the three files to the monorepo Vitest configuration.
- Added configurable sharding to the affected unit-test workflow. It
uses three shards when at least 500 unit test files are affected and one
shard otherwise.
The diff changes 8 files, with 1,242 additions and 1,158 deletions. Test
and CI results are not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: remy-builder[bot] <324360501+remy-builder[bot]@users.noreply.github.com>
## Description
zod v3 schemas work at runtime but some public types rejected them or
inferred `unknown`, and `UIMessage[]` from `ai@7.0.163` stopped
type-checking against core's vendored v7 types.
```ts
import { z } from 'zod/v3';
const schema = z.object({ answer: z.string() });
createStep(agent, { structuredOutput: { schema } }); // before: No overload matches this call
new Agent({ ...config, defaultOptions: { structuredOutput: { schema } } }); // before: TS2322
(await agent.generateLegacy('hi', { output: schema })).object; // before: unknown, now { answer: string }
await client.getAgent('a').generate('hi', { structuredOutput: { schema } }); // before: TS2590
import type { UIMessage } from 'ai'; // 7.0.163, has SteeringMessageUIPart
await agent.generate(uiMessages as UIMessage[]); // before: 'SteeringMessageUIPart' is not assignable
```
The zod v3 fixes point the user-facing option types at `PublicSchema` /
`PublicAgentExecutionOptions` (the runtime already converts with
`toStandardSchema`). `inferOutput` gets a zod v3 branch that reads
`_output` structurally, like `InferPublicSchema` in schema-compat, so a
v3 schema from a different zod install than core's is inferred too.
Client-js `StreamParamsBase` is built on `AgentExecutionOptionsBase`,
which avoids the TS2590.
For the v7 messages, `MessageInput` also accepts a v7 `UIMessage` whose
parts only need a string `type`. Core can't know the shape of part types
released after its vendored copy, so those parts are deliberately loose.
Inline object literals are still checked against the known part types,
because excess property checks rule out the loose member for them.
Mastra doesn't process the new part types yet.
`AIV6Adapter.fromUIMessage` paired parts with its v5 bridge output by
index, so a part the bridge drops (an unknown type, or an empty text
part) shifted every later part. It now drops those before pairing.
The PR also fixes two tests that failed CI on `main`: the stored board
runtime test still imported `factoryMemorySettingsUserId` after #29366
renamed it, and the redactor leak check matched `4111` inside a random
message UUID.
Type tests cover each case in the core and inngest type-test files, and
they fail with the fix reverted. The e2e client-js fixture imported
`zod/v3` and `zod/v4`, which don't resolve there, so its schemas were
`any`. This PR fixes those imports. The e2e type-check run still ignores
its exit code (`e2e-tests/type-check/test.ts:45`), which is left for a
separate PR.
## Related issue(s)
Fixes#29574Fixes#29575
## 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
- [ ] 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)
- [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
This PR lets TypeScript accept Zod v3 schemas and newer AI SDK v7
messages in Mastra’s public APIs. It also fixes message-part matching so
ignored parts do not change how later parts are handled.
## Summary
- Updated agent and workflow option types to accept public schemas,
including Zod v3 schemas. Added Zod v3 output inference for
`generateLegacy`.
- Added forward-compatible input types for newer AI SDK v7 UI message
parts. Mastra accepts these messages, but does not yet process unknown
part types.
- Updated the AI v6 adapter to filter unsupported parts and empty text
parts before matching converted message parts.
- Updated client-js stream parameter types to avoid a complex TypeScript
union. Corrected Zod imports in a type-check fixture and added
regression type tests.
- Updated `getLastMessage` to use the last part only when it contains
nonempty string text.
- Added patch changesets for `@mastra/core`, `@mastra/client-js`, and
`@mastra/inngest`.
**Diff:** 19 files changed; 191 additions and 34 deletions.
**CI and test results:** not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
A Renovate bump moved the OTLP exporter packages in `observability/*` to
`0.300.0`, the OpenTelemetry SDK 3 line, while `sdk-trace-base`, `core`
and `resources` stayed on 2.x. The two lines need different
`@opentelemetry/api` versions, so npm hoists api 1.9.1 and the 0.300
exporters fail to load with `The requested module '@opentelemetry/api'
does not provide an export named 'SeverityNumber'`. pnpm in the monorepo
never hit it.
What users saw, all reproduced with fresh npm installs from the
registry:
- `import "@mastra/arize"` and `import "@mastra/arthur"` crash (the
linked issue).
- `@mastra/otel-exporter` 1.5.0 exports nothing. It loads its exporters
with a dynamic import, that import fails, and the catch logs "exporter
is not installed" and disables export. ESM and CommonJS, traces and
logs, every protocol, including the install commands in the docs. 1.4.10
exports fine.
- `import "@mastra/laminar"` crashes when installed next to
`@mastra/otel-exporter`.
Changes:
- Move the OTLP exporters back to `^0.223.0`, the last SDK 2 release, in
`@mastra/arize`, `@mastra/arthur`, `@mastra/laminar` and
`@mastra/otel-exporter`. No source change.
- Set `@opentelemetry/api` to `^1.9.0` in arize, arthur, laminar,
otel-exporter and otel-bridge. The same Renovate bump had raised it to
`^1.10.0`, and the SDK 2 packages need api below 1.10, so npm nested a
second api copy under each of our packages. A 1.10 copy cannot see the
tracer provider or the active span registered through the 1.9 copy
(checked with a real two-copy install). In the monorepo pnpm keeps
1.10.0, so only the lockfile specifiers change. Declaring it in arize
and arthur also keeps pnpm linking them to the same SDK instance as
otel-exporter.
- Widen otel-exporter's exporter `peerDependencies` from `^0.218.0`,
which on 0.x only matches 0.218.x, to `>=0.218.0 <0.300.0`, so they
agree with the optional dependencies.
- Add a Renovate rule that holds the six OTLP exporters below `0.300.0`
under `observability/*`. Renovate treats `0.22x -> 0.300` as a minor
update, so the major-approval gate did not stop it. A second rule keeps
the `@opentelemetry/api` ranges under `observability/*` as written and
updates only the lockfile, because the repo-wide `bump` strategy is what
raised them to `^1.10.0`. Remove both rules when `observability/*` moves
to SDK 3 together.
- Add the e2e suite `e2e-tests/npm-import`. It installs one template app
per install shape (arize and arthur, otel-exporter, laminar,
otel-bridge) with npm, not pnpm, imports and requires each package,
checks that npm installs one `@opentelemetry/api` copy, and sends a real
span through `OtelExporter` to a local server. It failed on the old
manifests with the errors above and passes on the fixed ones. It runs in
CI next to the sibling suites.
## Related issue(s)
Fixes#29175
## 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
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [x] 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
Some packages used OpenTelemetry versions that did not work well
together after a fresh npm install. This PR aligns their version ranges
and adds checks for package loading, shared API installation, and trace
export.
## What changed
- Pins OTLP exporter dependencies to `^0.223.0` in `@mastra/arize`,
`@mastra/arthur`, `@mastra/laminar`, and `@mastra/otel-exporter`.
- Sets `@opentelemetry/api` to `^1.9.0` in the affected observability
packages, including `@mastra/otel-bridge`.
- Widens the six OTLP exporter peer dependency ranges in
`@mastra/otel-exporter` to `>=0.218.0 <0.300.0`.
- Adds Renovate rules to keep OTLP exporters below `0.300.0` and update
the API lockfile without changing its declared range.
- Adds an npm-import E2E suite that checks ESM imports, CommonJS
requires, a single installed API copy, and HTTP/protobuf trace export.
- Adds the suite to the E2E workflow and local registry publish
configuration, and adds patch changesets for the affected packages.
The supplied information does not establish test results.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
In a monorepo, `mastra build` packs every workspace package the app
imports into `.mastra/output/workspace-module/` and installs it with its
whole dependency tree, even when the package is bundled into the output
and nothing imports it at runtime.
The packing seed in `Bundler._bundle` read from both
`analyzedBundleInfo.dependencies` (packages compiled into the bundle)
and `externalDependencies` (packages still imported at runtime). The
`dependencies` half came from #19808, as a fallback for workspace
subpaths that could leak into the output as bare imports. Since #24210
such a leak fails the build with
`DEPLOYER_BUNDLER_UNRESOLVED_WORKSPACE_IMPORT`, so the fallback only
adds tarballs. This PR seeds packing from `externalDependencies` only.
Transitive workspace dependencies of external workspace packages are
still collected from their `package.json`.
Before, in the monorepo E2E fixture (only `@inner/subpath-only` is in
`bundler.externals`):
```
Packaging batch 1/2: @inner/hello-world, @inner/inner-tools, @inner/lodash, @inner/native-binding-package, @inner/transitive-a
Packaging batch 2/2: @inner/transitive-b, @inner/transitive-c, @inner/subpath-only
```
After:
```
Packaging batch 1/1: @inner/subpath-only
```
Behavior change: code that loads a bundled workspace package at runtime
without a static import (`createRequire().resolve('@inner/x/...')`,
`node --import @inner/x`) used to work because the tarball happened to
be installed. Those packages now need to be listed in
`bundler.dynamicPackages`, the existing option for packages with no
static import, and the changeset says so. I checked that
`dynamicPackages: ['@repro/heavy']` packs and installs the workspace
package with this change, while `externals: ['@repro/heavy']` with no
import installs nothing (same as for third-party packages).
Verification:
- `@mastra/deployer` unit tests pass, and so does `tsc --noEmit`.
- Monorepo E2E suite locally: 85 of 88 pass. The 3 failures also happen
with the fix reverted and come from my local tooling: npm prints `npm
notice` on stderr during `mastra dev`, and pnpm 11.3 formats
`ERR_PNPM_IGNORED_BUILDS` differently.
- The new E2E assertion checks that `workspace-module/` only contains
`inner-subpath-only-1.0.0.tgz`. The changed-test gate confirmed it fails
against `main` and passes with the fix.
## Related issue(s)
Fixes#28303
## 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
- [ ] 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)
- [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
## Vanta 2026-10-30 security fixes (consolidated)
Direct dependency bumps and lockfile updates only. **No
overrides/resolutions added or raised.** The earlier override-based
edits on this branch were reverted; those findings are deferred below.
| Package | From → To | Advisory | Where |
|---|---|---|---|
| zod | ^3.25.76 → ^4.6.7 | zod <4.6.6 (High; no fixed 3.x) |
`client-sdks/react` (dev), `deployers/cloudflare` (dev),
`server-adapters/nestjs` (dev), `packages/editor` (dev),
`packages/playground-ui` (dep), `packages/playground`,
`workflows/_test-utils`, `examples/{durable-agents,inngest}`,
`explorations/longmemeval`,
`observability/_examples/otel-bridge/agent-hub`, e2e fixtures/templates
(`experiment-worker/fixtures/*`, `deployers/template/cloudflare`,
`no-bundling/template`, agent-builder `minimal-mastra-project`) + root
`pnpm-lock.yaml` |
| @hono/node-server | 1.19.x / 2.1.1 → 2.1.5 | CVE-2026-118663 /
GHSA-rmxm-3fg6-px4f (Medium) | direct deps: `examples/agent-builder`,
`otel-bridge/hono-multi/service-{one,two,mastra}`,
`templates/template-customer-refund-agent/client-demo-ui`,
`templates/template-kyc-customer-onboarding`,
`templates/template-security-incident-triage` |
Peer ranges (`^3.25.0 || ^4.0.0`) are unchanged, so consumers are
unaffected. Changeset: patch for `@mastra/playground-ui` (runtime zod
dep).
Supersedes the zod parts of #28075 (that PR also raises a pnpm override
and rewrites the `zod-v3` compat aliases to v4, so it is left as-is for
maintainers).
### Deferred (needs override, upstream release, or is intentional)
- zod v3 compat aliases (`zod-v3` in `packages/core`,
`packages/schema-compat`, `e2e-tests/type-check/template`;
`e2e-tests/client-js/zod-v3`): intentional zod 3 test coverage; no fixed
3.x release. Needs a decision to drop/dismiss.
- zod 3.25.76 transitive via `@arcadeai/arcadejs`, `@mcp-ui/client`,
firecrawl, `agent-browser`, `zod-to-json-schema`, MCP SDK paths:
upstream pins; override-only.
- @hono/node-server 1.19.x transitive via `@modelcontextprotocol/sdk`
(root, `examples/agent`, `packages/mcp/integration-tests`), and npm
lockfiles of `scripts/gh-issue-triage` (existing override, left alone)
and the two templates: override-only.
- graphql-scalars, raw-body, jose (templates/scripts): override-only.
- @azure/msal-node <7.1.0: 6.0.1 via `@azure/identity@4.14.0` (fixed in
4.14.1, blocked by the 1-day `minimumReleaseAge`; lockfile refresh
tomorrow), 5.6.0 via `@microsoft/teams.apps` (no fixed release).
- @opentelemetry/core <2.8.0: via `@google-cloud/pubsub@5` (fix needs
pubsub 6 major).
- @ai-sdk/provider-utils 2.2.8 / ai 4.x: pinned vendored AI SDK v4 line;
no fixed release in that major.
- extract-zip, deepmerge: no patched version.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This PR updates Zod and `@hono/node-server` versions in selected
packages, examples, and templates to address security advisories. It
also updates playground form code to work with Zod 4.
## Changes
- Updates selected `zod` dependencies to `^4.6.7`.
- Updates selected `@hono/node-server` dependencies to `2.1.5`.
- Updates the playground form’s IP address and record validators for Zod
4.
- Maps a specific Zod validation error to the message `Required`.
- Adds a patch changeset for `@mastra/playground-ui`.
## Validation
Test results are not provided in the supplied change summary.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: shreyas-mastra <327047572+shreyas-mastra@users.noreply.github.com>
This PR contains the following updates:
| Update | Change |
|---|---|
| lockFileMaintenance | All locks refreshed |
---
> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/9505) for more information.
🔧 This Pull Request updates lock files to use the latest dependency
versions.
---
### Configuration
📅 **Schedule**: (UTC)
- Branch creation
- "before 6am on wednesday"
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend Renovate
CLI](https://redirect.github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xOTAuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjE5MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0aW9uIl19-->
---------
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
Refs mastra-ai/platform#2931
Vanta remediation pass for 2026-10-28. It follows #28325, which has
merged.
## 2026-10-28 update
Today's live Vanta export added 3 advisory IDs on `mastra-ai/mastra`
(GitHub/Dependabot). This PR fixes the two that have a published fix and
leaves deepmerge, which has none.
| Package | From → To | Finding | Where | How |
|---|---|---|---|---|
| qs | 6.16.0 → 6.16.1 | CVE-2026-110816 / GHSA-6pq8-jhm2-2vcw (Medium
×4) | root `pnpm-lock.yaml`, 9 `e2e-tests/*` lockfiles,
`scripts/gh-issue-triage/package-lock.json` | Raised the existing floors
`qs@>=6.7.0 <6.16.0: 6.16.0` → `<6.16.1: 6.16.1` and `'qs@<6.7.0':
6.16.0` → `6.16.1`. Raised the npm override in gh-issue-triage. |
| @modelcontextprotocol/node | 2.0.0 → 2.1.1 | GHSA-f897-62hf-6gxq (High
×2; HTTP transports had no body-size or batch-length limit) | root
`pnpm-lock.yaml` (published `@mastra/mcp` 1.18.0, used as `mcp-legacy`),
`scripts/gh-issue-triage/package-lock.json` | New pnpm override
`'@modelcontextprotocol/node@>=2.0.0 <2.1.0': 2.1.1` and a new npm
override in gh-issue-triage. I used 2.1.1 rather than 2.1.2 because
2.1.2 needs a `@modelcontextprotocol/server` peer of `^2.4.0`, while
`@mastra/mcp` 1.18 resolves server 2.3.1. `packages/mcp` itself already
uses node 2.1.2. |
- Both versions are older than the 1-day `minimumReleaseAge`: qs 6.16.1
was published 10-14 and node 2.1.1 on 10-02. I did not use qs 6.16.2
(10-27), which is too new.
- No floors or overrides were removed; existing ones were only raised.
- `pnpm install --frozen-lockfile --lockfile-only` passes at the root.
Each nested e2e workspace was regenerated with `pnpm install
--lockfile-only`.
- Added the empty changeset
`.changeset/vanta-2026-10-28-security-floors.md`. No published package
changes.
- After this change, osv-scanner over all 33 lockfiles reports only the
documented leftovers:
- zod 3.25.76 (zod v3 compat line on purpose)
- ai 4.3.19 / `@ai-sdk/provider-utils` 2.2.8 (vendored v4 line)
- `@azure/msal-node` 5.6.0 / 6.0.1 (fix 7.1.0 needs majors in identity
and teams)
- `@opentelemetry/core` 1.30.1 (needs pubsub 6)
- extract-zip 2.0.1 (no patched release)
- deepmerge 4.3.1 (CVE-2026-93753 / GHSA-gcqx-w48m-w2h4; no patched
release, 4.3.1 is the latest)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This PR updates dependency rules and package versions to use newer
releases, including security fixes for `qs` and
`@modelcontextprotocol/node`. It also updates AI SDK dependencies and
does not include published package changes.
## Summary
- Raise the `qs` override target to `6.16.1` in the root and e2e
workspaces and in `scripts/gh-issue-triage`.
- Add an `@modelcontextprotocol/node` override at `2.1.1` in the root
workspace and `scripts/gh-issue-triage`.
- Update AI SDK dependency versions across package manifests and add a
changeset describing the provider-utils update.
- Add an empty changeset for the security-only dependency updates.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Update 2026-10-28 (afternoon)
- Merged origin/main (clean).
- Bumped the AI SDK v5 compat line from @ai-sdk/provider-utils 3.0.41 to
3.0.42 (patch, published 2026-10-21; it blocks `.internal` hostnames in
download URL validation and encodes provider-returned IDs in request
paths). This addresses the Aikido /mastra Highs AIKIDO-2026-10990 and
AIKIDO-2026-10981:
- ai 5.0.277 → 5.0.282, @ai-sdk/gateway 2.0.168 → 2.0.173 (vendored
ai_v5)
- anthropic 2.0.109 → 2.0.110, google 2.0.103 → 2.0.106, groq 2.0.58 →
2.0.59, openai 2.0.135 → 2.0.137, openai-compatible 1.0.58 → 1.0.59, xai
2.0.99 → 2.0.100
- Nested lockfiles updated: memory/integration-tests and
playground/e2e/kitchen-sink.
- No new overrides. Changeset:
`vanta-2026-10-28-ai-sdk-v5-provider-utils.md`.
Enables `no-else-return: error` in the root Oxlint config and removes
186 redundant `else` branches across 111 source/test files. Existing
rule defaults are retained.
Reviewed every code diff for behavior preservation. An independent
TypeScript AST comparison confirms that changes are limited to removing
`else` after returning branches, with the same expressions, statement
order, return values, and `try`/`catch`/`finally` boundaries. All
181,158 identifier occurrences retain their bindings. The recorder
replay path keeps an explicit block: flattening it would shadow the
earlier request `body` with the response `body` and introduce a
temporal-dead-zone error.
Extends the existing monorepo optimized-dependency test to assert that a
raw TypeScript workspace package, including its enum and transitive
dependency, still executes in the production bundle.
Validation: the root rule-only scan passes on 15,273 files with zero
diagnostics; formatting and `git diff --check` pass. Schema
compatibility tests: 1,060 passed, 9 skipped. Recorder runtime tests: 21
passed. The core selection initially passed 3,513 tests; rerunning the
suites requiring local server/cache access passed 185 tests, with one
remaining cache-file assertion also reproduced on unchanged `main`.
Remaining validation limits: four asset-download cases cannot reach
`placehold.co`; the changed-file lint run reports six import-order
errors reproduced on unchanged files from `main`. Deployer unit tests
and the monorepo test could not run because this checkout lacks required
package dependencies (`fs-extra`/workspace links and `get-port`,
respectively). These limits are left visible for CI. No changeset is
included because this is a behavior-preserving lint cleanup.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This PR makes the code easier to read by removing `else` branches that
are not needed after a return. It also enables a rule that catches those
branches and adds a test for loading a raw TypeScript workspace package
in a production bundle.
## Summary
- Enables Oxlint’s `no-else-return` rule at error severity and removes
186 redundant `else` branches across 111 files.
- Extends the monorepo optimized-dependencies test to check a raw
TypeScript workspace package, its enum, and a transitive dependency.
- Updates the deployer’s transpile-package path pattern.
- In workflow event processing, a truthy branch index with no matching
child now falls through to publish a skipped-step end event. Previously,
this case published no event.
- Keeps the recorder replay block explicit to avoid request/response
`body` shadowing and a temporal-dead-zone error.
## Validation
Reported checks passed: the rule-only scan across 15,273 files,
formatting, `git diff --check`, schema compatibility tests (1,060
passed, 9 skipped), recorder runtime tests (21 passed), and an initial
core test selection (3,513 passed).
Some test limits remain. Four asset-download cases could not reach
`placehold.co`. Changed-file lint reported six import-order errors that
also occur on unchanged files from `main`. Deployer unit tests and the
monorepo test could not run because dependencies were unavailable. On
rerun, suites requiring local server/cache access had 185 passes; one
cache-file assertion also reproduced on unchanged `main`.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Summary
`create-factory` now scaffolds the checked-in
`templates/template-factory` (platform) and
`templates/template-factory-self-hosted` (`--no-platform`) starters
(#28430). The old path — generating `mastra-ai/softwarefactory-template`
from `mastracode/web` with `sync-template.mjs` and pushing it from a
dedicated workflow — no longer feeds anything users receive, so this PR
removes it. The new templates sync through the same `sync-templates.yml`
as every other template.
| Before | After |
| --- | --- |
| `sync-softwarefactory-template.yml` generated a template from
`mastracode/web` and pushed it after an install/typecheck/build check
against published npm | Removed. Both factory templates sync through the
shared `sync-templates.yml`, unchanged |
| `e2e-softwarefactory` generated the template, scaffolded it, and
booted it with auth disabled | Scaffolds both checked-in templates
through the built CLI, typechecks and builds them against the local
package set, and boots the self-hosted template against its own Postgres
(`npm run db:up`) behind WorkOS auth |
| Template edits did not trigger the E2E suite | Changes under
`templates/template-factory*` run it |
Also removes `mastracode/mastra-factory/scripts/sync-template.mjs`, its
test, `template/README.md`, and the `template-out` ignores. The suite's
local registry setup is fixed: it could not resolve the verdaccio bin
(verdaccio 6 only exports `.` and `./package.json`) and, because that
failure happened after the repo was snapshot-versioned, left the working
tree mutated.
Stacked on #28430 → #28255.
## Follow-up after release
Once a `create-factory` release that uses the new templates is on
`latest`, archive `mastra-ai/softwarefactory-template` (don't delete it
— older CLI versions still clone it).
## Test plan
- [x] `create-factory`: tests (55), `tsc --noEmit`, lint
- [x] Both templates typecheck and bundle with `mastra build` against
workspace packages
- [x] Self-hosted template boots under `mastra factory dev` against
Postgres: `/signin` serves the Factory UI, `/auth/me` reports `workos`,
`/api/tools` returns 401
- [x] `e2e-softwarefactory` passes locally (7 tests, ~7 min): both
templates scaffold via the built CLI, typecheck, and build against the
local registry; the self-hosted template boots against `npm run db:up`
Postgres
- [ ] `e2e-softwarefactory` passes in CI
---------
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
Enable `typescript/no-unnecessary-template-expression` in the shared
TypeScript configuration and simplify 17 redundant interpolations.
Preserve 11 intentional coercions at runtime boundaries and in mock
response text with local explanations. Existing lint scope and package
manifests are unchanged.
Reviewed every edit and compared emitted JavaScript after the approved
string simplifications, including interpolation order and tagged
templates. All 916 function return types and 1,833 variable binding
types in the 21 affected source files are unchanged. CI lint and build
pass; the local 57-task build, CLI typecheck, formatting, and whitespace
checks pass.
Validation covers 193 focused processor, CLI, Couchbase, and GraphRAG
tests, plus 902 deployer tests across the full run and an isolated retry
of one timeout. That protocol-import case passed alone in 14.55 seconds;
unchanged main took 14.61 seconds against its 15-second timeout. Both
selected published-package monorepo E2E cases pass, including the
extended HTTP check for external module resolution. The broad rule audit
found zero rule violations across 15,106 files, alongside four
TypeScript configuration diagnostics in unchanged files; the targeted
scan passes cleanly.
The DuckDB CI job also fails two existing capability-list assertions
because their expected arrays omit `span-aggregate`. Both failures were
reproduced on unchanged base `f4cbdb4d78`; DuckDB and core storage files
are unchanged by this PR.
No changeset is included for this lint maintenance, as requested; the
changeset check is expected to fail. Keep this PR as a draft.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This PR adds a check that finds template strings with unnecessary string
insertions. It removes those insertions while preserving explicit
conversions where they may affect behavior.
## Summary
- Enable `typescript/no-unnecessary-template-expression` as an error in
the shared TypeScript configuration.
- Simplify redundant template expressions across CLI, core, deployer,
storage, test, and end-to-end test code.
- Preserve intentional string coercion at runtime boundaries and in mock
responses with local Oxlint suppression comments.
- Keep the existing lint scope and package manifests unchanged,
according to the PR objectives.
## Validation
The PR objectives report passing lint, build, typecheck, formatting,
whitespace, and focused test checks. They also report DuckDB
capability-list failures reproduced on the unchanged base. No changeset
is included as requested. The changeset check is expected to fail.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Update 2026-10-26 afternoon (Vanta pass)
Added commit `f6e4b670` on top of the 16:20 ET main merge:
- **esbuild 0.18.20 → 0.25.12** (GHSA-67mh-4wv8-2f99) and **bundle-name
3.0.0 → 4.1.1** (AIKIDO-2026-886499): the 12:43 ET merge of main dropped
the two `pnpm-workspace.yaml` entries this PR added on 10-23
(`'@esbuild-kit/core-utils>esbuild': 0.25.12` and
`'default-browser@4.0.0>bundle-name': 4.1.1`), so both old versions were
back in `pnpm-lock.yaml`. This commit puts them back exactly as before.
No other overrides changed.
- Added the empty changeset
`.changeset/vanta-2026-10-26-afternoon-overrides.md`.
- `pnpm install --frozen-lockfile --lockfile-only` passes.
After this, `osv-scanner` on all 34 lockfiles finds only the documented
leftovers: zod 3.25.76, ai 4.3.19 / `@ai-sdk/provider-utils` 2.2.8 (the
v4 line), extract-zip 2.0.1 (no patch), `@opentelemetry/core` 1.30.1,
and `@azure/msal-node` 5.6.0 / 6.0.1.
---
## Update 2026-10-26 (Vanta pass)
Merged `origin/main` (no conflicts) and added commits `9b169f0f` and
`94e183ff`:
| Package | From → To | Finding | Where | How |
|---|---|---|---|---|
| body-parser | 2.3.0 → 2.4.0 | CVE-2026-111181 / GHSA-27r3-jxmh-p828
(High) | root `pnpm-lock.yaml`, `examples/agent`, refund and genui
templates (npm) | Raised the root floor `body-parser@<2.3.0: 2.3.0` →
`<2.4.0: 2.4.0`. Added a floor in `examples/agent`. `npm update` in the
templates. `patches/body-parser@2.3.0.patch` renamed to `@2.4.0` (same
one-line raw-body interop; it applies cleanly). |
| body-parser | 1.20.6 → 1.20.9 | same advisory, 1.x line | all 10
`e2e-tests/*` lockfiles (verdaccio → express 4) | New floor
`body-parser@<1.20.9: 1.20.9`. The `patches/body-parser@1.20.6.patch`
files are renamed to `@1.20.9` (they apply cleanly). |
| fast-uri | 3.1.8 → 3.1.9 | CVE-2026-110095/-110180/-110306/-110725 |
root, e2e-tests ×10, `examples/agent`, otel-bridge `agent-hub`,
`acp-validator`, `gh-issue-triage`, refund and genui templates | Raised
the existing floors/pins from 3.1.8 to 3.1.9 |
| fast-uri | 4.2.1 → 4.2.3 | GHSA-333x-w4r6-6crp, GHSA-w74x-v6f9-j3xg,
GHSA-wjr9-j795-jxcr, GHSA-xhq7-xmqj-769h | otel-bridge `agent-hub` |
Raised the existing floor `fast-uri@>=4.0.0 <4.1.5: 4.2.1` → `<4.2.3:
4.2.3` |
| multer | 2.4.0 → 2.5.0 | CVE-2026-113872 / GHSA-q7qp-rjg7-q26m (High)
| root | Floor `multer@<2.3.0: 2.4.0` → `multer@<2.5.0: 2.5.0` |
| serialize-javascript | 7.1.2 → 7.1.4 | CVE-2026-115897 /
GHSA-m5mm-p8h7-m29v | root | Floor `<7.0.5: ^7.0.5` → `<7.1.3: ^7.1.3` |
| zod | 4.3.6 / 4.4.3 / 4.5.4 → 4.6.7 | CVE-2023-54404 /
GHSA-mrhx-c7xc-m3w5 (High) | exact pins in
`templates/template-kyc-customer-onboarding`,
`templates/template-security-incident-triage`,
`packages/mcp/integration-tests/{v2,published-v1}`,
`e2e-tests/commonjs/template` | Direct pin bump (same major) |
| fastify | `^5.12.5` → `^5.12.6` | CVE-2026-107832 | devDependency
specifiers in `server-adapters/fastify` and `workflows/inngest` (the
lock already had 5.12.6) | Specifier bump |
- Every new version is older than 24h: body-parser 2.4.0 and 1.20.9
(10-22), multer 2.5.0 (10-22), serialize-javascript 7.1.4 (10-23),
fast-uri 3.1.9 (10-19), fast-uri 4.2.3 (10-19), qs 6.16.1 (10-14, pulled
in by body-parser 2.4.0), zod 4.6.7 (10-12).
- No overrides or floors were removed; the existing ones were only
raised.
- `pnpm install --frozen-lockfile --lockfile-only` passes at the root
and in the nested e2e/example workspaces.
- Added the empty changesets
`.changeset/vanta-2026-10-26-security-floors.md` and
`.changeset/vanta-2026-10-26-fast-uri-4.md`.
- **Not changed:**
- zod 3.25.76: the fix exists only on zod 4, and the zod-v3 support and
compat tests intentionally stay on 3.
- `@azure/msal-node` 5.6.0: the fix is 7.1.0, but `@azure/identity` 4.14
pins `^6` and `@microsoft/teams.apps` 2.1.1 pins `^5.6.0`, so this would
be a two-major runtime jump.
- extract-zip 2.0.1: no patched release (the advisory lists `>=2.0.2`,
which has not been published).
- `@opentelemetry/core` 1.x: needs pubsub 6 / spanner 9, which are
majors.
- ai v4 / provider-utils: the v4 line is vendored on purpose.
---
Refs mastra-ai/platform#2931
Vanta remediation, 2026-10-23 (follow-up to #28138, which has merged).
| Package | From → To | Finding | Where | How |
|---|---|---|---|---|
| storybook, @storybook/react-vite (+ react, builder-vite, csf-plugin,
react-dom-shim) | 9.1.20 → 9.1.21 | CVE-2026-114125 (Critical),
CVE-2026-114126 (High) | `client-sdks/react` devDependencies | Direct
bump `^9.1.20` → `^9.1.21` |
| esbuild | 0.18.20 → 0.25.12 | GHSA-67mh-4wv8-2f99 | better-auth →
drizzle-kit 0.31.10 → @esbuild-kit/esm-loader → @esbuild-kit/core-utils
(pins `~0.18.20`) | Override `'@esbuild-kit/core-utils>esbuild':
0.25.12` |
| bundle-name | 3.0.0 → 4.1.1 | AIKIDO-2026-886499 | @mastra/deepeval →
deepeval → open@9 → default-browser@4 (pins `^3`) | Override
`'default-browser@4.0.0>bundle-name': 4.1.1` |
### Why there is a `trustPolicyExclude` for storybook 9.1.21
`client-sdks/react` stays on the storybook 9 line; we are not doing the
storybook 10 major here. The only patched 9.x release is 9.1.21. It was
published on 2026-10-12 without the trusted-publisher evidence that
earlier 9.1.x releases had, so `trustPolicy: no-downgrade` fails with
`ERR_PNPM_TRUST_DOWNGRADE`. The exclude covers exactly the six packages
pnpm rejects, each pinned to `@9.1.21`: `@storybook/react-vite`,
`storybook`, `@storybook/react`, `@storybook/builder-vite`,
`@storybook/csf-plugin` and `@storybook/react-dom-shim`. No other
versions or packages are excluded. The packages come from the official
storybook monorepo release, 9.1.21 on the v9 line.
### Notes
- Every new version is older than 24h, so it satisfies
`minimumReleaseAge: 1440`. storybook 9.1.21 is 11 days old, esbuild
0.25.12 is from Nov 2025 and bundle-name 4.1.1 is from 2026-09-25.
- The esbuild override is dev-only: drizzle-kit is a CLI pulled in by
better-auth. I checked that `@esbuild-kit/core-utils` `transform()`
works against esbuild 0.25.12.
- bundle-name 4.x keeps the same `bundleName()` API. It is used only by
`open`'s macOS default-browser lookup.
- `pnpm build-storybook` in `client-sdks/react` fails on main too. The
error is a Babel 8 `loadPartialConfig` error, which happens with 9.1.20
as well, so it is not caused by this PR.
- I ran `pnpm install --frozen-lockfile` and it passes. The changeset is
empty because no published package changes.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This PR updates dependency versions and rules that keep older,
reported-vulnerable versions out of the project. It also updates
Storybook and records the changes in changesets.
## Summary
- Raises security-related dependency versions or minimums across the
root project, examples, templates, packages, and e2e workspaces. The
updates include `body-parser`, `fast-uri`, `multer`,
`serialize-javascript`, `zod`, and Fastify.
- Renames `body-parser` patch files and updates workspace references to
match the new versions.
- Updates Storybook packages in `client-sdks/react` from 9.1.20 to
9.1.21. Adds an `esbuild` override and updates the `bundle-name`
override.
- Adds changesets for the dependency updates. No tests were added.
## Validation
The author reports that frozen-lockfile installs pass at the root and in
nested e2e and example workspaces. The author also reports that `pnpm
build-storybook` fails on `main` as well as this branch, with a Babel 8
`loadPartialConfig` error.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Enable `no-useless-return` in the shared configuration. Remove 28
terminal bare returns, use 31 explicit switch breaks, and retain 12
value-returning contracts with explicit `undefined`. Preserve 13
intentional guards with local explanations, including index-skipping
property reads and the platform availability probe.
Reviewed every edit and checked that removed returns and new switch
breaks have no effectful continuation before function exit, including
cleanup through `finally`. All other source and emitted JavaScript
syntax is preserved apart from formatting, and all 2,020 function return
types and 3,280 variable binding types in the 59 affected source files
are unchanged. The new rule reports zero violations across 15,106 files.
CI lint and build, the local 57-task build, Factory build, core
typecheck, formatting, and whitespace checks pass.
All 756 focused tests pass across stream conversions, idle-loop cleanup,
workflow validation, Factory, Factory UI, Playground UI, Datadog,
Sentry, Cloudflare, and E2B. Both selected published-package monorepo
E2E cases pass. The extended build case covers a missing application
`.npmrc` and verifies successful builds with dependency installation
both skipped and enabled.
The DuckDB CI job also fails two existing capability-list assertions
because their expected arrays omit `span-aggregate`. Both failures were
reproduced on unchanged base `f4cbdb4d78`; DuckDB and core storage files
are unchanged by this PR.
No changeset is included for this lint maintenance, as requested; the
changeset check is expected to fail. Keep this PR as a draft.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This PR teaches the shared lint configuration to flag returns that do
not change what a function does. It updates the affected code so it
still exits at the right point, while keeping returns that are needed to
return a value or protect an intentional guard.
## Summary
- Enables `no-useless-return` as an error in the shared Oxlint
configuration.
- Removes redundant terminal returns, replaces switch-case returns with
`break` where execution continues after the switch, and keeps
value-returning contracts explicit.
- Adds local explanations or lint suppressions for intentional guards.
- Adds assertions that the monorepo build test leaves `.npmrc` files
absent when installation is skipped.
The author reports that source and emitted JavaScript syntax, apart from
formatting, and the return types and variable binding types across all
59 affected files remain unchanged. The author also reports reviewing
changes for effects before function exit, including cleanup through
`finally`.
## Validation and status
The author reports zero violations across 15,106 files and passing CI
lint and build, the local 57-task build, Factory build, core typecheck,
formatting, whitespace checks, 756 focused tests, and two selected
published-package monorepo E2E cases.
The author reports two DuckDB CI failures in existing capability-list
assertions because the expected arrays omit `span-aggregate`. The author
reports reproducing both failures on unchanged base `f4cbdb4d78`; DuckDB
and core storage files were not changed.
No changeset is included, as requested. The author expects the changeset
check to fail and requests that the PR remain a draft.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->