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

1,978 commits

Author SHA1 Message Date
dane-ai-mastra[bot]
d60ba71be0 chore: version - exit prerelease mode 2026-11-12 21:12:29 +00:00
dane-ai-mastra[bot]
5c87442ed7
chore: version packages (alpha) (#30203)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.

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

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

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

# Releases

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

## @mastra/auth-auth0@1.3.0-alpha.0


## @mastra/auth-clerk@1.4.0-alpha.0


## @mastra/auth-okta@0.3.0-alpha.0


## @mastra/auth-supabase@1.2.0-alpha.0


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


## @mastra/auth@1.2.0-alpha.0


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


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


## @mastra/rag@2.8.0-alpha.3


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


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


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


## @mastra/auth-cloud@1.2.9-alpha.0


## @mastra/auth-neon@0.3.6-alpha.1


## @mastra/auth-workos@1.6.9-alpha.0


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


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


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


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


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


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


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


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


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


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


## create-factory@0.4.3-alpha.15


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


## mastracode@0.50.0-alpha.14


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


## mastra@1.39.0-alpha.15


## @mastra/connect@1.4.0-alpha.6


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


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


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


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


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


## @mastra/schema-compat@1.4.0-alpha.2


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


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


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


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


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


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


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


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


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


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


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


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


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


## create-mastra@1.39.0-alpha.15


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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-12 12:07:03 -08:00
Daniel Lew
18168d518c
feat(playground): show the built-in MCP server in Studio (#29932)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-12 13:40:02 -05:00
Daniel Lew
392c7b69d5
feat(server): built-in MCP endpoint for agents, workflows and tools (#29929)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-12 12:56:28 -05:00
Max Katz
6ad8e7eb9d
feat(ui): one settings layout across Studio, Factory and Platform (#29400)
## Description

Settings pages in Studio, Factory and Platform each had their own
layout: different widths, section headers with buttons, add rows at the
bottom of lists, fields starting at different x positions. This gives
all three one layout, built from reusable Playground UI components:

- A 640px page column with the title above the sections.
- Each section is a dimmed title above one borderless card. The card
owns all row spacing (14px padding, inset hairlines), so rows carry no
padding of their own.
- Settings rows: label and description on the left, control on the
right. Text fields share one width, selects hug their value up to that
width, switches and buttons keep their size.
- Lists: a count and the list's action in a header row at the top of the
card, one empty row (text plus the same action) when there's nothing in
it, and `SettingsItem` rows with one icon tile size, so every list lines
up.
- Input, InputGroup and select values use the regular-weight
`text-body-sm`, like Textarea.

This is the Playground UI, Studio and Factory half. The Platform half,
mastra-ai/platform#4174, pins a snapshot of this branch.

## Before / After

Every settings page in Studio and Factory, `origin/main` on the left and
this branch on the right (1440×1800, dark). Platform's pages are in
mastra-ai/platform#4174.

| Before | After |
| --- | --- |
| ![Studio · Settings
before](https://github.com/user-attachments/assets/46b2ed6d-cbad-45a6-9c12-28a977831a2b)<br>Studio
· Settings | ![Studio · Settings
after](https://github.com/user-attachments/assets/f3817061-47f9-4d8c-9601-1800df8644d9)<br>Studio
· Settings |
| ![Factory · My account
before](https://github.com/user-attachments/assets/df8e8657-3190-4922-9422-ddea3334e7bc)<br>Factory
· My account | ![Factory · My account
after](https://github.com/user-attachments/assets/eae27565-78e6-4782-aa7a-a660c29fd40a)<br>Factory
· My account |
| ![Factory · Preferences
before](https://github.com/user-attachments/assets/17af997a-c37f-4821-a9fc-f69530201f16)<br>Factory
· Preferences | ![Factory · Preferences
after](https://github.com/user-attachments/assets/22481178-a7f9-41b9-a1f4-e86b8833f0e4)<br>Factory
· Preferences |
| ![Factory · Connections
before](https://github.com/user-attachments/assets/d0755f0a-4624-42b3-be91-c7d1ce097fe9)<br>Factory
· Connections | ![Factory · Connections
after](https://github.com/user-attachments/assets/615fdbad-4263-41fd-8e5b-2c81545ec0ef)<br>Factory
· Connections |
| ![Factory · Models
before](https://github.com/user-attachments/assets/957a1da8-8bc3-4f10-bfb0-ca8891d37023)<br>Factory
· Models | ![Factory · Models
after](https://github.com/user-attachments/assets/1ccffc85-56aa-4aca-8ca4-f2317ad1e174)<br>Factory
· Models |
| ![Factory · Memory
before](https://github.com/user-attachments/assets/bba63125-cc48-4d00-8870-a2b62a95e780)<br>Factory
· Memory | ![Factory · Memory
after](https://github.com/user-attachments/assets/f904208c-32e7-45d5-81e9-3e0a3d9c93d6)<br>Factory
· Memory |
| ![Factory · Skills
before](https://github.com/user-attachments/assets/b00c15b6-d67b-45af-8870-5c6fc56c5000)<br>Factory
· Skills | ![Factory · Skills
after](https://github.com/user-attachments/assets/ecf41261-90b8-4e97-b0bc-3dfede6f185f)<br>Factory
· Skills |
| ![Factory · Tools
before](https://github.com/user-attachments/assets/2712c8a0-8306-42f5-a9d2-8d47c4622484)<br>Factory
· Tools | ![Factory · Tools
after](https://github.com/user-attachments/assets/3bf4364f-adfd-40e4-ac96-62994f638509)<br>Factory
· Tools |
| ![Factory · Behavior
before](https://github.com/user-attachments/assets/d528b382-0e89-4aba-8895-3c15148d66ad)<br>Factory
· Behavior | ![Factory · Behavior
after](https://github.com/user-attachments/assets/c40f7bca-6a7f-4e15-b65a-d09ff71f4072)<br>Factory
· Behavior |
| ![Factory · Repositories
before](https://github.com/user-attachments/assets/50c7ac2d-b4eb-4ba0-8d7c-a1aafff54c5f)<br>Factory
· Repositories | ![Factory · Repositories
after](https://github.com/user-attachments/assets/0b90ef84-ac17-4bca-9a2f-932a3f877695)<br>Factory
· Repositories |
| ![Factory · Work Intake
before](https://github.com/user-attachments/assets/f1a329c8-630a-4953-be7e-78233d23982a)<br>Factory
· Work Intake | ![Factory · Work Intake
after](https://github.com/user-attachments/assets/78a6b108-3c2f-4a65-b5bb-c30602a4d2b6)<br>Factory
· Work Intake |
| ![Factory · Work board
before](https://github.com/user-attachments/assets/44846099-d84e-44a1-be86-a13263647ba7)<br>Factory
· Work board | ![Factory · Work board
after](https://github.com/user-attachments/assets/9c4edba7-3ee9-4c6f-b993-73a986ee42ee)<br>Factory
· Work board |
| ![Factory · Manage Factory
before](https://github.com/user-attachments/assets/3dee8aa3-549a-4037-870c-5f438c2cf4c9)<br>Factory
· Manage Factory | ![Factory · Manage Factory
after](https://github.com/user-attachments/assets/fa8fae39-7cb2-46a5-84c6-b8a313d1b90d)<br>Factory
· Manage Factory |

One loading state everywhere (`SettingsSkeleton`, New/Settings Loading
story), built from the real rows and list items:

![Settings
loading](https://github.com/user-attachments/assets/3751d7f1-59b3-4b52-a903-58dabbc2b310)

## What changed

Playground UI (`@mastra/playground-ui/new/settings`):
- `SettingsLayout`: the page column and title (`header` for an app's own
header).
- `SettingsTitle`: dimmed, inset to the card; `info` keeps a section
description as a tooltip.
- `SettingsContainer`: the card, owning row spacing. Rows with nothing
in them take no space, so a list can always render its notice row.
- `SettingsRow` / `SettingsFieldsetRow`: control column with shared
field width; selects hug (`fieldTriggerWidthStyle` reads
`--field-max-width`). With `controlPlacement="below"` the control fills
the row.
- New `SettingsListHeader`, `SettingsEmptyRow` (now takes an `action`),
`SettingsItem`, `SettingsItemIcon`. `SettingsNoticeRow` stays.
- New `SettingsSkeleton`: the one loading state for settings,
placeholder rows (`variant="row"`) or list items (`variant="item"`)
inside the same card.
- Removed `SettingsAddRow` and `SettingsContainer`'s `variant`.
`Section`'s deprecated rows keep their old look on their own code.

Studio: the settings page uses `SettingsLayout` with its title in the
column. URL, API prefix and request headers are one "Mastra connection"
card. They only work as a set, so edits stay a draft: an "Unsaved
changes · Discard · Save changes" row shows up once something changed,
and saving applies all of it at once. This replaces "Save
configuration", which sat under the headers and read as saving only
them. The first-run connect screen keeps its own form.

`@mastra/react`: `useAuthCapabilities` and `usePermissionPatterns` keep
their last result while a new client loads (`keepPreviousData`). Before,
every connection change gave them a new query key, and the auth and
permission guards showed a full-page spinner until it answered, so the
page went blank on each save.

Factory: every settings page is on the shared components. Section stacks
are fragments under `SettingsLayout`, lists with an action use the
header or empty row (repositories, custom providers, speech-to-text
keys, Connect, intake pickers), and logo and icon rows are
`SettingsItem`s. Factory's own `SettingsAddRow`, `SettingsActionRow`,
`SettingsSectionHeader` and `SettingsRowsSkeleton` are gone. Every
settings loading state is `SettingsSkeleton` (Skills used to show plain
"Loading skills…" text). Models keeps its routing diagram; its lane and
defaults cards use the borderless settings surface. Work board keeps its
form layout. Memory is split into Personal memory and Factory memory,
and Build history is its own section.

## Testing

1. `mdev up storybook`: New/Settings, Page, Controls and Loading
stories.
2. `mdev up studio`, open Settings: change the URL, prefix or a header
and the unsaved row appears; Discard restores; Save applies everything
without the page going blank. Change the theme.
3. Factory settings: every section, especially Models.

Playground UI, Studio and Factory typecheck clean; the settings, Studio
connection, Factory settings and Models tests pass, and CI is green. Not
seen locally: a loading state on screen (they resolve too fast), Models
with providers connected, and Factory's Memory form (no models in the
local org).

## Related issue(s)

Fixes PLTFRM-3135

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

This PR makes settings pages in Playground UI, Studio, and Factory use a
more consistent layout. It adds shared building blocks so settings and
lists are easier to organize and read.

## Summary

- Add shared settings components in Playground UI, including a centered
640px layout, consistent containers and rows, list headers, empty and
notice rows, and settings items.
- Update the Playground settings page and Studio connection form to use
the shared layout. Add `CopyInput` for read-only values with a copy
action.
- Update Factory settings, workspace, and connection views to use the
shared components. Separate Personal memory and Factory memory, and give
Build history its own section.
- Remove older layout helpers, including `SettingsAddRow`,
`SettingsSectionHeader`, and the settings container variant.
- Add or update component tests and Storybook examples for the new
settings patterns.

**Checks:** not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-12 18:05:50 +04:00
dane-ai-mastra[bot]
05a6931471
chore: version packages (alpha) (#30172)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.

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

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

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

# Releases
## @mastra/client-js@1.60.0-alpha.12

### Minor Changes

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

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

### Patch Changes

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

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

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

### Minor Changes

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

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

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

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

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

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

### Patch Changes

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

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

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

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

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

### Minor Changes

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

### Patch Changes

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

### Minor Changes

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

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

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

### Patch Changes

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

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

### Minor Changes

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

### Patch Changes

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

### Minor Changes

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

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

### Patch Changes

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

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

### Minor Changes

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

### Patch Changes

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

### Minor Changes

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

### Patch Changes

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

### Minor Changes

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

### Patch Changes

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

### Minor Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

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

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

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

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

### Patch Changes

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

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

### Patch Changes

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


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

### Patch Changes

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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-12 14:42:02 +01:00
Eric Pinzur
72abae68eb
feat(observability): export span-local originating error counts (#30088)
## 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 -->
2026-11-12 14:21:22 +01:00
Eric Pinzur
f0710446e0
feat(observability): sort spans by model and provider (#30096)
Adds ascending/descending `model` and `provider` ordering to
`querySpans()` across Core, server, Client JS, PostgreSQL, DuckDB and
ClickHouse. No schema changes or backfill.

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

Sorting uses the dedicated columns before pagination, with
case-sensitive UTF-8 ordering, missing values last, and identity
tie-breakers. String cursors preserve their values and remain bound to
the query and trusted scope. Legacy attribute-based display values
remain available without changing cursor boundaries. Trace/thread sort
fields stay unchanged. The server advertises
`spanQueryModelProviderSort` and rejects unsupported stores.

This PR is API-only. Studio sorting controls and live-refresh changes
are tracked in
[OBS-906](https://linear.app/kepler-crm/issue/OBS-906/add-model-and-provider-sorting-to-spans-explorer).
Enabling those controls needs raw model/provider sorting values
available to the existing head-row merge, including when polls are
ordered by end time; using display values can disagree with database
ordering. The PR has no remaining Playground UI changes or release
entry.

Validation: Core/server tests, real storage conformance across
PostgreSQL, DuckDB and ClickHouse, mixed-core checks, and
Core/server/adapter typechecks passed for the API implementation. After
removing the UI changes, both existing span component/hook suites pass
(52 tests). Changed-file lint and docs checks including CI Vale pass.

A bounded local ClickHouse 26.6.8.7 comparison used 180,000 synthetic
rows, 10,000 matches per tenant, distinct tenants across cases, both
directions and continuation pages, and disabled query/condition caches.
Median CPU was 21.9 ms for start time, 19.4 ms for model, and 21.4 ms
for provider; median query memory was about 4.6 MiB for each (maximum
6.8/8.4/7.2 MiB). These are selection-query measurements on synthetic
OSS data, not a production benchmark.

Part of OBS-896. Platform API support and package pins follow this OSS
merge and snapshot publication. UI enablement is tracked separately in
OBS-906.


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

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

**ELI5:** Trace spans can now be sorted by their model name and provider
name, in both directions. The database does the sorting, so users can
page through the results in the right order.

## Overview

This change adds `model` and `provider` as sort fields for span queries.
It applies to the Core API, the server handlers, and the PostgreSQL,
DuckDB, and ClickHouse stores. The diff has 31 changed files, with 320
lines added and 43 removed.

## Core changes

- `SPAN_QUERY_ORDER_FIELDS` now includes `model` and `provider`.
- `SpanQueryPlanOptions` adds `allowSpanModelProviderOrdering?:
boolean`. Ordering by these fields requires this option.
- Trace and thread queries do not support these fields.
- Cursor validation accepts string or null values for `model` and
`provider`. Timestamp normalization applies only to `startedAt` and
`endedAt`.
- `SpanQuerySelectedRow` adds an optional `cursorSortValue`. Response
construction removes this field from returned spans. It uses the value
for the next-page cursor, and falls back to the row's ordering field
when the value is absent.
- The base storage feature union adds `span-query-model-provider-sort`.

## Server changes

- `assertObservabilitySpanModelProviderSortSupported` returns HTTP 501
with `SPAN_QUERY_UNSUPPORTED` when a store does not declare
`span-query-model-provider-sort`. The check runs before `querySpans` is
called.
- `ObservabilityStorageCapabilities` and its empty default add
`spanQueryModelProviderSort`, which defaults to `false`.
- The capability is reported as supported only when span queries are
supported, the core order fields include both `model` and `provider`,
and the store declares the feature.
- The system capabilities schema adds `spanQueryModelProviderSort:
z.boolean().default(false)`.
- The route handler permits model and provider ordering and performs the
capability check.

## Store changes

- **PostgreSQL:** Sorts by `model` and `provider` use `COLLATE "C"`. The
cursor bounds cast sort values to `text COLLATE "C"` when `stringSort`
is enabled. The feature is advertised only when the core order fields
include both fields.
- **DuckDB:** Sorts by `model` and `provider` use `"C"` collation.
Cursor values cast as strings with the same collation. The feature is
advertised only when the core order fields include both fields.
- **ClickHouse:** `afterCursor` treats `model` and `provider` as
strings. Null rows are included after the cursor for numeric and string
sorts. The feature is advertised only when the core order fields include
both fields.
- Returned `model` and `provider` values may still come from span
attributes. The code comments state that these fallback values are not
used for filtering or sorting.

## Tests and conformance

- Core tests cover ordering gating, rejection in trace and thread
queries, string and null cursor values, and rejection of cursors when
the order, filters, authorization, or scope change.
- Server tests cover the 501 rejection for `durationMs`, `model`, and
`provider` on older stores. They also cover capability parsing and the
capability flag in the system endpoint.
- Shared conformance tests in `stores/_test-utils` cover ascending and
descending pagination at page sizes 1, 2, and 3. They cover empty
strings, missing values, case and Unicode ordering, ties, and filter
exclusion. They also check that missing values sort last and that legacy
attribute values are not treated as dedicated fields.
- Store feature-list tests for ClickHouse, DuckDB, and PostgreSQL expect
the new feature flag.

## Changesets and documentation

- Changesets add minor release notes for `@mastra/core`,
`@mastra/server`, `@mastra/client-js`, `@mastra/duckdb`,
`@mastra/clickhouse`, and `@mastra/pg`.
- The advanced query reference adds the `spanQueryModelProviderSort`
capability row. It documents `model` and `provider` ordering. It states
that the comparison is case-sensitive and that missing values sort last
in both directions.

## Scope and limits

- This diff does not include Studio UI changes. The commit history says
UI enablement is deferred to a separate issue because it needs raw model
and provider values for head-row merging.
- This diff does not include client-js source changes. Its client-js
changeset documents the new sort fields.
- The diff does not include schema changes or backfill.
- The PR description reports these results, which this review did not
run or verify:
- Core and server tests, and real shared-storage conformance and
mixed-core checks, pass.
- Core, server, and adapter typechecks pass. Staged-file lint and docs
checks, including CI Vale, pass.
  - 58 Studio and MSW tests pass.
- The full Playground UI typecheck reports four unrelated chart and form
errors, and the library declaration build fails.
- A local ClickHouse 26.6.8.7 comparison with 180,000 synthetic rows
measured median CPU of 21.9 ms for start time, 19.4 ms for model, and
21.4 ms for provider. Median query memory was about 4.6 MiB for each.
These figures are not production measurements.
- Platform backend and UI wiring, and package pins, remain under
OBS-896.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-12 13:52:37 +01:00
mastra-platform[bot]
987566e882
fix(core): persist scores for scorer-target experiments (#30145)
Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>
2026-11-11 21:43:29 -08:00
dane-ai-mastra[bot]
a4258a989c
chore: version packages (alpha) (#30127)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-11 21:12:19 -08:00
dane-ai-mastra[bot]
055a8c3b82 chore: version packages 2026-11-12 04:17:40 +00:00
Anurag Ojha
7c40bc84b6
fix(react): load the Studio review queue page by page (#29291)
Co-authored-by: mastra-platform[bot] <mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-11 17:06:48 -08:00
mastra-platform[bot]
2d4284603a
Fix MCP core compatibility, Windows browser paths, and AI SDK tool titles (#30125) 2026-11-11 15:45:01 -08:00
dane-ai-mastra[bot]
9e82af0237
chore: version packages (alpha) (#30074)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-11 14:21:14 -08:00
Eric Pinzur
aa49b049d0
feat(observability): order completed spans by duration (#30085)
Adds `durationMs` ascending/descending ordering to `querySpans()`,
combined with existing duration filters and stable cursor pagination.
Duration is the completed span’s elapsed time; zero is valid. Trace
ordering and trace runtime semantics are unchanged.

The server advertises `spanQueryDurationSort` and rejects unsupported
stores before execution. A span-specific field list and default-off
planner option protect old servers paired with newer Core. Updated
adapters advertise support only when Core understands it. PostgreSQL and
DuckDB reuse their numeric ordering paths; ClickHouse handles numeric
cursor parameters and normalizes duration values returned as Int64
strings. Includes generated API types, documentation and package
changesets. No schema migration.

Implements the OSS portion of
[OBS-899](https://linear.app/kepler-crm/issue/OBS-899).
[OBS-904](https://linear.app/kepler-crm/issue/OBS-904) tracks Platform
integration after merge and a snapshot from main. UI is outside this
backend change.

Validation: 134 Core, 112 server, 125 Client JS, 100 PostgreSQL, 94
DuckDB and 103 ClickHouse tests passed (one existing ClickHouse skip).
Shared conformance exercises both directions, filters, zero durations
and ties across page sizes. The new Core tests fail before the
implementation; reverting the ClickHouse cursor fix makes both new
pagination cases fail by skipping rows. Old-Core adapters omit the new
feature; old stores receive a structured 501. Core/server/store
typechecks, Core/server/SDK builds, changed-file lint/format and
required docs checks passed. Vale reports six warnings in unchanged
text. Local Node 23.11.0 is outside the supported 22/24 versions; CI
must verify supported runtimes.

A bounded local ClickHouse 26.6.8.7 experiment used 20,000 synthetic
completed spans, the same duration filter and 50-row first/second pages
in both directions. Duration ordering peaked at 3.43–3.67 MiB versus
3.42–3.66 MiB for timestamp ordering; both read 20,000 rows/1,488,890
bytes. Duration query CPU was 7–25 ms. These are single-run local
measurements, not production capacity evidence; no ingestion or storage
layout changed.


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

## ELI5

This PR lets users sort completed spans by how long they took. It keeps
pagination stable and enables the feature only when Core and the storage
adapter support it.

## Changes

- Added ascending and descending `durationMs` ordering to
`querySpans()`.
- Added duration-aware cursor validation and stable pagination.
- Added `spanQueryDurationSort` capability reporting.
- Added HTTP 501 handling for unsupported stores.
- Added compatibility gates for older Core versions.
- Updated PostgreSQL, DuckDB, and ClickHouse adapters.
- Converted ClickHouse duration values to numbers.
- Added Core, server, adapter, and conformance tests.
- Updated generated API types, documentation, and package changesets.
- No schema migration was added.

## Validation

- Reported passing tests: Core 134, server 112, Client JS 125,
PostgreSQL 100, DuckDB 94, and ClickHouse 103.
- One existing ClickHouse test remains skipped.
- Reported typechecks, builds, lint, formatting, and documentation
checks passed.
- Vale reported six warnings in unchanged text.
- CI verification on supported Node.js versions is not available.
- Diff size: 28 files changed, with 220 additions and 8 deletions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-11 19:54:11 +01:00
mastra-platform[bot]
b0ef22e7bf
feat(schedules): Add bounded one-off schedules (#25131)
> Opened by @abhiaiyer91

Refs #24610

## Summary
Schedules can now fire once or stop after a given time, so you no longer
need to pin a cron expression to a date and clean it up yourself.

- **New `completed` status**: the scheduler and timing reconciliation
set it when no automatic fires remain. It's written in the same atomic
`nextFireAt` check-and-set used to claim a run, so a schedule still
fires only once across instances. A cron with no future occurrence left
also moves to `completed` instead of erroring. `pause`/`resume` on a
completed schedule return 409. Changing `runAt`/`endAt` reactivates it
only when the resulting timing can still fire. `list()` hides completed
schedules unless you pass `status: 'completed'`.
- **Declarative workflow schedules**: `createWorkflow({ schedule: {
runAt } })` and `{ cron, endAt }` are supported. Past times are accepted
so redeploys don't fail, and a completed schedule isn't re-armed unless
its timing changes.
- **Trigger kind**: one-off fires report `trigger.kind: 'once'`.
- `run(id)` doesn't complete a one-off schedule.

## Surfaces
- **Core**: types, validation, scheduler claim logic,
create/update/pause/resume/list, declarative sync.
- **Storage**: new nullable `run_at`/`end_at` columns for libsql, pg,
mysql, mongodb, spanner, convex and in-memory. Existing columns are
untouched: one-off schedules store `cron` as `''`.
`updateScheduleNextFire` takes an optional `newStatus`.
- **Server/client-js/CLI**: request bodies accept `runAt`/`endAt`
(one-of rule checked in the schema). Responses include the new fields
and `completed`. Route types and CLI route metadata regenerated.
- **Studio**: shows the run time for one-off schedules, shows the
`endAt` bound, adds a `completed` badge and hides pause/resume for
completed schedules.
- **Docs + changeset.**

## Not in this PR (remaining #24610 work)
- ISO 8601 string inputs for `runAt`/`endAt` (numbers and `Date` are
accepted today).
- The template `schedule_once` tool.

## Test plan
- [x] core: schedules, scheduler, cron, schedule-config and scheduler
integration tests (260 passing), clean `tsc`
- [x] Shared adapter suite gained tests for `runAt`/`endAt` round-trip
and atomic status CAS. Passing on libsql, pg, mysql and mongodb
(Docker), plus convex server tests. **Not run on Spanner (no emulator
available); typecheck only.**
- [x] server schedules handler tests (51 passing, including
one-off/bounded creation and body validation)
- [x] client-js and playground typecheck clean; playground schedules
tests passing

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

## ELI5

Schedules can now run once at a chosen time or repeat until a chosen end
time. They complete when their planned runs are over, and changing their
timing can make them active again.

## Summary

- Added `runAt` for one-off agent and workflow schedules. API-created
schedules require a future `runAt`; declarative workflow schedules can
register past times as `completed`.
- Added `endAt` for cron schedules. A schedule becomes `completed` when
its next run would occur after `endAt`, or when no future run remains.
- Completed schedules cannot be paused or resumed. Timing changes can
reactivate a completed schedule when a future run remains. `list()`
hides completed schedules unless callers filter with `status:
'completed'`.
- Resuming a paused one-off schedule after its `runAt` has passed allows
it to fire on the next scheduler tick. Calling `run(id)` manually does
not complete a one-off schedule.
- Added the `once` trigger kind for scheduled one-off agent fires.
Manual runs remain `manual`.
- Declarative workflow schedules preserve completed status across
redeploys when timing is unchanged. Timing changes can re-arm them.
- Updated schedule APIs, storage adapters, Studio, and documentation.
Storage persists `runAt` and `endAt` and supports atomic status updates.

## Checks

Current-head CI, build, and test results: not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: NikAiyer <nick.aiyer@gmail.com>
Co-authored-by: mastra-platform[bot] <mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: Ehindero Israel <iehindero419@stu.ui.edu.ng>
2026-11-11 19:33:50 +01:00
dane-ai-mastra[bot]
3a6ca42696
chore: version packages (alpha) (#30026)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-11 08:16:57 -08:00
Eric Pinzur
c860b9bb43
feat(observability): support OSS feedback replacement (OBS-887) (#30059)
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 -->
2026-11-11 17:04:57 +01:00
Eric Pinzur
9751742c44
feat(observability): add aggregated trace root contracts (#30054)
Adds the shared contract for the Platform aggregated-roots experiment in
[OBS-891](https://linear.app/kepler-crm/issue/OBS-891): optional
`rootSource`, `rootKind`, runtime/error totals, and availability
reporting. Legacy requests retain their cursor bindings; aggregated
cursors are separate and aggregated metadata predicates and delta
requests are rejected.

The planner requires host opt-in. OSS servers report the capability as
false and explicitly reject aggregated requests; storage implementations
and UI are outside this prerequisite. Generated client and CLI contracts
are updated.

Validated with 102 core tests, 146 server tests, core typecheck,
core/server/client builds, and formatting/lint checks. A mutation check
confirms that removing root-source cursor binding fails the regression
test. Platform implementation follows after this merges and a snapshot
is published.

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

## ELI5

This PR defines how systems can report aggregated trace roots and their
totals. Systems without support reject these requests, while existing
legacy trace queries continue to work.

## Changes

- Added `rootSource` with `legacy` and `aggregated` values.
- Added aggregated-root response fields:
  - `rootKind`
  - `runtimeDurationMs`
  - `errorCount`
- Bound trace and group cursors to their root source.
- Rejected aggregated delta requests.
- Rejected metadata predicates for aggregated roots.
- Kept `runtimeDurationMs` and `errorCount` response-only.
- Added the `traceQueryAggregatedRoots` capability, which defaults to
`false`.
- Added a `501 TRACE_QUERY_UNSUPPORTED` response for unsupported
aggregated requests.
- Updated generated client and CLI route contracts.
- Added core and server regression tests.
- Added release changes for `@mastra/core`, `@mastra/client-js`,
`@mastra/server`, and `mastra`.

## Validation

Not available from completed checks on the current head.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-11 14:26:42 +01:00
Eric Pinzur
8ab6015fb4
fix(client-js): support accepted observability deletion responses (#30051)
The JS client accepts HTTP 202 deletion responses at runtime, but its
types only describe OSS success responses. Include `{ accepted: true }`
in the return types of `deleteTraces`, `deleteScores`, and
`deleteFeedback`, with docs and a patch changeset explaining
asynchronous acceptance. Export the three response types from the public
client entry point so downstream packages can emit portable
declarations. OSS server/storage behavior and generated route contracts
are unchanged; Platform endpoints and rollout remain separate work.

Callers that previously read `result.success` directly need to narrow
the response:

```ts
const result = await client.deleteFeedback({ feedbackIds: ['feedback-1'] });
if ('accepted' in result) {
  console.log('Deletion requested');
} else {
  console.log(result.success);
}
```

Verified 137 focused runtime tests, the new type regression (fails
before the fix), TypeScript checks, the client build, the downstream
React SDK build (including declarations), package lint, formatting, and
documentation checks. The HTTP suite replaces the mocked deletion tests
and covers 200/202 bodies, POST/DELETE JSON preservation, and 400/500
failures. Docs checks have zero errors and three warnings on unchanged
text. No deployed Platform end-to-end flow was tested.

Fixes OBS-889.



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

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

## ELI5

Deletion requests can now mean “cleanup accepted and queued” instead of
“cleanup finished.” The JavaScript client now supports both responses
and documents how to handle them safely.

## Changes

- Added `{ accepted: true }` to the response types for `deleteTraces`,
`deleteScores`, and `deleteFeedback`.
- Exported these response types from the public client entry point.
- Added HTTP tests for `200`, `202`, `400`, and `500` responses,
including request details and response-body preservation.
- Added TypeScript regression tests for both client entry points and
response narrowing with `'accepted' in result`.
- Updated client and observability documentation to explain asynchronous
Platform cleanup.
- Added a patch changeset for `@mastra/client-js`.
- Replaced the previous deletion tests with shared deletion coverage.
- No server or storage implementation changes were made.

## Validation

- Test and build execution results: not available.
- The diff includes runtime and type-test coverage for the updated
behavior.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-11 13:32:53 +01:00
dane-ai-mastra[bot]
8bce7717eb
chore: version packages (alpha) (#29986)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-10 20:51:40 -08:00
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
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
bfda77de97
fix(core,server): scope experiment comparison by organization and project (#29479)
`mastra.datasets.compareExperiments` had no way to scope by organization
or project, and the compare route ignored the tenancy query params the
other dataset routes accept. A caller scoped to one tenant could compare
experiments from another by ID.

`compareExperiments` now takes `organizationId` and `projectId`. When
either is set, every experiment must match, otherwise it throws
`EXPERIMENT_NOT_FOUND` (same as a missing row, so other tenants' IDs
don't leak). The route reads `tenancyQuerySchema` and passes the scope
to both the dataset lookup and the comparison. Unscoped calls behave as
before.

Added manager tests for a cross-tenant pair (rejected, fails without the
fix) and a same-tenant pair. Core datasets tests (490), server datasets
handler tests (106), tsc and lint pass.

Fixes PLTFRM-3165


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

## ELI5

When a caller chooses an organization or project, experiment comparisons
now stay within that scope. Experiments outside it are treated as not
found, so their results are not exposed.

## Changes

- `mastra.datasets.compareExperiments` accepts optional `organizationId`
and `projectId` values.
- When either scope is set, the manager checks every distinct experiment
ID. It throws `EXPERIMENT_NOT_FOUND` if an experiment is missing or
outside the scope.
- The comparison route reads tenancy query parameters and passes them to
the dataset lookup and comparison.
- If scoped comparison is requested with a core version that does not
advertise tenancy enforcement, the route returns HTTP 501 before reading
data. Unscoped comparisons remain unchanged.
- Tests cover cross-organization rejection, same-organization
comparisons, and the route’s behavior when the core feature is
unavailable.
- Updated generated route metadata and added patch changesets for
`@mastra/core` and `@mastra/server`.

## Validation

Current-head test, TypeScript, and lint results are not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-11-10 12:27:39 -05:00
Arthur Fiorette
1ac251ba65
test(e2e): ensure CI fails when type checking fails (#29605)
## Description

Previously the e2e type-check job ran the type tests, ignored the result
and stayed green with 33 failures. `test.ts` now fails the job when any
run fails. It also runs plain `tsc`, because vitest skips type errors
outside test bodies.

For example, [E2E Type check in run
42058855421](https://github.com/mastra-ai/mastra/actions/runs/42058855421/job/127363177526)
passed with this in its log:

```
 Test Files  6 failed | 6 passed (12)
Type Errors  33 failed
```

Fixture tests that no longer matched the current types are updated. The
zero-argument `bail()` call is removed, since #12211 dropped that
overload on purpose. The `network()` tests now expect `undefined`
output, because `network()` ignores the agent's `defaultOptions`.

client-js `generateLegacy` typed `object` as `never` with `output` and
dropped `text` with `experimental_output`. It now infers both from the
schema:

```ts
const r = await agent.generateLegacy({ messages: 'hi', output: schema });
r.object; // before: never, now: inferred from schema
```

With #29581 merged, all type tests and both `tsc` runs pass.

## Related issue(s)

Fixes #29603
Fixes #29604

## Type of change

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

## Checklist

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


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

## ELI5

This PR makes the e2e type-check job report failures from all its
checks, including errors that test-focused checks can miss. It also
updates type tests to match current API types and fixes the result types
for `client-js` `generateLegacy()`.

## Changes

- The e2e type-check runner now runs two Vitest suites and two `tsc`
checks. It continues after a check fails and sets a failing exit status.
- The `generateLegacy()` overloads now retain schema types for `output`
and `experimental_output`. New type tests check the inferred `object`
and `text` types.
- Updated e2e type-test expectations for schemas, tools, workflows, and
client workflow start results.
- Updated `network()` tests to expect `undefined` when no structured
output is passed. This does not add inference from the agent’s
`TOutput`.
- Added a patch Changeset for `@mastra/client-js`.

## Validation

Completed CI, build, and test results: not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-10 08:29:06 -08:00
dane-ai-mastra[bot]
7c4dd88400
chore: version packages (alpha) (#29889)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-10 15:48:17 +01:00
Eric Pinzur
2cfa92405b
feat(observability): add shared text search query contracts (#29897)
Adds shared text-search query contracts for Platform integration:
optional `textSearch` on `querySpans()` and `queryTraces()`,
normalization, a 3–256 character limit, and cursor binding. This does
not implement or enable text search in OSS stores.

Adds capability reporting, request forwarding, and unsupported-store
rejection, with generated client types and CLI metadata. Platform search
implementation and rollout flags follow in OBS-867. Delta search is
rejected for now. Public documentation is unchanged; changesets only
describe the contract additions.

Validated with 404 focused tests, 5 type tests, and core/server/client
typechecks. The 228 core query tests were rerun after reducing the limit
to 256. New contract tests also fail against the original
implementation.

Fixes
[OBS-866](https://linear.app/kepler-crm/issue/OBS-866/add-shared-text-search-query-contracts).


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

## ELI5
This PR gives span and trace queries a standard way to request text
search. It also lets clients check whether a storage provider supports
that search, so unsupported searches return an error instead of
misleading results.

## Summary
- Add optional `textSearch` to span and trace query contracts. Trim
outer whitespace, convert input to lowercase, and require 3–256 Unicode
code points.
- Bind normalized search text to query cursors. Reject `textSearch` for
delta trace queries.
- Add span and trace text-search capability fields. Default missing
fields to `false` for compatibility with older responses.
- Forward search input to query planners. Return HTTP 501 when the
configured storage provider does not declare support.
- Report text-search capability only when Core can parse the field and
the storage provider declares the matching feature.
- Add tests for validation, normalization, cursor binding, unsupported
stores, and compatibility behavior.

## Validation
Reported test and typecheck results: not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-10 15:12:03 +01:00
mastra-platform[bot]
3655736ec9
feat(ai-sdk): add reconnectable chat routes (#29549)
## Summary

- add opt-in `chatRoute({ resumable: true })` support for stock AI SDK
`useChat({ resume: true })`
- register the existing POST route plus `GET <path>/:chatId/stream`
- use the AI SDK chat ID as the Mastra thread ID so the GET route can
resolve the active run and resume it through `agent.observe(runId)`
- preserve AI SDK v5/v6/v7 stream conversion, SSE heartbeats, Editor
agent resolution, and resource/thread/FGA checks
- allow route factories to return explicit route arrays while Mastra
normalizes stored server configuration to a flat route list

## Usage

```ts
const routes = chatRoute({
  path: '/chat/:agentId',
  resumable: true,
});

const mastra = new Mastra({
  server: {
    apiRoutes: [routes],
  },
});
```

On the client, standard AI SDK configuration is enough:

```ts
useChat({ resume: true });
```

No custom `DefaultChatTransport` request callbacks or client-managed
Mastra run IDs are required.

## Behavior

With `resumable: true`:

- the POST body chat ID becomes the Mastra memory thread ID
- closing the POST connection detaches the client without aborting the
agent run
- `GET <path>/:chatId/stream` finds the active run for that chat thread,
replays retained events, and follows live output
- unavailable, inaccessible, expired, or finished runs return `204`
- abort-based cancellation through `useChat().stop()` is unavailable
because the server cannot distinguish an intentional stop from refresh,
tab closure, or network loss

Without `resumable: true`, existing behavior is unchanged and the POST
request abort signal still cancels execution.

## Current limitation

Active-run discovery is process-local. Refresh reconnection works while
the original server process still owns the active thread run.
Cross-process discovery requires a separate Core-level shared active-run
registry and is outside this PR.

## Test plan

- `pnpm test src/__tests__/chat-route-resumable.test.ts
src/__tests__/abort-signal.test.ts` — 16/16 passed
- `pnpm test` in `client-sdks/ai-sdk` — 41 files, 345 tests, no type
errors
- `pnpm build:lib` in `client-sdks/ai-sdk`
- `pnpm lint` in `client-sdks/ai-sdk` — 0 warnings/errors
- Prettier and `git diff --check`

Closes #24426. This implements browser-refresh reconnection with stock
`useChat`. Cross-process active-run discovery remains a future
enhancement rather than a requirement for this issue.

---------

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: Ehindero Israel <iehindero419@stu.ui.edu.ng>
2026-11-10 11:11:19 +01:00
dane-ai-mastra[bot]
6deb16047f
chore: version packages (alpha) (#29719)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.

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

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

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

# Releases

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

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


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


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


## mastracode@0.50.0-alpha.3


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


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


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


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


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


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


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


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


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


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


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


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


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


## create-factory@0.4.3-alpha.3


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


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


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


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


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


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


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


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


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


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


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


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


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


## mastra@1.39.0-alpha.3


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


## create-mastra@1.39.0-alpha.3


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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-10 10:33:29 +01:00
Marvin Frachet
7601d91220
fix(react): stop useChat sendMessage from rejecting when the user presses Stop (#29764)
## Summary

In `@mastra/react`, pressing Stop (`cancelRun`) while a reply is
streaming made `useChat`'s `sendMessage` reject with `AbortError: signal
is aborted without reason`. Apps that call `void chat.sendMessage(...)`
(the usual pattern) logged an unhandled rejection every time a user
stopped a reply.

This PR changes that:

- `sendMessage` now **resolves** when the reply was ended by Stop or by
a newer send replacing it. This applies to both the legacy `/stream`
route (the default) and the thread-signal route.
- Starting a new send while an older reply is still streaming no longer
sets `isRunning` to `false` for the newer reply. Only the run that still
owns the stream controller clears it.
- If you abort **your own** `signal` passed to `sendMessage`, the send
still rejects, same as `fetch`.

This changes behavior for every `useChat` consumer, which is why it is
split out of #29438 for its own review.

## Test plan

- [x] New MSW tests in
`client-sdks/react/src/agent/__tests__/cancel-run.msw.test.tsx`, under
"when Stop cuts off a reply that is still streaming":
  - Stop resolves the send instead of rejecting it
- a newer send keeps `isRunning` true when it replaces a streaming one
(the second response's headers are held, so its `start` chunk cannot
hide the bug)
  - aborting the caller's own signal still rejects
- [x] Before the fix, 4 of these tests fail with 2 unhandled errors.
Mutating each guard (`stoppedHere`, the caller-signal check, the
`settleStopped` ownership check, the `settleStopped` call) fails at
least one test.
- [x] Full `@mastra/react` suite passes (1020 tests) on the branch this
came from. The agent hook code is identical to `main` apart from this
change.
- [x] In the `examples/gen-ui` app (Playwright): stopped a streaming
reply, saw no unhandled rejection, and the next message got its reply.


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

## ELI5

When someone presses Stop, `sendMessage` now finishes normally instead
of reporting an error. If a new message replaces a reply, the chat stays
marked as running. Aborting with the caller’s own signal still reports
an `AbortError`.

## Changes

- Updated `useChat` to treat intentional stream cancellation as a normal
end in both the legacy route and thread-signal route.
- Prevented an older send from clearing `isRunning` when a newer send
owns the stream.
- Removed an unconfirmed pending message when Stop interrupts a
thread-signal send.
- Added tests for Stop, replacement sends, and caller-signal aborts,
including thread-signal fallback routes.
- Added a patch changeset for `@mastra/react`.

## Checks

- Test and CI results: not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-09 23:10:16 +01:00
Arthur Fiorette
a836d09a43
fix(core, client-js, inngest): accept zod v3 schemas and newer ai v7 messages in public types (#29581)
## Description

zod v3 schemas work at runtime but some public types rejected them or
inferred `unknown`, and `UIMessage[]` from `ai@7.0.163` stopped
type-checking against core's vendored v7 types.

```ts
import { z } from 'zod/v3';
const schema = z.object({ answer: z.string() });

createStep(agent, { structuredOutput: { schema } }); // before: No overload matches this call
new Agent({ ...config, defaultOptions: { structuredOutput: { schema } } }); // before: TS2322
(await agent.generateLegacy('hi', { output: schema })).object; // before: unknown, now { answer: string }
await client.getAgent('a').generate('hi', { structuredOutput: { schema } }); // before: TS2590

import type { UIMessage } from 'ai'; // 7.0.163, has SteeringMessageUIPart
await agent.generate(uiMessages as UIMessage[]); // before: 'SteeringMessageUIPart' is not assignable
```

The zod v3 fixes point the user-facing option types at `PublicSchema` /
`PublicAgentExecutionOptions` (the runtime already converts with
`toStandardSchema`). `inferOutput` gets a zod v3 branch that reads
`_output` structurally, like `InferPublicSchema` in schema-compat, so a
v3 schema from a different zod install than core's is inferred too.
Client-js `StreamParamsBase` is built on `AgentExecutionOptionsBase`,
which avoids the TS2590.

For the v7 messages, `MessageInput` also accepts a v7 `UIMessage` whose
parts only need a string `type`. Core can't know the shape of part types
released after its vendored copy, so those parts are deliberately loose.
Inline object literals are still checked against the known part types,
because excess property checks rule out the loose member for them.
Mastra doesn't process the new part types yet.
`AIV6Adapter.fromUIMessage` paired parts with its v5 bridge output by
index, so a part the bridge drops (an unknown type, or an empty text
part) shifted every later part. It now drops those before pairing.

The PR also fixes two tests that failed CI on `main`: the stored board
runtime test still imported `factoryMemorySettingsUserId` after #29366
renamed it, and the redactor leak check matched `4111` inside a random
message UUID.

Type tests cover each case in the core and inngest type-test files, and
they fail with the fix reverted. The e2e client-js fixture imported
`zod/v3` and `zod/v4`, which don't resolve there, so its schemas were
`any`. This PR fixes those imports. The e2e type-check run still ignores
its exit code (`e2e-tests/type-check/test.ts:45`), which is left for a
separate PR.

## Related issue(s)

Fixes #29574
Fixes #29575

## Type of change

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

## Checklist

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


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

## ELI5

This PR lets TypeScript accept Zod v3 schemas and newer AI SDK v7
messages in Mastra’s public APIs. It also fixes message-part matching so
ignored parts do not change how later parts are handled.

## Summary

- Updated agent and workflow option types to accept public schemas,
including Zod v3 schemas. Added Zod v3 output inference for
`generateLegacy`.
- Added forward-compatible input types for newer AI SDK v7 UI message
parts. Mastra accepts these messages, but does not yet process unknown
part types.
- Updated the AI v6 adapter to filter unsupported parts and empty text
parts before matching converted message parts.
- Updated client-js stream parameter types to avoid a complex TypeScript
union. Corrected Zod imports in a type-check fixture and added
regression type tests.
- Updated `getLastMessage` to use the last part only when it contains
nonempty string text.
- Added patch changesets for `@mastra/core`, `@mastra/client-js`, and
`@mastra/inngest`.

**Diff:** 19 files changed; 191 additions and 34 deletions.

**CI and test results:** not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-09 16:11:29 -03:00
shreyas-mastra
224d51972a
fix(client-js): run every parallel client tool call in generate() (#29407)
When the model called several client tools in one step,
`agent.generate()` and `agent.generateLegacy()` ran the first one and
immediately sent its result back, so the other calls never ran and never
got a result. `stream()` already handled this.

Both methods now run every client tool in the step, then continue once
with all the results in a single tool message. Calls for tools that
aren't client tools are skipped as before.

Added tests for both methods with two parallel calls. client-js agent
tests pass (144), and `tsc` and lint are clean.

Fixes PLTFRM-3152


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

## ELI5

When an agent asks the client to run several tools at once, the client
now runs each eligible tool and sends all their results back together.
This lets the agent continue with the full set of results.

## What changed

- `agent.generate()` and `agent.generateLegacy()` now collect results
from all client tool calls in a step and continue with one tool message.
- Both methods stop starting additional client tools if the request is
aborted.
- Added tests for both methods that cover parallel tool calls, result
order, and abort behavior.
- Added a patch changeset for `@mastra/client-js`.

## Validation

Test, type-check, and lint results are not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-09 12:40:00 -05:00
dane-ai-mastra[bot]
009f632534 chore: version packages 2026-11-09 04:19:07 +00:00
dane-ai-mastra[bot]
f21e0742ce chore: version packages 2026-11-07 04:18:11 +00:00
mastra-platform[bot]
d6a5f98df3
fix: index observe chunks for resume (COR-1506) (#29520)
> Opened by @user_01KNA8J74D4RF84RXSDRX26BS9

Linear:
[COR-1506](https://linear.app/kepler-crm/issue/COR-1506/observe-offset-cant-be-used-to-resume-it-counts-log-events-but-clients)

## Problem

`observe({ runId, offset })` takes `offset` as a position in the run
log. Clients can't compute that position:
- Some log entries never reach the client. These include
iteration-complete records after every step and ownership markers.
- Updates on the wire carried no index.

A client that resumes at "number of updates received" lands too early
and gets repeated updates. The drift grows by one per completed step, so
every tool-using run that reconnects after its first step is affected.
On a 3-step tool loop, 16 of 28 cut points repeated 1–2 updates on both
durable and evented engines.

## Fix

- **Index on updates:** every update now carries `index`, the run-log
position it came from. This covers:
  - `/observe` on every agent
  - `/stream` on durable and evented agents
- core `stream()`/`observe()` chunks and client-js
`observe()`/`stream()`
- **Resuming:** pass `index + 1` of the last received update that has an
index as `offset`. Gaps in the numbering are expected; they're log
entries that send nothing.
- **Unindexed updates:** the synthesized `abort` update carries no
index. Its log position is on the `finish` sent beside it. Client-built
structured-output `object` chunks have no index either. An
`object-result` logged by a structuring-model run carries one. Unindexed
updates don't move the resume point. A client that reconnects between
`abort` and `finish` gets the `abort` again.
- **`offset` is unchanged:** it still means a run-log position.
- Core no longer strips `index` in
`DurableAgent.__subscribeToRunStream`. The stream adapter and the
server's `toAgentStreamChunks` copy the envelope's index onto each chunk
and drop any index a forwarded sub-agent chunk carried. `index` is
optional on `BaseChunkType` and `DataChunkType`.
- **Also fixed:** on plain agents, `/observe` (HTTP and core
`agent.observe()`) with an offset past the end of a finished run used to
wait for the idle timeout or hang. It now closes immediately. It reads
the log from just before the offset and only falls back to a full read
when that window is empty. The check runs in the background, so it never
delays returning the stream or its cancel handle. A trailing `error`
chunk doesn't count as the end of the run.

## Migration

`index` is a new field and `offset` keeps its meaning:
- Callers that pass a log position need no change.
- Callers that replay from `offset: 0` need no change. They get the same
updates in the same order, now with `index` set.
- Only callers that passed a count of updates received need to change.
They were already getting repeats after step boundaries; switch them to
`index + 1` of the last indexed update.

## Evidence

| Check | Result |
| --- | --- |
| Red/green | With `main`'s core and server, 15 tests on numbering and
`/stream`–`/observe` matching fail; with this change all pass. |
| Cut points | Every cut point of a 3-step tool loop on durable and
evented engines resumes from the first `/stream` connection at last
index + 1. Covers the HTTP route and client-js `stream()` → `observe()`.
|
| `/stream` vs `/observe` match | Frames are identical JSON, including
`index`. Replay from 0 equals the first `/stream`. |
| End of run | Resume after finish or past the end returns the rest and
closes, including far past the end (offset 100). |
| Adapters | Hono 98/98, Fastify 98/98, Express 90 passed + 8 skipped
(see bug 1 below). The shared suite is now wired into Express and
Fastify. |
| Redis restart | Real-Redis split-deploy test (in
`pubsub/redis-streams/src/observe-cross-process.test.ts`) passes on both
engines. The client resumes on a freshly booted API process at last
index + 1 with nothing repeated or missing. Evented: the worker executes
the run and the API is killed with SIGKILL. Durable runs execute in the
API that started them, so that API stays up; the client drops its
connection and resumes on a second API. |
| Suspend | After tool approval, indexes keep increasing. Observers
parked mid-suspend and every cut across the suspend resume correctly on
both engines. |
| Unit suites | server `agents.test.ts` 289, core `src/stream` +
`src/agent/streams` 481 |
| Static | tsc clean on core, server, client-js, the test suite, the
Hono/Express/Fastify adapters and redis-streams. oxlint 0 warnings. |

## Scope

Plain (non-durable) agents' `/stream` updates aren't numbered yet. The
caller receives each update before the cache assigns its number. That's
tracked in COR-1510. Plain agents' `/observe` is covered here.

## Existing bugs found (not fixed here)

1. **Express untilIdle 404:** after a client drops an untilIdle stream
on a durable or evented agent, Express answers `/observe` with 404 "Run
not found". It fails the same way on `main`. Those 8 cases are skipped
on Express only, via `skipUntilIdleDisconnectReplay`.
2. **Finished durable run, other API:** a finished durable run returns
404 on `/observe` from any API process except the one that executed it
(`authorizeDurableRun`, `handlers/agents.ts`). Resuming while the run is
live works from any API.
3. **Plain replay mismatch:** on plain agents, replayed
`step-finish`/`finish` payloads differ from the live ones (for example
`timestamp` and `processorRetryCount`). Related to COR-1510.

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

## ELI5

When a connection drops, clients need to know which updates they already
received. This change adds positions to many updates so clients can
resume from the right place. It also closes observations of finished
runs when the requested position is past the end.

## Summary

- Added optional `index` values to chunks from durable and evented agent
streams, `observe()` streams, and corresponding HTTP routes. Clients can
resume by passing the last indexed chunk’s `index + 1`.
- Preserved run-log indexes through core stream adapters and server
frame conversion. Sub-agent data chunks do not carry a child run’s index
into the parent stream.
- Some chunks remain unindexed, including synthesized `abort` chunks and
client-built structured-output `object` chunks. Failed cache writes and
non-atomic custom-cache indexing can affect replay.
- Updated API schemas and documentation to explain index gaps, replay
limits, and resumption.
- Added past-end handling for finished plain-agent observations in core
and HTTP `/observe`. History checks do not delay stream return or
prevent cancellation.
- Added tests for indexed replay, past-end closure, cancellation during
history reads, sub-agent index isolation, and observation across API
restarts.

**Validation:** Current-head CI, build, and test results are not
available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: mastra-platform[bot] <mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: NikAiyer <nick.aiyer@gmail.com>
2026-11-06 11:40:46 -08:00
Eric Pinzur
23308f9c19
feat(observability): add single score and feedback reads (#29529)
## Description

Add `GET /observability/feedback/:feedbackId` and typed client getters
for individual scores and feedback. Missing records return HTTP 200 with
`{ score: null }` or `{ feedback: null }`, preserving the existing score
endpoint contract.

```ts
const { score } = await client.getScore(scoreId);
const { feedback } = await client.getFeedback(feedbackId);
```

Client getters encode path IDs and preserve configured API prefixes,
credentials, and headers. Feedback reads use direct lookups in
in-memory, PostgreSQL, ClickHouse, and DuckDB storage. Includes
generated route types/CLI metadata, public API documentation, and
changesets.

Validation: package builds passed; 30 single-record HTTP cases passed
across five server adapters; 6 client transport tests, 341 server tests,
and 9 focused database cases passed across PostgreSQL/TimescaleDB,
ClickHouse, and DuckDB. Removing the feedback route caused the new
feedback HTTP cases to fail. Permission generation/checks, scoped
implementation lint, MDX formatting, Remark, and Vale passed.

Broader validation limitations: existing POST cases fail with
body-parser dependency errors in Express, Koa, and NestJS; the new GET
cases pass in all five adapters. The shared storage test helper also has
existing import-order lint errors outside the changed lines.

## Related issue(s)

Fixes
[OBS-790](https://linear.app/kepler-crm/issue/OBS-790/add-oss-single-score-and-feedback-reads),
under [OBS-792](https://linear.app/kepler-crm/issue/OBS-792). Platform
single-record endpoints remain scoped to OBS-791.

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

Applications can now look up a score or feedback record by its ID. If no
feedback record exists, the server returns `null`; it can also add
available author details to feedback.

## Summary

- Added `GET /observability/feedback/:feedbackId`. The route uses
existing observability authorization and returns `{ feedback: record }`
or `{ feedback: null }`.
- The feedback route adds author details when available. It returns HTTP
501 when the storage provider does not support single-feedback reads.
- Added `getScore(id)` and `getFeedback(id)` to the JavaScript client.
These methods encode IDs in the URL and use the client’s configured
request options.
- Added direct feedback lookups to in-memory, PostgreSQL, ClickHouse,
and DuckDB storage.
- Added response types, generated route metadata, API documentation,
tests, and changesets.

## Validation

Test and CI results: not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-06 10:23:52 +01:00
Damien Schneider
8d07b0b293
feat(factory): live Mistral dictation, Slack voice clip failure card, and voice fixes (#29573)
## Description

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

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

### Behavior changed

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

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

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

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

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

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

### Fixes

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

### Shape changed

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

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

### Decisions

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

### Watch

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

### Not verified

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

---

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

## Related issue(s)

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

## Type of change

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

## Checklist

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





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

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

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

## Validation
- Added or updated tests for live dictation, voice routes, Slack failure
cards, rate limiting, transcription retries, Deepgram options, and
microphone recording.
- The author reports testing browser capture and live text with MSW and
a fake `AudioContext`, and testing `liveDictation.ts` against Mistral.
The live composer was not verified in a real browser.
- A real Slack thread card and a real out-of-credit response were not
verified.
- Current-head build, test, and CI results: not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-05 23:57:25 +01:00
Arthur Fiorette
ea37ef0386
fix(client-js): accept plain-object requestContext in agent.generate and agent.stream (#29577) 2026-11-05 14:13:37 -08:00
mastra-platform[bot]
2f93851c37
fix(core): make Agent.durable configure resumable streams only (#29503)
Co-authored-by: NikAiyer <nick.aiyer@gmail.com>
2026-11-05 11:32:10 -08:00
Eric Pinzur
25726091b3
feat(playground-ui): configure Platform feedback creation (#29528)
## Description

Platform uses the shared feedback composer but needs explicit context
mode and author fields, and cannot yet support its delete/review
actions. Add optional `feedbackOptions` across trace, span, and thread
composers: `{ contextMode: 'resolve', feedbackUserId: null, allowDelete:
false, allowReview: false }`. Omitted options preserve existing
behavior.

Failed submissions display an error and preserve the draft. Switching
traces resets composer state. The client continues generating stable
IDs/timestamps, and the hook returns the server response, including its
identity and timestamp, for later replacement writes. Includes separate
React/UI changesets. Inline feedback options use primitive dependencies
in the existing explorer config memo, and standalone composers re-export
`FeedbackOptions`.

Validated with 147 shared UI tests, 6 React hook tests, package builds,
typecheck, and scoped lint/format checks. Regression tests were also
checked against the original behavior. Platform will consume a new alpha
or snapshot after this merges; this PR does not publish one.

## Related issue(s)

Part of [OBS-827](https://linear.app/kepler-crm/issue/OBS-827), under
[OBS-792](https://linear.app/kepler-crm/issue/OBS-792). Platform
integration remains a separate draft PR.

## Type of change

- [x] New feature (non-breaking change that adds functionality)
- [x] Bug fix (non-breaking change that fixes an issue)
- [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; usage examples are in the changesets)
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have addressed all Coderabbit comments on this PR

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

## ELI5

This PR lets the host application control who feedback is attributed to,
how its context is resolved, and whether users can delete or review
feedback. It also shows an error when saving fails, so users know their
feedback was not saved.

## Changes

- Added optional `feedbackOptions` to trace, span, thread, and explorer
feedback components. When omitted, existing action behavior remains
enabled.
- Added `contextMode` and `feedbackUserId` options to
`useCreateFeedback`.
- Added submission-error messages to trace and span feedback composers.
- Added tests for request options, disabled actions, failed submissions,
and composer state when switching traces.
- Added changesets for `@mastra/react` and `@mastra/playground-ui`.

Test and build results: not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-05 13:32:33 +01:00
Lennart
ee5a1b0282
docs: make packages frontmatter more precise (#29499)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-04 17:49:54 -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
Eric Pinzur
8ad7773cd4
feat(observability): align signal writes and context modes (#29289) 2026-11-04 12:00:19 -08:00
Damien Schneider
b28ed08077
feat(playground-ui): chat annotations for Studio and Factory (#29310)
**─────── TLDR ───────**
> In Studio and Factory chat you can select part of a reply, comment on
it, and the agent gets it quoted in your next message.

Until now, asking about one sentence of a long reply meant copying it
into the message box and quoting it by hand. A selection inside one
message now offers **Add to chat**. Each passage gets a numbered bubble
in the transcript, the message box counts them, and Send turns them into
a numbered list ahead of what you typed.

### Behavior changed

text selected inside one message, in Studio or Factory
&nbsp;&nbsp;└─ **new** — **Add to chat** floats over it, and Tab reaches
it

an added passage
&nbsp;&nbsp;└─ **new** — a numbered bubble that scrolls with it; select
it to comment or remove

Send with annotations waiting
&nbsp;&nbsp;└─ **new** — each passage quoted with its comment, then your
text, if any

a send that fails
&nbsp;&nbsp;└─ **new** — its annotations come back, ahead of any added
since

a slash command in Factory
&nbsp;&nbsp;└─ **unchanged** — runs as before; annotations wait for the
next message

text typed after dictating, in Studio
&nbsp;&nbsp;└─ **fixed** — stays; each keystroke used to bring the
dictated text back

dictating right after `useSpeechRecognition` gets a new `agentId`
&nbsp;&nbsp;└─ **fixed** — uses the browser until the new agent's voice
is checked, instead of the previous agent

### Shape changed

| | | |
|---|---|---|
| **+** | `ChatShell.Transcript` | the positioned reading column the
bubbles travel with |
| **~** | `ChatShell.Dock` | its `ComposerInput` is the one an added
passage focuses |
| **~** | `escapeRegExp` | annotations needed a third copy, now one in
`lib/string` |
| **~** | `useSpeechRecognition().start` | takes an optional
`onTranscript`, called as each transcript is recognized |

what Studio and Factory now mount, from
`@mastra/playground-ui/components/ai/annotations`
&nbsp;&nbsp;&nbsp;&nbsp;`ChatAnnotationsProvider` ·
`TranscriptAnnotations` · `ComposerAnnotations` · `useChatAnnotations()`
· `formatAnnotatedMessage(text, annotations)`

### Decisions

- **the transcript finds its composer through `ChatShell`** — neither
app passes refs; a ref prop is the way back if you disagree
- **the tint uses the CSS Custom Highlight API** — message text gets no
wrapper elements; browsers without it show only the bubbles
- **switching threads drops waiting annotations** — each one points at
rendered text the switch unmounts
- **effects only where React can't reach** — Add to chat's keys and
dictated text moved to the handlers that own them, the pending dot's
delay to the CSS entrance the trace skeletons use, and the voice check's
reset to a value derived in render; the effects left subscribe to the
browser, measure layout, or wait on data

### Not verified

- [ ] right-click on a selection in macOS: the menu reset is covered in
jsdom only, since Playwright cannot open the native menu
- [ ] Safari and Firefox: the live runs used Chromium only, and
Firefox's multi-range selection is covered in jsdom only
- [ ] Factory against a live agent session: its live run used the real
app with a mocked agent backend
- [ ] Studio dictation in a browser: checked in jsdom only, with a
stubbed `SpeechRecognition`
- [ ] the pending dot's delay in Studio: the same classes as the trace
skeletons, checked in the built stylesheet only

---

> ██████████████████████ **tests** `+1545 −11` — 49% of the additions
> ███████████████████ **source** `+1333 −147`
> ██ **storybook** `+156`
> ██ **changeset** `+108`
> █ **docs** `+2`

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-04 18:13:28 +01:00
Eric Pinzur
a7c4069df2
fix(observability): require trace IDs on feedback and score POSTs (#29287)
Requires a nonblank `feedback.traceId` and `score.traceId` on the OSS
observability POST endpoints, with `spanId` still optional. Missing,
null, empty, whitespace-only, and span-only requests return 400 before
storage is called. The generated JavaScript client types now require the
trace ID too.

Previously accepted:
```ts
await client.createFeedback({ feedback: { feedbackType: 'thumbs', value: 1 } });
```

Now:
```ts
await client.createFeedback({
  feedback: { traceId: 'trace-123', feedbackType: 'thumbs', value: 1 },
});
await client.createScore({
  score: { traceId: 'trace-123', scorerId: 'accuracy', score: 0.9 },
});
```

This tightens the HTTP/type contract and uses minor changesets for core,
server, and client. Callers that previously omitted the trace ID must
now supply it. It does not add a trace-existence lookup or change
storage/batch APIs, historical nullable records, generated IDs, server
timestamps, or response shapes. The existing React feedback caller
already supplies a trace ID. Documentation describes the required trace
ID and optional span ID. Client types and CLI metadata were regenerated,
with no CLI metadata diff.

Validation: 398 tests pass, including shared real-HTTP regressions
across Hono, Express, Fastify, Koa, and NestJS, plus schema and existing
server/client tests. The new rejection cases failed before the fix with
200 responses. Focused client route-type checks, package builds,
type-aware lint, formatting, and documentation checks pass. The broader
client type suite still reports four errors in
`type-tests/trace-query.test-d.ts`; these were reproduced with the
unchanged main files.

Fixes
[OBS-788](https://linear.app/kepler-crm/issue/OBS-788/require-trace-ids-on-oss-score-and-feedback-posts).
Part of [OBS-792](https://linear.app/kepler-crm/issue/OBS-792); aligns
the required trace-ID contract with
[platform#3752](https://github.com/mastra-ai/platform/pull/3752).

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

## ELI5

Feedback and score requests must now identify the trace they belong to.
This prevents new requests without a usable trace ID from being saved,
while older records remain readable.

## Summary

- Require a nonblank `traceId` in feedback and score HTTP POST bodies.
Keep `spanId` optional.
- Reject requests with missing, null, empty, or whitespace-only
`traceId` values before calling storage.
- Keep nullable `traceId` values valid in storage and record schemas so
historical records remain readable.
- Update client request types, documentation, and the CLI score-create
example to include the required `traceId`.
- Add shared HTTP contract tests for the Hono, Express, Fastify, Koa,
and NestJS adapters.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-04 15:25:20 +01:00
Ehindero Israel
314e6bca25
fix(client-js): use consistent tool-result format in stream continuations (#29384)
## Summary

Fixes client tool continuations created by `agent.stream()` to send a
consistent tool-result message format.

The continuation previously mixed fields from two AI SDK message
formats:

```ts
{
  input: toolCall.args,
  result,
}
```

Core detected the message as AI SDK v4 because it contained `result`.
The v4 adapter expects arguments in `args`, not `input`, so the original
tool arguments could be stored as `{}`.

The continuation now uses the consistent current shape:

```ts
{
  input: toolCall.args,
  output: {
    type: 'json',
    value: result,
  },
}
```

`agent.stream()` continues accepting all message formats supported by
Core; this change only corrects the format generated internally by
Client JS.

## Test plan

- Added coverage for the recursive public `agent.stream()` request.
- Verified the tool result contains the original `input`.
- Verified the result is sent through `output`, with no legacy `result`
field.
- Updated multi-tool, thread continuation, `toModelOutput`, and
provider-options coverage.
- Ran the complete Client JS client-tool test suite: 48/48 passed.
- Ran Client JS lint and CJS/ESM builds.

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

## ELI5

When a tool finishes during a streamed conversation, Client JS now sends
its answer in the format Core expects. This keeps the tool’s original
input intact so the conversation can continue correctly.

## Changes

- Client JS continuation messages now use `output: { type: 'json',
value: result }` instead of the legacy `result` field.
- Tests cover the updated result format, original tool input,
observability metadata, transformed output, and multiple tool calls.
- A changeset marks `@mastra/client-js` for a patch release.
- Combobox story placeholders no longer end with ellipses.
- Playground trace tests now use explicit labels to find delegated
workflow and agent tool calls.

## Validation

Test and build results are not established by the available evidence.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: mastra-platform[bot] <mastra-platform[bot]@users.noreply.github.com>
2026-11-04 11:44:11 +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
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
Tyler Barnes
01524b22db
feat(core,stores,server): Knowledge page link index and alpha review follow-ups (#29260)
## Summary

Follow-ups to the Knowledge alpha (#29159, #29207, #29218, #29256), in
one PR:

**Page link index**
- Knowledge keeps an index of `[[links]]` in page bodies.
`countPageLinks` / `listPageLinks` on the Knowledge store return in and
out links for a set of pages, gated by the reader's scopes like every
other read; note `[[mentions]]` show up as `note` links.
- Links resolve when a page is written through the tools, `upsertPage`
or `removePage` (id, `scope#key/key` path, scope address, then page name
in the page's own scope, then store-wide). Dangling links resolve once
their target is created and follow renames, moves, merges and deletes.
`knowledge.reindexLinks()` backfills pages written before this release.
- Implemented in the in-memory, LibSQL, PostgreSQL, MySQL and MongoDB
stores (additive table/collection, no schema bump). Refs over 512
characters stay plain text; the per-request link cap comes from core
through the store loader.
- Server routes `GET /knowledge/:knowledgeKey/link-counts` and `GET
/knowledge/:knowledgeKey/pages/:pageId/links`, client-js methods, and
FGA coverage (`knowledge:read` on the knowledge key, denied caller gets
403).

**Review follow-ups**
- Fenced code and headings parse like CommonMark (closing fence must
match the opener; `## Use C#` keeps its `#`); reading the last part of a
page that ends in a newline works.
- Chunk embedding runs 4 at a time and semantic search stops at its
candidate cap.
- PostgreSQL and MongoDB refuse to remove a note that's already removed,
like the other stores.
- Search queries use at most 16 words.
- Changeset for the `reindex()` removal scoped correctly.

## Child scopes filtered by reader in the store
- `listChildScopes` takes an optional `read` scope and leaves out child
scopes the reader can't see before applying the limit and cursor. New
`countChildScopes` counts readable child scopes for many parents in one
call. All five stores implement both.
- `knowledge_list` uses them: it used to page through every child scope
under a scope and drop the unreadable ones afterwards, and list each
scope's child scopes just to count them. Under a scope with many private
child scopes that meant loading all of them.
- This changes cost only, not access: `knowledge_list` already removed
unreadable scopes before returning anything, so agents see the same
entries and counts. Without `read`, the host's full list (Studio, link
resolution, `knowledge_read`'s restricted entries) is unchanged.

## Test plan
- Core Knowledge + storage: 274 tests pass; tsc 0; oxlint 0/0; oxfmt
clean.
- Real stores (Docker): LibSQL 77, PostgreSQL 87, MySQL 78, MongoDB 81
pass.
- Server Knowledge handlers + adapter FGA: 143 pass. client-js
Knowledge: 6 pass.
- New tests fail without their fixes (link hooks, host-write links, ref
length, fences/headings, candidate cap, embed concurrency, double note
removal, FGA route mapping, child scopes filtered before the limit,
knowledge_list never receiving unreadable scopes).



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

## ELI5

Knowledge pages can now keep track of links to other pages, including
when those pages are added, renamed, moved, or removed. Readers can see
only links they are allowed to access, and page listings avoid loading
child scopes they cannot read.

## What changed

- Added a page-link index for `[[links]]` across in-memory, LibSQL,
PostgreSQL, MySQL, and MongoDB stores. `knowledge.reindexLinks()` can
backfill the index for existing pages.
- Added scope-filtered link counts and link-list APIs, server routes,
and client-js methods.
- Added child-scope filtering before pagination and child-scope counts
for readable scopes.
- Improved Markdown fence and heading parsing, page-range handling for
trailing newlines, embedding concurrency, and semantic-search candidate
limits.
- Made repeated removal of an already-removed note return
`KnowledgeNotFoundError` in PostgreSQL and MongoDB. Updated the
`reindex()` changeset.

## Validation

Author-reported test and tooling results are available in the PR
objectives; they were not independently verified here. Review finding
counts are unavailable.
<!-- 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-03 01:35:34 -07:00