This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.
⚠️⚠️⚠️⚠️⚠️⚠️
`main` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `main`.
⚠️⚠️⚠️⚠️⚠️⚠️
# Releases
## @mastra/client-js@1.60.0-alpha.12
### Minor Changes
- Allow `querySpans()` to sort by `model` or `provider`.
([#30096](https://github.com/mastra-ai/mastra/pull/30096))
```ts
orderBy: [{ field: 'model', direction: 'asc' }];
```
### Patch Changes
- The generated route types for scores now include the `SCORER` and
`PROCESSOR` entity types, matching the entity types experiments can
emit. ([#30145](https://github.com/mastra-ai/mastra/pull/30145))
- Add span-local error counts.
([#30088](https://github.com/mastra-ai/mastra/pull/30088))
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
## @mastra/factory@0.28.0-alpha.14
### Minor Changes
- A card's sandbox now stops as soon as the card is done with that
context, instead of idling until the provider times it out.
([#29981](https://github.com/mastra-ai/mastra/pull/29981))
- When a card moves out of the last phase of a context into a phase that
runs in another one, Factory stops that context's sandbox. Triage →
Planning stops the triage sandbox; Planning → Building keeps the shared
`work` sandbox running. A run still in flight on the session keeps its
sandbox until it ends.
- When a card finishes, Factory stops every sandbox it holds, from any
Factory process, by identity through the configured sandbox provider.
Before, only the process that had opened a sandbox stopped it.
- A card that comes back to a context resumes the same sandbox with its
files.
Stopping never fails the move. Sandboxes are stopped, not destroyed;
deleting a session still destroys its sandbox.
- Added two read routes that answer what the new session page shows
without sending a project's cards.
([#30097](https://github.com/mastra-ai/mastra/pull/30097))
`GET /web/factory/projects/:id/work-items/starters` counts the cards
behind each starter on the project's default board, such as the cards
whose run failed, the pull requests awaiting review and the cards not
yet triaged.
`GET /web/factory/projects/:id/work-items/activity?since=<instant>`
returns how many cards the project has, and when cards were created and
completed since that instant. `since` is required and must be an ISO
date-time such as `2026-06-01T00:00:00.000Z`. The answer carries an
`ETag`, so asking again for the same `since` with `If-None-Match`
returns a 304 with no body when nothing changed.
### Patch Changes
- Fixed environment templates that could stop rebuilding for good. When
a build start was never recorded and the sandbox provider can't list its
builds (Mastra Platform), every later Build now, schedule and push run
used to skip with `unresolved` forever. Factory now treats that start as
failed 30 minutes after its lease lapsed and the next trigger builds.
([#30148](https://github.com/mastra-ai/mastra/pull/30148))
Saving a change to a template input (setup commands, the working
directory, settings, environment repositories, source-control
connections or Build variables) now rebuilds the template once the
project has one, so new sandboxes stop rerunning setup on every boot.
Saves that change nothing don't build, and a change saved during any
build, scheduled ones included, is built when that build ends.
- Factory sessions and MCP clients can now read the Factory's audit
trail with `factory_list_audit_events`: who did what to which work item,
run, branch or setting, and when. Filter by actor (`me`, a user id, or
an agent, optionally with the agent runs a person started), namespace or
exact actions, work item and time range, and page back with a cursor.
The tool only returns this Factory's events and never returns request
context (IP address, user agent), actor emails or event metadata beyond
who started an agent run. It leaves out events from or about other
people's private sessions.
([#30165](https://github.com/mastra-ai/mastra/pull/30165))
- Added a "Join the issue's card instead" switch to intake routes in the
Factory UI. A route for pull requests that close an issue can now put
the pull request on that issue's card instead of giving it a card of its
own; until now only the route Factory seeds could do this. The switch
shows on new and saved routes whose conditions include "Source kind is
Pull request" and "Pull request closes an issue is Yes".
([#30197](https://github.com/mastra-ai/mastra/pull/30197))
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/code-sdk@1.19.0-alpha.14
- @mastra/mcp@2.9.0-alpha.4
## @mastra/observability@1.24.0-alpha.7
### Minor Changes
- Add span-local error counts.
([#30088](https://github.com/mastra-ai/mastra/pull/30088))
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
## @mastra/core@1.83.0-alpha.12
### Minor Changes
- Add model and provider as span query sort fields.
([#30096](https://github.com/mastra-ai/mastra/pull/30096))
```ts
orderBy: [{ field: 'model', direction: 'asc' }];
```
- Add span-local error counts.
([#30088](https://github.com/mastra-ai/mastra/pull/30088))
### Patch Changes
- Name the agent in the missing-storage error thrown by `Memory`. When
an agent's memory never received storage because the agent was never
attached to a Mastra instance, accessing `memory.storage` now fails with
`[Agent:<name>] Memory requires a storage provider to function. ...`, so
it is clear which agent is misconfigured. The registration and
standalone-storage guidance added in #29972 is unchanged, and agents
that inherit storage from their Mastra or configure it directly on
`Memory` are unaffected.
([#30164](https://github.com/mastra-ai/mastra/pull/30164))
- Experiments with a scorer or processor target now save their scores,
and workflow step scorers in experiments now save their step scores.
Previously these scores were silently discarded.
([#30145](https://github.com/mastra-ai/mastra/pull/30145))
## @mastra/mcp-apps-components@0.1.0-alpha.7
### Minor Changes
- Dashboards authored in chat now accept the same widgets as the
dashboard editor: KPIs that combine values (ratio, difference, max,
fallback), read trace, span or score aggregates (for example p95 span
duration) and use duration, percent or score formats; line charts of
scores; six more chart colors (blue, orange, pink, yellow, red, purple);
and optional KPI icon and detail, series color and table empty message.
([#30192](https://github.com/mastra-ai/mastra/pull/30192))
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
## @mastra/playground-ui@69.0.0-alpha.14
### Minor Changes
- Widened what dashboard widgets can show:
([#30192](https://github.com/mastra-ai/mastra/pull/30192))
- KPIs can combine values with `ratio`, `minus`, `max` and `coalesce`,
read trace and span aggregates (for example `duration.p95`) and score
aggregates, and are formatted as `duration`, `percent` or `score`.
Combined values are compared with the previous window.
- Charts accept six more colors: `blue`, `orange`, `pink`, `yellow`,
`red` and `purple`.
- KPI `icon` and `detail`, series `color` and table `emptyMessage` are
optional. Series without a color pick one from a palette, and tables
without an empty message show "No data".
### Patch Changes
- Fixed hover highlights on cards and other surfaces stopping short of
the edge. The highlight now covers the whole surface and follows its
rounded corners exactly, including the sidebar credits card and
clickable cards. Hover highlights on these surfaces now switch instantly
instead of fading.
([#30047](https://github.com/mastra-ai/mastra/pull/30047))
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`987566e`](987566e882),
[`72abae6`](72abae68eb),
[`987566e`](987566e882),
[`f071044`](f0710446e0)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/client-js@1.60.0-alpha.12
- @mastra/react@1.15.0-alpha.12
## @mastra/server@1.83.0-alpha.12
### Minor Changes
- Support model and provider sorting in span queries.
([#30096](https://github.com/mastra-ai/mastra/pull/30096))
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
## @mastra/clickhouse@1.30.0-alpha.4
### Minor Changes
- Sort span queries by model or provider in ascending or descending
order. ([#30096](https://github.com/mastra-ai/mastra/pull/30096))
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
## @mastra/duckdb@1.19.0-alpha.5
### Minor Changes
- Sort span queries by model or provider in ascending or descending
order. ([#30096](https://github.com/mastra-ai/mastra/pull/30096))
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
## @mastra/pg@1.36.0-alpha.6
### Minor Changes
- Sort span queries by model or provider in ascending or descending
order. ([#30096](https://github.com/mastra-ai/mastra/pull/30096))
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
## @mastra/react@1.15.0-alpha.12
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`987566e`](987566e882),
[`72abae6`](72abae68eb),
[`987566e`](987566e882),
[`f071044`](f0710446e0)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/client-js@1.60.0-alpha.12
## @mastra/deployer-cloud@1.83.0-alpha.12
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/deployer@1.83.0-alpha.12
## @mastra/longmemeval@1.1.42-alpha.12
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/libsql@1.30.0-alpha.3
## @mastra/opencode@0.1.42-alpha.12
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/libsql@1.30.0-alpha.3
## create-factory@0.4.3-alpha.14
### Patch Changes
- Updated dependencies
[[`1fbc69a`](1fbc69aa9a),
[`4e378c3`](4e378c3e26),
[`1fbc69a`](1fbc69aa9a)]:
- mastra@1.39.0-alpha.14
## @mastra/code-sdk@1.19.0-alpha.14
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`987566e`](987566e882),
[`72abae6`](72abae68eb),
[`987566e`](987566e882),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/observability@1.24.0-alpha.7
- @mastra/duckdb@1.19.0-alpha.5
- @mastra/client-js@1.60.0-alpha.12
- @mastra/pg@1.36.0-alpha.6
- @mastra/mcp@2.9.0-alpha.4
- @mastra/libsql@1.30.0-alpha.3
## mastracode@0.50.0-alpha.13
### Patch Changes
- Fix `/settings` crashing when mouse preferences are missing from saved
settings by defaulting to Off.
([#30184](https://github.com/mastra-ai/mastra/pull/30184))
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882),
[`f071044`](f0710446e0)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/observability@1.24.0-alpha.7
- @mastra/duckdb@1.19.0-alpha.5
- @mastra/pg@1.36.0-alpha.6
- @mastra/code-sdk@1.19.0-alpha.14
- @mastra/mcp@2.9.0-alpha.4
- @mastra/libsql@1.30.0-alpha.3
## @mastra/arize@1.3.30-alpha.7
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/otel-exporter@1.5.2-alpha.7
## @mastra/arthur@0.4.30-alpha.7
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/otel-exporter@1.5.2-alpha.7
## @mastra/braintrust@1.3.27-alpha.7
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/observability@1.24.0-alpha.7
## @mastra/datadog@1.4.22-alpha.7
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/observability@1.24.0-alpha.7
## @mastra/deepeval@0.1.24-alpha.7
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/observability@1.24.0-alpha.7
## @mastra/laminar@1.3.32-alpha.7
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/observability@1.24.0-alpha.7
## @mastra/langfuse@1.6.6-alpha.7
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/observability@1.24.0-alpha.7
- @mastra/otel-exporter@1.5.2-alpha.7
## @mastra/langsmith@1.4.3-alpha.7
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/observability@1.24.0-alpha.7
## @mastra/otel-bridge@1.5.22-alpha.7
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/observability@1.24.0-alpha.7
- @mastra/otel-exporter@1.5.2-alpha.7
## @mastra/otel-exporter@1.5.2-alpha.7
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/observability@1.24.0-alpha.7
## @mastra/posthog@1.4.7-alpha.7
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/observability@1.24.0-alpha.7
## @mastra/sentry@1.2.32-alpha.7
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`72abae6`](72abae68eb),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/observability@1.24.0-alpha.7
- @mastra/otel-exporter@1.5.2-alpha.7
## mastra@1.39.0-alpha.14
### Patch Changes
- Added `mastra api factory work-item starters` and `mastra api factory
work-item activity`. The first counts the cards behind each new-session
starter on a project's default board. The second lists when a project's
cards were created and completed since an instant:
([#30097](https://github.com/mastra-ai/mastra/pull/30097))
```bash
mastra api factory work-item starters <project-id>
mastra api factory work-item activity <project-id>
'{"since":"2026-06-01T00:00:00.000Z"}'
```
- Added a "Join the issue's card instead" switch to intake routes in the
Factory UI. A route for pull requests that close an issue can now put
the pull request on that issue's card instead of giving it a card of its
own; until now only the route Factory seeds could do this. The switch
shows on new and saved routes whose conditions include "Source kind is
Pull request" and "Pull request closes an issue is Yes".
([#30197](https://github.com/mastra-ai/mastra/pull/30197))
- Improved the Factory new session page on large boards. Its starters
and its activity band now load the counts and dates they show instead of
downloading every card of the project. They show the same content as
before. ([#30097](https://github.com/mastra-ai/mastra/pull/30097))
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/deployer@1.83.0-alpha.12
## @mastra/deployer@1.83.0-alpha.12
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/server@1.83.0-alpha.12
## @mastra/mcp-docs-server@1.3.13-alpha.16
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
## @mastra/elysia@0.1.23-alpha.12
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/server@1.83.0-alpha.12
## @mastra/express@1.5.27-alpha.12
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/server@1.83.0-alpha.12
## @mastra/fastify@1.5.27-alpha.12
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/server@1.83.0-alpha.12
## @mastra/hono@1.7.25-alpha.12
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/server@1.83.0-alpha.12
## @mastra/koa@1.7.27-alpha.12
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/server@1.83.0-alpha.12
## @mastra/nestjs@0.3.0-alpha.12
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/server@1.83.0-alpha.12
## @mastra/next@0.2.41-alpha.12
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/server@1.83.0-alpha.12
- @mastra/hono@1.7.25-alpha.12
## @mastra/tanstack-start@0.2.41-alpha.12
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/server@1.83.0-alpha.12
- @mastra/hono@1.7.25-alpha.12
## @mastra/voice-openai-realtime@0.14.9-alpha.2
### Patch Changes
- Use gpt-realtime-2.1-mini by default for OpenAI Realtime voice
connections instead of the retired
gpt-4o-mini-realtime-preview-2024-12-17 model.
([#30183](https://github.com/mastra-ai/mastra/pull/30183))
## @mastra/inngest@1.11.2-alpha.8
### Patch Changes
- Support span-local error counts in Inngest workflows.
([#30088](https://github.com/mastra-ai/mastra/pull/30088))
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
## @mastra/temporal@0.6.0-alpha.12
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`72abae6`](72abae68eb),
[`987566e`](987566e882)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/deployer@1.83.0-alpha.12
## create-mastra@1.39.0-alpha.14
## @internal/playground@1.39.0-alpha.14
### Patch Changes
- Updated dependencies
[[`56f654f`](56f654fc0d),
[`f071044`](f0710446e0),
[`987566e`](987566e882),
[`72abae6`](72abae68eb),
[`f9088d8`](f9088d8510),
[`987566e`](987566e882),
[`f071044`](f0710446e0),
[`43d1e9c`](43d1e9c16d)]:
- @mastra/core@1.83.0-alpha.12
- @mastra/client-js@1.60.0-alpha.12
- @mastra/playground-ui@69.0.0-alpha.14
- @mastra/react@1.15.0-alpha.12
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## Description
Export `errorCount` as failures originating directly on each span. Child
failures forwarded through a model step, workflow or agent add no parent
count; independent parent failures do. Failed retries remain counted
after recovery, and replay does not create new occurrences. No
parent/child totals or suspend/resume rollup are maintained.
Attribution stays in a WeakMap without modifying user errors. Explicit
internal serializers and Inngest memoized operations preserve provenance
across boundaries; public workflow results and stored workflow state
omit transport metadata. Failures before child execution count on their
actual originating span. Excluded spans preserve attribution so their
failures cannot be misassigned to visible parents, but excluded failures
are absent from exported totals.
Retry context stays in the server-only context module, while shared
origin utilities use global crypto. Guarded cross-package calls preserve
mixed-version startup compatibility. Unsupported accounting and older
snapshots remain unknown. Error-free spans do not allocate occurrence
sets.
Validation: 117 focused observability/workflow/compatibility tests, 23
real Inngest error/retry scenarios and 37 Inngest engine/nested-result
checks pass. New regressions reproduced resolver undercounting,
excluded-child misattribution and public transport-field leakage before
the fixes. Real Inngest tests cover an empty execution graph,
unavailable remote child, instrumented child errors, nested propagation,
retries, public responses and stored state. Core/observability build,
Inngest typecheck, changed-file type-aware lint and CI formatting checks
pass. The preceding merge also passed 167 core checks and redaction
integration coverage.
Playground production builds were verified on Node 24. Docs checks with
Vale report no errors (three warnings on unchanged API headings); the CI
Vale configuration passes. Standalone observability `tsc` previously
reported generic union-call errors in untouched
`workflow-control-flow-suite.ts`; package builds and focused tests pass.
No production rollout or query-table changes. CI reruns on the new head.
## Related issue(s)
Fixes https://linear.app/kepler-crm/issue/OBS-901
Follow-ups: https://linear.app/kepler-crm/issue/OBS-902 and
https://linear.app/kepler-crm/issue/OBS-903
Nonblocking review follow-up:
https://linear.app/kepler-crm/issue/OBS-905 tracks explicit propagated
classification on previously untagged errors and reuse of one Error
object across separate foreach iterations. Changesets intentionally
remain single sentences per maintainer direction.
## Type of change
- [x] New feature (non-breaking change that adds functionality)
- [x] Documentation update
- [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
This change counts each error on the span where it first happened. It
keeps the count correct when errors are wrapped, retried, or rebuilt, so
one failure is not counted twice.
## Summary
- Adds span-local `errorCount` to exported spans. The count covers
failures that start directly on that span.
- Adds `claimSpanError`, `BaseSpan.recordError`, and
`BaseSpan.restoreErrorCount`. Each claim records one occurrence ID on
the span.
- Ignores propagated failures on the receiving span. Propagated failures
count only on their origin span.
- Keeps error origin through cause chains, durable tool serialization,
and event codecs.
- Stores origin metadata in a `WeakMap` for live errors and formatted
results. Omits it from public workflow JSON.
- Stores occurrence IDs in span snapshots. Rebuilt spans restore them,
so replayed attempts are not counted again.
- Records failed attempts for default, evented, and Inngest workflow
retries. Each attempt uses an attempt-scoped occurrence ID.
- Reports `errorCount` as unknown when the runtime lacks the claim API
or when an older snapshot has no accounting history.
- Updates tracing types, the span record schema description, the span
reference documentation, and changesets for `@mastra/core`,
`@mastra/observability`, `@mastra/client-js`, and `@mastra/inngest`.
- Adds tests for repeated reports, retry scopes, concurrent async spans,
excluded children, cause-linked errors, tool and agent spans, rebuilt
and legacy snapshots, codecs, durable serialization, workflow retries,
and ESM/CJS compatibility with an older core build.
## Scope
- Parent and child totals are not computed.
- Suspend and resume rollups are not computed.
- Query-time summation, display, filtering, sorting, and aggregate-table
integration are not included. These are tracked in
[OBS-902](https://linear.app/kepler-crm/issue/OBS-902) and
[OBS-903](https://linear.app/kepler-crm/issue/OBS-903).
- Counts reflect observed exported failures only. Filtering, sampling,
or loss before export can leave counts incomplete.
## Change size
- 32 files changed
- 862 lines added
- 161 lines removed
## Validation
- Completed checks on the current head: not available from the supplied
evidence.
- Author-reported results, not verified here:
- Focused observability tests, codec and durable-serialization checks,
and engine and Inngest retry scenarios.
- Node 24 builds, 167 core checks, 125 observability and redaction
tests, and 19 real Inngest scenarios.
- Type-aware lint and `lint:format`.
- Known limitations:
- A prior monorepo E2E attempt did not run application assertions.
Fixture dependency installation failed with a pnpm store ENOENT error.
- Earlier runtime tests ran on Node 23.11.0, which is outside the
supported engine range.
- Standalone observability `tsc` reports errors in an untouched test
utility.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
`tracingOptions.hideInput` / `hideOutput` clear span input and output at
export, but `exportSpan()` passed `errorInfo` through untouched. Error
messages, the stack header (which repeats the message) and error details
often quote exactly the data the flags are meant to hide. Examples: a
tool throwing `Invalid IBAN: <the user's IBAN>`, or a provider that
refuses a prompt and echoes it back in its response body. This applies
to every span type, not just scorers. It came up in review of #29174
([comment](https://github.com/mastra-ai/mastra/pull/29174#discussion_r4444454609)).
On a trace that sets either flag, the exported error now keeps what
identifies it and drops the text:
```json
// Before
{ "name": "Error", "message": "Invalid IBAN: DE89370400440532013000",
"stack": "Error: Invalid IBAN: DE89370400440532013000\n at validate (tools/iban.ts:12:11)" }
// After
{ "name": "Error", "message": "[REDACTED]",
"stack": "Error: [REDACTED]\n at validate (tools/iban.ts:12:11)" }
```
`id`, `name`, `domain`, `category` and the stack frames are kept. From
`details`, only the provider fields that `apiCallErrorDetails` already
sanitizes are kept (`statusCode`, `url`, `isRetryable`), so
`responseBody` and free-form `MastraError.details` are dropped. Either
flag triggers this, because an error can quote either side. The
redaction happens at export, next to the existing input/output check, so
all exporters and bridges get it and the live span keeps the real error
for in-process use (metrics status, span processors). Traces without the
flags are unchanged.
New integration test
(`observability/mastra/src/hidden-trace-errors.integration.test.ts`)
runs a real agent, Observability instance and TestExporter. It covers a
tool error and a provider API error under `hideInput` only and
`hideOutput` only, plus unhidden controls and stack-header edge cases.
All four hidden-trace cases fail on `main`.
Two open questions for reviewers: should we keep a small allowlist of
id-like `MastraError.details` keys (`agentName`, `toolId`, `runId`)
instead of dropping them all? And are we fine with `error.message`
grouping in Datadog-style dashboards showing `[REDACTED]` for hidden
traces?
After #29174 merges, a failing scorer step on a hidden trace is covered
by this same rule. I'll add that case to the scorer redaction test once
both have landed.
## Related issue(s)
Follow-up to #29174.
## Type of change
- [x] Bug fix (non-breaking change that fixes an issue)
## 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 a trace hides input or output, this change also hides secrets in
exported errors. It preserves safe error identity and relevant stack
frames without exposing hidden data.
## Changes
- Redacts exported error messages and stack headers as `[REDACTED]`.
- Applies redaction when `hideInput` or `hideOutput` is enabled.
- Preserves error identity fields and safely correlated stack frames.
- Omits free-form error details from redacted exports.
- Replaces unsupported stack formats with a redacted header.
- Leaves live errors and unhidden traces unchanged.
- Uses wrapped error causes when capturing stack information.
- Adds integration tests for tool errors, provider errors, wrapped
causes, and stack edge cases.
- Adds a patch changeset for `@mastra/observability`.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Ehindero Israel <iehindero419@stu.ui.edu.ng>
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
HTTP feedback review-status changes persist locally but do not reach
exporters. This forwards successful updates to supporting exporters and
adds `observability.updateFeedbackReviewStatus({ feedbackId,
reviewStatus })` for independent SDK delivery. A missing or slow local
record does not block remote delivery; the HTTP route still requires an
existing local record, honors the configured resourceId, and returns its
updated value. Organization IDs remain metadata and do not scope this
PATCH route.
MastraPlatformExporter sends the existing review-status PATCH contract,
retries recognized missing-feedback and temporary lookup responses, and
tracks delivery through flush/shutdown. Replacement PUTs and review
PATCHes for the same feedback ID share one queue through retries,
including failure recovery. This orders requests from one exporter
instance; successful publication still does not guarantee that a
subsequent PATCH reads the latest queued PUT from Platform storage.
Storage exporters wait for earlier creates of that feedback to resolve
and persist before updating it, including buffered and in-flight writes.
Other exporters remain independent. Optional hooks let older exporters
skip the update safely; HTTP updates still work when observability lacks
the notification hook. This covers review status only, with no general
PATCH or UI changes.
Fixes#24054, completing its remaining review-status exporter gap after
the create/replacement work. Part of OBS-785. Platform delivery requires
the matching endpoint from merged mastra-ai/platform#4651 to be
deployed; the Platform UI rollout remains separate.
Validation: the HTTP export regressions failed before the fix and pass
afterward. Shared HTTP suites pass in Hono, Express, Fastify, NestJS and
Koa (92 tests each); exporter HTTP tests (163 in the latest run) and
neighboring observability tests (234), and server handler tests (167)
pass. The retry-ordering, buffered-create, and inherited-hook
regressions failed before their fixes. Timing-sensitive ordering tests
passed 20 repeated runs, including PUT/PATCH in both directions with
flush/shutdown and independent IDs. Relevant builds, client-js build,
typed lint, formatting and docs checks pass. Route metadata regeneration
produces no diff. Local validation used Node 23.11.0, outside the
repository's supported engine range. Docs checks and CI-equivalent Vale
lint pass with Vale 3.25.1 installed.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This PR sends feedback review-status changes to observability exporters,
not only local storage. It also adds an SDK method for sending these
updates directly.
## Summary
- Added `observability.updateFeedbackReviewStatus({ feedbackId,
reviewStatus })`.
- Added the `feedback_review_status` event and exporter hooks.
- Updated the HTTP route to validate local feedback and `resourceId`,
update local storage, return the updated record, and notify exporters.
- Added Platform `PATCH` delivery with retries for recognized
missing-feedback and temporary lookup responses.
- Serialized updates for the same feedback ID while keeping different
IDs independent.
- Allowed remote delivery when local feedback is missing or local
storage lacks review-status support.
- Preserved compatibility with exporters that do not implement the new
hook.
- Tracked pending updates through `flush()` and shutdown.
- Added documentation, changesets, and regression tests.
- Scope remains limited to review-status updates. No general `PATCH`
behavior or UI changes.
## Validation
- 21 files changed: 752 additions and 50 deletions.
- Reported HTTP suites passed for Hono, Express, Fastify, NestJS, and
Koa, with 92 tests per suite.
- Reported exporter HTTP tests, neighboring observability tests, and
server handler tests passed.
- Reported builds, client-js build, typed lint, formatting,
documentation checks, and route metadata checks passed.
- Vale validation used version 3.25.1.
- Validation used Node 23.11.0, outside the repository’s supported
engine range.
- Platform delivery requires deployment of the matching endpoint from
`mastra-ai/platform#4651`.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Implements
[OBS-887](https://linear.app/kepler-crm/issue/OBS-887/add-oss-feedback-replacement-and-export).
Add OSS `PUT /api/observability/feedback/:feedbackId` with the existing
wrapped client request. Replacements retain the original feedback ID,
trace ID, timestamp, and tenant; omitted optional fields are cleared. A
full replacement can create a missing record. OSS persists locally
before responding, then independently notifies supporting exporters.
Resolve mode still requires the local anchor. The SDK also exposes
optional `replaceFeedback()` for independent exporter delivery without a
producer-side storage lookup.
Replacement events use a separate optional exporter hook.
`MastraPlatformExporter` sends PUT with stable identity across bounded
anchor retries, and flush/shutdown drain deliveries. Older exporters
skip replacements rather than replaying them as creates. Unsupported
storage/package combinations return 501 or skip unavailable export
support. No UI changes; review-status PATCH propagation remains tracked
in OBS-785.
In-memory, PostgreSQL vNext, DuckDB, and ClickHouse vNext support
replacement. In-memory, PostgreSQL, and DuckDB enforce replacement
identity at the write. PostgreSQL coordinates writes by feedback ID,
including duplicates submitted with a different timestamp. Duplicate
HTTP creates return the stored identity and timestamp and re-notify
exporters with accepted values. Tenant mismatches remain hidden, and an
omitted SDK replacement author stays null. HTTP/exporter creates use
`onConflict: 'ignore'` so a delayed original create doesn't undo an
edit; direct storage calls keep their legacy upsert default.
**ClickHouse requires no migration:** it uses the existing schema and
read-before-insert protection. Sequential delayed creates are covered,
but overlapping writes from separate processes can race; this is not a
globally ordered or exactly-once protocol.
Latest review fixes: DuckDB's lazy facade delegates replacement to its
guarded writer; concurrent coverage runs 20 overlapping request pairs
per identity variant. Direct storage replacements normalize an omitted
author to null. PostgreSQL single-feedback reads use the primary for
read-after-write consistency, while list/aggregate reads retain the
configured read client. Batch advisory locks use one ordered query with
unchanged lock keys.
Validation: the stronger DuckDB regression failed on all four identity
variants before the facade fix. Afterward, the entire DuckDB package
passed 718 tests across 21 files in three consecutive runs. PostgreSQL
passed 57 feedback tests, including a real stale read snapshot and
overlapping reversed 1,000-ID batches. Shared replacement tests passed
on in-memory (12), and the new author regression passed on ClickHouse
without a migration. Core/storage builds and declarations, typed lint,
and formatting passed. Earlier HTTP (85 cases on each of four adapters),
generic Hono routes (2,848), server/system, exporter, and docs checks
remain recorded in the PR history. Local tests use Node 23.11.0; CI
validates the supported runtime.
The unrelated Traces UI fade assertion failure was fixed in
https://github.com/mastra-ai/mastra/pull/30068; this branch includes
that fix from main.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This PR lets users replace feedback without changing its identity. It
stores the replacement locally and sends it to supported exporters
without allowing delayed creates to overwrite it.
## Changes
- Added `PUT /api/observability/feedback/:feedbackId`.
- Preserved the feedback ID, trace ID, timestamp, and tenant.
- Cleared omitted optional fields.
- Added capability detection and `501` responses for unsupported
storage.
- Added replacement event types, SDK support, client types, route
metadata, and documentation.
- Added replacement delivery, stable retries, flush handling, and
shutdown draining for `MastraPlatformExporter`.
- Added replacement support for in-memory, PostgreSQL vNext, DuckDB, and
ClickHouse vNext.
- Added `onConflict: 'ignore'` for HTTP and exporter creates. Direct
storage calls retain their upsert default.
- Older exporters skip replacements instead of replaying them as
creates.
- Added ClickHouse support without a migration. Concurrent writes from
separate processes can still race.
- No UI changes were included.
## Validation
The author reports passing the HTTP route and contract suites, feedback
storage suites, partition and SQL tests, server and system tests,
record-builder tests, build, typecheck, lint, and documentation checks.
For the current head, the available CI result is `2027dev Evals:
skipped`. Other listed CI checks target different commits or remain in
progress. Current-head CI results are otherwise not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
When an agent run uses `tracingOptions.hideInput` / `hideOutput`, the
agent's trace gets redacted, but its live scorers didn't follow the same
setting. The full conversation still ended up in the stored score row
(input, output, judge prompts, step results, reason), in the scorer's
own trace (the scorer run span, the analyze step's `prompt` attribute,
and the judge's model spans), and in the reason on emitted score events.
If you're using these flags to keep personal data out of storage, that
defeats the point.
Scorers now take the flags from the trace state of the span they score.
No new API is needed:
```ts
const agent = new Agent({
// ...
scorers: { helpfulness: { scorer: helpfulnessJudge } },
defaultOptions: { tracingOptions: { hideInput: true, hideOutput: true } },
});
// Before: the score row and scorer trace contained the full conversation.
// After: the score value is kept. Input/output, judge prompts, step results and reason are
// stored as '[REDACTED]' (input/output are non-nullable columns), and the scorer trace hides
// input/output like the agent trace does.
```
The judge still sees the real data. Only what's persisted or exported
changes. `requestContext` on the score row is left as-is, matching how
`hideInput` treats it on spans. Open to discussion on whether `reason`
should only be hidden when output is hidden; I went conservative because
judges quote both sides.
The new integration test
(`observability/mastra/src/scorer-redaction.integration.test.ts`) runs a
real Observability instance, an in-memory store and an LLM-judged
scorer, for the plain agent (defaultOptions and per-call options) and
the durable agent. All hidden-case assertions fail on `main`. A control
case checks that unhidden runs still record everything.
While writing it I found that durable agents don't apply per-call
`tracingOptions.hideInput` to their own model/step/processor spans, even
without scorers. I've left that as an `it.fails` case and will file it
separately.
A follow-up could add an explicit `scorerOptions` override for people
who want scorer redaction to differ from tracing, or who don't have
observability configured.
## Related issue(s)
<!-- TODO: link issue -->
## Type of change
- [x] Bug fix (non-breaking change that fixes an issue)
## Checklist
- [ ] I have linked the related issue(s) in the description above
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] 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 an agent hides private input or output, its live scorer now hides
the same data. This keeps private information out of saved scores,
scorer traces, and score events while keeping the score value.
## Changes
- Live scorers inherit `hideInput` and `hideOutput` from the scored
trace.
- Saved scores redact both `input` and `output` when either flag is
enabled.
- Judge prompts, step results, and reasons are also redacted.
- Scorer traces, including judge model calls, hide both sides when
either flag is enabled.
- Scorer-step spans omit prompts, and score events omit reasons.
- Tests cover default options, per-call options, durable agents,
observability aliases, single hide flags, cross-field `prepareRun`
transformations, and an unhidden control case.
**Validation:** No test execution results or current review findings
were provided.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Ehindero Israel <iehindero419@stu.ui.edu.ng>
Feedback and scores submitted with only a trace/span ID can be dropped
before reaching remote exporters because the SDK first looks in local
storage. For example, `addFeedback({ traceId, feedback })` cannot
currently reach Platform when that trace exists only there. This change
dispatches to every supporting exporter immediately and moves local
lookup/retries into MastraStorageExporter and the deprecated
DefaultExporter. Each storage exporter enriches its own copy while
preserving the original ID and timestamp.
OSS HTTP creates keep their existing local persistence and response
contract, then notify exporters without writing through the storage
exporter again. Supplied context, including an empty object, stays
supplied. Exported feedback preserves the author and review status,
including an explicitly null author. Pending storage lookups and custom
exporter deliveries are included in flush/shutdown. HTTP creates return
after local persistence and enqueue exporter delivery without waiting
for custom handlers to finish. Studio routing is unchanged: writes
target the backend serving reads.
Local context resolution requires the target span’s actual ancestor
root. Missing parents are retried, then logged and skipped locally; we
intentionally do not borrow another root’s tags or store incomplete root
context. Other exporters still receive the record independently.
Transient storage-read errors use the same bounded retry window and
report the final read error when exhausted.
Validated after review with 316 exporter/bus/recorded-span tests and 69
HTTP contract tests each on Hono, Fastify, and Koa (523 tests). The four
custom-exporter timing cases also passed 20 repeated runs. The
read-error and HTTP-latency regressions failed before their fixes, and
temporarily allowing the orphan fallback failed the new root-context
regression. Six older mocked forwarding/race tests are replaced by real
storage and HTTP coverage. Package builds, observability production and
adapter-suite typechecks, changed-file lint, and docs checks pass;
generated route types and CLI metadata are unchanged.
Express and NestJS tests hit a JSON body-parser failure before our
handlers. Standalone Express with no Mastra code reproduces `getBody is
not a function` under the local Node 23.11.0 runtime. The standalone
observability typecheck also retains four existing errors in
`workflow-control-flow-suite.ts`. These are not fixed here.
Fixes [OBS-886](https://linear.app/kepler-crm/issue/OBS-886) and
addresses the create-delivery portion of
[#24054](https://github.com/mastra-ai/mastra/issues/24054). Feedback
replacement remains in
[OBS-887](https://linear.app/kepler-crm/issue/OBS-887), and
review-status PATCH propagation remains in
[OBS-785](https://linear.app/kepler-crm/issue/OBS-785).
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This PR sends feedback and score records to each exporter independently.
Missing local traces no longer prevent remote delivery, and HTTP-created
records keep their original data.
## Summary
- Added exporter-specific event routing.
- Moved trace and span resolution into `MastraStorageExporter` and
`DefaultExporter`.
- Added bounded retries for storage lookups.
- Added pending annotation delivery before `flush()` and shutdown.
- Added asynchronous exporter notifications after successful HTTP
persistence.
- Prevented duplicate storage writes for HTTP-created records.
- Preserved IDs, timestamps, context, authors, anonymous feedback,
metadata, and review status.
- Added nullable `feedbackUserId` and `reviewStatus` support.
- Added SDK and HTTP adapter integration tests.
- Updated documentation, package metadata, and changesets.
**Diff:** 30 files changed; 954 additions and 483 deletions.
## Validation
- Reported: 503 focused tests passed, including 65 HTTP contract tests
for each of Hono, Fastify, and Koa.
- Reported: builds, changed-file lint, and documentation checks passed.
- Express and NestJS tests fail during JSON body parsing with `getBody
is not a function`.
- Standalone observability typecheck retains four existing errors.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Feedback and score events without correlation context currently go
through collector batching even when Platform needs to resolve their
trace/span. Send those records immediately to the wrapped observability
POST endpoints; keep supplied-context records on the existing collector
batch path.
Retry recognized missing-anchor 404s and lookup-unavailable 503s with
stable IDs, timestamps, and payloads, bounded by six attempts and 30
seconds. Honor Retry-After within that deadline, and drain pending
deliveries during flush/shutdown. Collector quota pauses do not suppress
these requests. Other failures are logged and dropped; any 2xx completes
delivery without polling for persistence.
This only handles events that reach the exporter. Producer-side local
lookups, HTTP-to-exporter notifications, and PUT/PATCH propagation
remain outside this change. Includes reference docs and a minor
@mastra/observability changeset with a usage example.
Validated with 562 exporter tests, final retry/deadline checks, package
build, targeted type-aware lint, and docs checks (Vale unavailable). The
routing regressions fail against the original exporter. Package-wide tsc
reports the same four workflow-control-flow-suite errors with and
without this implementation.
Fixes [OBS-825](https://linear.app/kepler-crm/issue/OBS-825).
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This PR sends feedback and score events to Platform when they do not
include correlation context. It retries temporary lookup failures and
waits for delivery during `flush()` and shutdown.
## Changes
- Added direct delivery for feedback and score records with
`correlationContext == null`.
- Kept records with supplied context, including `{}`, on the collector
batch path.
- Required a non-blank `traceId` for direct delivery.
- Added project-aware endpoints, authorization, stable payload
snapshots, and project headers.
- Added up to six total attempts within 30 seconds for recognized `404`
and `503` anchor lookup errors.
- Added exponential backoff and `Retry-After` support.
- Dropped non-retryable failures, network failures, invalid records, and
exhausted deliveries with warnings.
- Waited for direct deliveries during `flush()` and `shutdown()`.
- Kept direct deliveries active during collector quota pauses.
- Added HTTP coverage, reference documentation, and a minor-release
changeset.
## Scope
The change applies to events received by `MastraPlatformExporter`. It
does not change producer-side context lookup, exporter notifications, or
`PUT`/`PATCH` propagation.
## Validation
Completed CI, build, and test results are not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
> Opened by @wardpeet
## Summary
Since `@mastra/core` 1.82, model calls are recorded from the raw
provider stream, and the `MODEL_INFERENCE` span closes with that
stream's `finish` chunk. That chunk carries no model id, while the model
that actually served the request is named earlier in the
`response-metadata` chunk. As a result the span was exported without
`responseModel`, so cost estimation and exporters fell back to the
*requested* model. That is wrong for anyone behind a routing gateway or
relying on model failover, and the serving model is lost from PostHog
`$ai_generation` events.
`ModelSpanTracker.wrapStream` now captures the provider-reported model
id from `response-metadata` and merges it into the `finish` payload the
inference closes with, in both the regular and durable loops. The
enqueued chunk is left untouched.
Fixes#29779.
## Checks on this head
| Check | Result | Tests |
| --- | --- | --- |
| Typecheck (`tsc --noEmit -p tsconfig.build.json`) | ✅ Passed | — |
| Lint (`oxlint --type-aware .`) | ✅ Passed | 0 warnings, 0 errors |
| Format (`oxfmt --check` on changed files) | ✅ Passed | — |
| Targeted suites (`model-tracing`, `durable-agent-tracing.integration`,
`integration-tests`) | ✅ Passed | 151 passed, 1 expected fail |
| Full `@mastra/observability` suite | ✅ Passed | 1687 passed, 1
expected fail, 2 skipped; the 13 failures in `exporters/cloud.test.ts`
and `exporters/mastra-platform.test.ts` are pre-existing URL-path
assertion failures untouched by this diff |
| New tests on base code | ✅ Failed on base / passed on head | unit
regression test and all three plain/durable/evented variants |
| Snapshot updates | ✅ Purely additive | 23 files, only
`"responseModel": "mock-model-id"` added to MODEL_INFERENCE spans |
Not run: package build (`tsc -p tsconfig.build.json` covers the same
source).
### Adversarial check
Ran the base version of `model-tracing.ts` against both new tests: the
unit test fails with `expected undefined to be 'provider/served-model'`
and all three integration variants fail on the missing `responseModel`,
so the tests genuinely pin the fix. The merged model id is passed as a
fresh payload object while the original chunk is still enqueued, so
downstream stream consumers are unaffected. The change adds no
install/test-time hooks and copies no content from other repositories.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
A service can request one model but receive a response from another
model. This change records the model that actually answered, so
monitoring and cost reporting stay accurate.
## Changes
- Capture `modelId` from `response-metadata` on raw provider streams.
- Add it to the inference `finish` payload when the finish chunk lacks a
model ID.
- Preserve an existing model ID from the finish chunk.
- Keep streamed chunks unchanged.
- Add regression tests for plain, durable, and evented agents.
- Add a patch changeset for `@mastra/observability`.
## Validation
- Type checking, linting, and formatting checks passed.
- Targeted suites: 151 passed and 1 expected failure.
- Full observability suite: 1,687 passed, 1 expected failure, and 2
skipped.
- 13 exporter URL-path assertion failures were reported as pre-existing.
- New regression tests pass on the PR head and fail on the base.
- Package build: not run.
<!-- 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>
## Description
Since #28703, the agent loop has ended `MODEL_INFERENCE` when the raw
provider stream sends `finish`, and it records no output at that point.
The processed `step-finish` that comes later does nothing, because the
span is already closed. Exporters that treat `MODEL_INFERENCE` as the
model call (OTel/Langfuse, Datadog, PostHog) were sending prompts with
no response.
With this change, the tracker keeps the provider completion data (end
time, usage, finish reason, first-token timing) when the raw `finish`
arrives. It ends the span at the processed `step-finish` with the
processed output, which is the output after output processors have run.
The span's end time is set back to the provider finish, so tool
execution still doesn't count toward inference duration.
Steps can also end in other ways: error, abort, timeout, suspension,
tripwire, interruption, or a fallback-model attempt. In those cases the
span closes with the held provider data and no output, as it does today.
In the durable/evented loop, `step-finish` is the rewritten raw `finish`
and carries only usage. To cover that, the tracker also collects the
processed text and tool calls of the open inference, and uses them when
the payload has neither.
`DefaultSpan.end()` now accepts an internal `endTime`, which is ignored
if it is earlier than the span's start. Core types are unchanged, so
older core versions keep working.
For the scenario in the new test (a tool call, then text, with an output
processor that redacts `42`), `MODEL_INFERENCE` outputs are:
Before:
```text
inference: 0 undefined
inference: 1 undefined
```
After:
```text
inference: 0 {"text":"","toolCalls":[{"toolCallId":"call-1","toolName":"lookup","args":{"q":"answer"}}]}
inference: 1 {"text":"The answer is [REDACTED].","toolCalls":[]}
```
Tests:
- New integration test, run against the plain, durable, and evented
agents. It uses a tool call followed by text, a slow tool, and a
redacting output processor. It checks that each inference carries its
processed response and usage, and that the first inference ends before
the tool starts. All three variants fail without the fix.
- Integration snapshots regenerated. Every snapshot diff only adds
output to `MODEL_INFERENCE` spans, which reverts the `null` outputs that
#28871 snapshotted.
## Related issue(s)
Fixes#29818
## 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
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_018e9kMYCZnfNTKF8NDhgkAp
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
Model inference spans now include the model’s processed answer,
including tool calls and text changed by output processors. Their timing
still ends when the model finishes, before tool execution.
## Summary
- The tracker holds provider completion data until it receives the
processed `step-finish`. It closes the inference span with the processed
output and provider finish time, so tool execution does not extend the
inference duration.
- If processed `step-finish` does not arrive, the tracker closes the
pending span without output. For loops whose `step-finish` contains only
usage, it collects processed text and tool calls as a fallback.
- Integration tests cover plain, durable, and evented agents. They check
processed and redacted output, usage, timing relative to tool execution,
and span closure when a processor drops `step-finish`.
- Updated trace snapshots show model responses and tool calls on
inference spans.
**Changes:** 30 files; 590 additions and 60 deletions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
We moved from Prettier to oxfmt a while ago and CI checks formatting
with `oxfmt --check`, but six packages still ran `prettier --write` in
their pre-commit hook: the Discord, Teams and Telegram channels, the
Turso and OracleDB stores, and the DeepEval observability package. A
commit touching those could get reformatted by Prettier and then fail
the format check in CI.
They now use the same command as every other package.
```diff
- '*.{json,md,yml,yaml}': ['prettier --write'],
+ '*.{json,md,yml,yaml}': ['oxfmt --no-error-on-unmatched-pattern'],
```
`explorations/longmemeval` still uses Prettier in its hook. I left it
alone because `explorations/` is excluded from the oxfmt check.
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
When `MASTRA_DEPLOYMENT_ID` is set, storage exporters are suppressed
even when a customer intentionally exports to both their own database
and Platform. Keep that default and add a per-config
`retainStorageExporterOnPlatform: true` opt-in for
`MastraStorageExporter`, including runtime registration.
```ts
new Observability({
configs: {
production: {
serviceName: 'my-service',
retainStorageExporterOnPlatform: true,
exporters: [new MastraStorageExporter(), new MastraPlatformExporter()],
},
},
});
```
Deprecated `DefaultExporter` remains suppressed on Platform even with
the opt-in. Its implementation is unchanged.
The opt-in does not permit known local observability storage.
MastraStorageExporter warns during initialization and disables
persistence when the resolved observability domain reports local
storage. This blocks InMemoryStore (including Mastra's automatic
fallback when no storage is configured), local libSQL files, in-memory
libSQL, embedded replicas, and DuckDB while allowing remote libSQL/Turso
and PostgreSQL. Other storage domains and exporters are unaffected, and
local development retains local storage support.
Adds the optional persistenceLocation capability to observability
storage, with in-memory, libSQL, and DuckDB implementations. These
adapters must be upgraded alongside observability for the guard to
apply; older/custom adapters without location metadata retain the
existing opt-in behavior. No provider names or private connection fields
are inspected.
Constructor skip warnings are deferred until the application logger is
installed and emitted once. Docs explain the local-storage restriction
before the example, include a supported/blocked provider table, and
distinguish the implementation-specific option from the core interface.
The restriction remains explicit even for users who cannot see the
warning. Includes one minor changeset per affected package:
observability, core, libSQL, and DuckDB. Preserves the default policy
introduced in #23555.
Validation: 451 targeted observability tests pass, including regression
coverage that reproduced unwanted in-memory persistence before the fix
for both explicit InMemoryStore and the automatic fallback. The tests
also verify initialization warnings and continued local-development and
remote-storage behavior. All 756 MDX files pass formatting using the
CI-matching dependencies; focused type-aware lint, Remark, and Vale
pass. The earlier 9 adapter tests also passed. No live Platform or
PostgreSQL endpoint was exercised. Full typechecking remains limited by
workflow-helper errors previously reproduced on the base and
installed-dependency type mismatches encountered while regenerating core
declarations.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
On Mastra Platform, storage exporters are normally turned off to prevent
observability data from going to local storage. This change lets each
observability configuration opt in to remote storage export, while still
blocking storage known to be local.
## Changes
- Added `retainStorageExporterOnPlatform` to observability
configuration. It defaults to `false` and applies to exporters
registered during setup or later.
- When enabled on Platform, the option retains `MastraStorageExporter`
but does not enable the deprecated `DefaultExporter`.
- Added `persistenceLocation` to observability storage. The base
implementation returns `undefined`; in-memory storage and DuckDB report
`local`; libSQL reports `local`, `remote`, or `undefined` based on its
client configuration.
- On Platform, `MastraStorageExporter` skips storage that reports
`local` and warns during initialization. Adapters without location
metadata retain the opt-in behavior.
- Added documentation and changesets for observability, core, libSQL,
and DuckDB.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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>
<!-- 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> <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> </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>
Count-based batches can retain large payloads and start many concurrent
exports during bursts. This adds opt-in byte-triggered batching to
`MastraPlatformExporter` and `MastraStorageExporter`, with an 8 MiB
default flush threshold for both.
```ts
new MastraPlatformExporter({ byteBatching: {} })
new MastraStorageExporter({ byteBatching: {} })
```
The byte threshold triggers sending; it never truncates or discards
records to fit a batch. Larger records are exported intact, and queued
data is retained when exports fall behind. Platform defaults to two
concurrent uploads and storage to one write. Existing count mode remains
the default, and existing auth, quota, and retry-exhaustion policies
still apply. CloudExporter is unchanged.
Storage ignores byte batching when the resolved strategy is `realtime`,
preserving its immediate, awaited writes. Other update-based strategies
serialize writes and alternate creates with eligible updates so
unrelated create traffic cannot starve span ends. Updates waiting for
their own create stay queued without consuming retries. Events arriving
during shutdown are accepted until the drain finishes. Failed storage
writes back off the shared connection across signals.
Includes queue diagnostics, docs, a changeset, real HTTP collector
tests, and real ClickHouse tests. The ClickHouse suite uses a declared
`@mastra/observability` dev dependency and its built public export,
defaults to the package's localhost test server, and no longer skips
without `CLICKHOUSE_URL`. CI's affected-test selector includes this
suite for storage-exporter changes, and the ClickHouse build plan
includes observability. Queues are not memory-capped or durable.
Validation: 302 focused exporter/shared-buffer tests passed. The 42-test
ClickHouse suite passed; its shutdown coverage was then strengthened to
persist actual span outputs and passed 20 repetitions. The starvation
and realtime tests failed before their fixes, and the shutdown-admission
regression failed in all 20 pre-fix runs. Package build, exporter source
type-checking, lint, formatting, and focused docs checks pass locally.
Local full-package type-checking reports four errors in
`src/test-utils/workflow-control-flow-suite.ts`. The identical four
diagnostics reproduce at the original main base commit `bb0fcd6211`
under the same local dependencies; they are not introduced by this PR.
The synthetic slow-collector benchmark retained all 800 records with
about 50 MiB additional heap in byte mode versus 104 MiB in count mode.
It uses a custom 128 KiB threshold and demonstrates
concurrency/allocation behavior, not production performance at the 8 MiB
default.
No matching GitHub issue was identified; this follows a
customer-reported exporter memory investigation.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This PR lets the platform and storage exporters send records when their
data reaches a size limit. It keeps each record whole and retains queued
records while exports are in progress.
## Summary
- Adds opt-in byte-based batching to `MastraPlatformExporter` and
`MastraStorageExporter`, with an 8 MiB default threshold. Count-based
batching remains the default.
- Adds configurable concurrency. Platform uploads default to two
concurrent requests. Storage writes default to one. Update-based storage
strategies serialize writes; the `realtime` strategy ignores byte
batching.
- Adds byte-batching statistics, reference documentation, a changeset,
HTTP and ClickHouse tests, and a synthetic platform-exporter benchmark.
- The merge-base diff changes 15 files, with 1,574 lines added and 107
removed.
- Reported local results include 302 focused exporter/shared-buffer
tests, 42 ClickHouse tests, and 20 repeated shutdown-coverage runs
passing. The package build, exporter source type-checking, lint,
formatting, and focused documentation checks also passed. Full-package
type-checking reports four errors in
`src/test-utils/workflow-control-flow-suite.ts`; the same errors
reportedly occur at the merge base. Current CI results are not
available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
`SensitiveDataFilter` only redacted primitive values under a sensitive
key. When the value was an object or array it recursed into it and only
redacted nested keys that were sensitive themselves, so `{ secret: {
value: 'raw' } }` or `{ auth: { userId } }` kept the nested values in
traces.
Now any value under a sensitive key is replaced with the redaction
token, whatever the redaction style. Objects and arrays always get the
full token, since partial and indexed redaction don't make sense for
them.
The existing nested-fields test expected `config.auth.userId` to stay
visible. It now expects `config.auth` to be redacted. Added a test
covering object and array values in full, partial and indexed styles.
Fixes PLTFRM-3147
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
When a field has a sensitive name, `SensitiveDataFilter` now hides the
whole value, including any details inside an object or list. This
prevents data under sensitive fields from appearing in traces.
## Changes
- Object and array values under sensitive keys are replaced with the
full redaction token, regardless of the configured redaction style.
- Primitive values under sensitive keys continue to use the configured
full, partial, or indexed style.
- Tests verify whole-object redaction for the nested `auth` field and
cover object and array values across all three styles.
- Adds a patch changeset for `@mastra/observability`.
The change addresses PLTFRM-3147. Test execution results were not
provided.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->