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

820 commits

Author SHA1 Message Date
Lennart
fdd242c2a4
chore(ci): remove 2027dev evals workflow (#30107)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-11 14:08:09 -07:00
Tyler Barnes
5e6417057e
ci: report CodeQL scans that time out instead of staying silent (#30017)
Co-authored-by: remy-builder[bot] <324360501+remy-builder[bot]@users.noreply.github.com>
2026-11-10 22:46:46 -08:00
YujohnNattrass
5c0f12c5a2
ci(mcp): fix MCP compatibility job on version-packages PRs (#29988)
Co-authored-by: YJ <yj@example.com>
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-10 19:55:49 -08:00
Tyler Barnes
c10344bbae
ci: scan main with CodeQL twice a day and alert Slack, instead of scanning every PR (#29098)
Co-authored-by: remy-builder[bot] <324360501+remy-builder[bot]@users.noreply.github.com>
2026-11-10 14:35:51 -08:00
Ward Peeters
1892f79532
chore: remove stale scripts, workspace entries and package metadata (#29891)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-10 14:09:52 +01:00
mastra-platform[bot]
51a20e848e
feat(docs): one pnpm check command for all docs checks, with JSON output and stable rule IDs (#29801)
Co-authored-by: LekoArts <lekoarts@gmail.com>
2026-11-09 16:59:20 -07:00
Ward Peeters
27340425d7
ci: select tests for dependency bumps and directory-scanning tests on… (#29725)
… PRs

PR test selection only follows source imports, so three PRs merged green
and broke the alpha cron's full suite: an OpenTelemetry lockfile bump
(#28581, otel-bridge), lockfile maintenance moving @ai-sdk/anthropic
(#29341, schema-compat e2e), and a new hook without a story (#29373,
storybook-coverage.test.ts reads the hooks folder rather than importing
it).

Prebuild now compares each workspace package's resolved dependency tree
between the base and head lockfiles and runs the tests of packages whose
tree or package.json changed. A root toolchain change, or a selection
over a quarter of the suite, runs the sharded full suite instead. Tests
that scan their package's directory run when a file there is added,
removed or renamed.

The selection logic also moves out of inline workflow script into
.github/scripts/select-affected-tests.cjs with unit tests, and keeps the
three-way split of large affected unit runs from #29143.

## Description

<!-- Required: Provide a brief description of the changes in this PR.
-->

## Related issue(s)

<!-- Required: Link to the issue(s) this PR addresses, e.g. with: Fixes
#123. PRs without linked issues will be closed. High-quality issues with
reproductions are preferred to vague pull requests. -->

## Type of change

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

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


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

## ELI5

The test selector checks whether package dependencies changed and
whether tests search their package folders for files. It uses the PR’s
own lockfile changes to select relevant tests, so unrelated changes on
the base branch do not trigger extra test runs.

## What changed

- Added dependency-based test routing. It compares resolved dependency
trees in the merge-base and PR-head lockfiles, follows workspace links,
and selects tests for affected packages.
- Selects a package’s tests when its `package.json` changes.
- Selects directory-scanning tests when files in their package are
added, removed, or renamed.
- Requests the full suite when root dependencies change or
dependency-based selection exceeds 25% of the test files.
- Moved Prebuild test selection into
`.github/scripts/select-affected-tests.cjs`. The script combines
import-graph and dependency-based selections and routes tests to the
applicable suites.
- Added tests for dependency routing and suite selection. Added `yaml`
as a root development dependency.
<!-- 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:45:01 +01:00
Ward Peeters
81940b555e
ci: upload studio and factory assets only to production R2 (#29729)
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-09 15:49:07 +01:00
Tyler Barnes
181cff7be8
ci: split large affected unit runs across three jobs (#29143)
Co-authored-by: remy-builder[bot] <324360501+remy-builder[bot]@users.noreply.github.com>
2026-11-09 10:58:05 +01:00
Roamin
a2a03b53fe
chore: update slack channel ID in action.yaml (#29717)
## Description

send Slack alerts to #eng-maintainer-alerts by default
2026-11-08 23:20:43 -05:00
Tyler Barnes
3a01ed16f4
ci: cache what affected-test detection parses, so PR test selection takes ~4s instead of ~40s (#29133)
## What

"Detect affected tests" decides which test files a PR runs. Today it
parses ~15,000 files on every PR run: madge builds the import graph,
then a second pass extracts exported names and symbol edges. That takes
~40s on the 5 vCPU runner, and almost none of those files changed since
the last run.

This change caches the parse results in a file, keyed by a hash of each
file's content:

- `scripts/affected-tests-cache.mjs` stores, per file, only what its own
text decides: the import specifiers precinct finds and the exports and
symbol edges the second pass extracts. Records are keyed by
`sha1(extension + content)`.
- Resolving those specifiers to files is **not** cached. It still runs
live through filing-cabinet with madge's exact options, so a rename, a
moved file or an alias change can't be hidden by a cache hit.
- The cache file records its schema version and the precinct and
typescript versions. If any of them differ, the run starts cold. It is
never wrong.
- `.github/workflows/prebuild.yml` restores the cache before detection
(restore only; PRs never save). The key is
`affected-graph-v1-<os>-<sha>` with the prefix restore-key
`affected-graph-v1-<os>-`, so a PR gets the newest main seed.
- The new `.github/workflows/affected-graph-seed.yml` refreshes the seed
on every push to main. It runs detection once on core's entry point,
which touches the whole graph, then saves the cache. A newer push
cancels an older seed run.

The detection output (selected files, graph nodes, test files) is
unchanged.

## Numbers

Measured on a 5 vCPU / 16 GB container like the CI runner, Node 24.22.1:

| | time |
|---|---|
| Uncached (today) | 40.3s |
| Cached, current seed | 4.0s |
| Cached, seed ~300 commits old | ~13s |
| Seed run on main | ~40s |

The seed file is 14.8 MB raw and 1.7 MB in the actions cache.

Compute: about 36s saved per PR run, against about 90s per merge to main
for the seed run.

## Testing

- Ran detection uncached and cached on 20 recent merged PRs (between 1
and 3,532 files selected): output identical on all 20.
- Renamed `retry-after.ts`, updated its importers and added a new test
file importing the renamed module: identical output (2,849 selected),
the new test is selected and the old path is gone from the graph.
- `packages/core/src/affected-tests-cache.test.ts` covers cold, warm and
changed-import runs. It fails if records are keyed by file name instead
of content.
- `packages/core/src/affected-tests-resolution.test.ts` and
`.github/scripts/ci-routing.test.ts` pass. oxlint and prettier are
clean.

Stacked on #29091 (cancelled runs stop downstream jobs). It will be
retargeted to main once that merges.


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

## ELI5
The affected-test detector checks which tests may need to run after code
changes. This PR saves file-parsing results so later checks can reuse
them, while still resolving file links against the current code.

## What changed
- Added a content-addressed cache for file parsing. It stores import
specifiers, exported names, and symbol edges, and checks a schema and
extractor-version string before reusing records.
- Kept file resolution live through filing-cabinet and Madge’s existing
options. Updated affected-test detection to use the cache and save
records used during the run.
- Added a workflow to refresh the cache seed on pushes to `main`.
Updated prebuild to restore the seed for affected-test detection.
- Added a test for uncached, cold-cache, and warm-cache graphs,
including after a file’s imports change.

## Validation
Test, lint, formatting, output-comparison, runtime, and review-finding
results: not available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: remy-builder[bot] <324360501+remy-builder[bot]@users.noreply.github.com>
2026-11-05 20:02:44 +00:00
Tyler Barnes
43f77e77a0
ci: delete the Changed Test Gate (#29099)
## What this does

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

## What the gate enforced, and what goes

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

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

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

## Why dropping 1 and 2 is acceptable

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

## Test plan

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


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

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

## ELI5

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

## Changes

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

## Validation

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

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

---------

Co-authored-by: remy-builder[bot] <324360501+remy-builder[bot]@users.noreply.github.com>
2026-11-05 19:42:33 +00:00
Tyler Barnes
d73e4ed054
ci: let cancel-in-progress stop superseded PR test runs (#29091)
## Summary

When a new commit is pushed to a PR, `concurrency: cancel-in-progress`
cancels the running Prebuild run, and GitHub holds the new run until the
old one has fully finished. The downstream test jobs and Merge Test
Reports were gated with `if: always() && …`. `always()` is true even
when the workflow is cancelled, so the cancelled run kept running its
test jobs, and the new push waited for results nobody would read.

This changes:

- `prebuild.yml`: the six downstream callers (Unit and E2E Tests, E2E,
Mastra Code E2E, Combined Store Tests, Workspace Tests, Memory) go from
`always()` to `!cancelled()`. None of them is itself a required check.
- `test-suite.yml`, Merge Test Reports: the job **keeps** `if:
always()`; its four heavy steps (checkout, setup pnpm/Node, download
test results, merge reports) get `!cancelled() &&` in front of their
existing condition.

Why Merge Test Reports keeps `always()`: the ruleset requires two
checks, `Lint` and `Unit and E2E Tests / Merge Test Reports`. GitHub
reports a skipped required job as passed, so skipping that job on cancel
would leave the required check green with no tests run. With the job
still running, its "Require every test job to finish" step (#28964)
fails it when a test job was cancelled, as before. A cancelled run now
spends seconds in that job instead of minutes.

Step-level `always()` (artifact uploads, the "Require every test job to
finish" step) and the Slack notifier are unchanged.

## Example

Branch `feat/knowledge-alpha-standalone`, Oct 31: a push at ~03:55
cancelled run 41165713431 at 03:55:05. Its `always()` jobs kept going,
and its Merge Test Reports job *started* at 04:12:40. The new run
41166383453 started no jobs until 04:14:12, a 19.1 min wait, while the
old run spent 28 min of compute on 6 jobs.

Across 53 recent PR runs, 9 waited like this, 3–19 min each (77 min in
total), with 81 min of compute spent after the cancel.

## Why failures still report

A failed test job, or one that hits its timeout, doesn't cancel the
workflow, so `cancelled()` stays false. Merge Test Reports, its "Require
every test job to finish" step and the Slack notifier still run in those
cases. GitHub's docs: `always()` "returns true even when canceled", and
they recommend `!cancelled()` for "run unless cancelled". Past example:
runs 40586465971 and 40585251182, where Affected UNIT hit its 20 min
timeout (job conclusion `cancelled`, run conclusion `failure`), and
Merge Test Reports still ran.

## Test plan

- [x] YAML parses, prettier clean (the `if:` needs `${{ }}` because a
bare `!` is a YAML tag)
- [x] No other called workflow has a job-level `always()`
- [ ] CI on this PR runs as before
- [ ] Optional: push twice quickly and check the first run stops at the
cancel, while its Merge Test Reports still ends red


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

## ELI5

When a newer pull request run replaces an older one, the older run now
stops starting downstream work after cancellation. This can free up time
and resources for the newer run while preserving the required test
check.

## Changes

- In `.github/workflows/prebuild.yml`, six downstream jobs use
`!cancelled()` instead of `always()`. Their other conditions remain in
place.
- In `.github/workflows/test-suite.yml`, `merge-reports` keeps job-level
`always()`. Its checkout, setup, result-download, and report-merge steps
now check for cancellation before running.
- The “Require every test job to finish” step, test-result uploads, and
Slack notifier remain unchanged.

Test results and overall CI completion status are not established by the
supplied evidence.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: remy-builder[bot] <324360501+remy-builder[bot]@users.noreply.github.com>
2026-11-05 19:39:34 +00:00
Arthur Fiorette
78d801b154
fix(ci): grant id-token: write to the alpha cron test job (#29570) 2026-11-05 11:37:32 -08:00
Tyler Barnes
8b11e542bb
ci: run container-free store and workspace unit tests in one job each (#29090)
Co-authored-by: remy-builder[bot] <324360501+remy-builder[bot]@users.noreply.github.com>
2026-11-05 11:28:26 -08:00
mastra-platform[bot]
f94beac862
fix(core): unwedge restarted nested evented loops (#29431)
> Opened by @user_01KNA8J74D4RF84RXSDRX26BS9

## Problem

Setup: a split deploy (API with `MASTRA_WORKERS=false` plus dedicated
workers over Redis) with `recovery.durableAgents: 'auto'`. When the API
and the worker die together mid-tool and both restart, boot recovery
claims the run under a new generation and the interrupted tool runs
again. After that, the run stops making progress. It sits in
`durable-agentic-loop:running` forever while the API keeps renewing its
lease. Because the run never ends, it also keeps its thread lease, so
any later run on the same thread is rejected with
`AgentThreadLeaseConflictError`. Mastra Doctor hits this every time,
since its thread is the deployId and every re-diagnosis lands on the
stuck thread. The `DurableExecutionFenceError` and `This workflow run
was not active` messages in the ticket are side effects of this stuck
run.

## Root cause

Recovery behaves correctly: it claims a new generation and re-drives the
run. The run gets stuck in the evented step guard in
`WorkflowEventProcessor.endWorkflow`.

When a restarted nested loop body finishes, `endWorkflow` calls
`#processLoop` for the parent loop. The `!parentWorkflow.restart`
condition there, introduced by 11c83d5333 (#28054), skipped the outer
loop leaf's stored `startedBy` on restart. #28054 lists
restart/redelivery races as out of scope, so this exclusion was not a
deliberate restart contract. As a result:

1. The completion guard never ran, so the outer loop leaf stayed
`running` under the event id from before the crash.
2. The loop's next `workflow.step.run` carried a new event id, so
`assertWorkflowStepGuard` raised a `stale` conflict.
3. `process()` acknowledges `stale` conflicts without retrying or
reporting an error, so the step was dropped and the loop never advanced.

## Fix

Remove `restart` from that exclusion. A restarted child re-drives the
stored occurrence, so it now completes under that occurrence's
`startedBy`, the same way a normal redelivery does. Time-travel and
resume still skip the guard as before. The code change is 3 lines in
`packages/core/src/workflows/evented/workflow-event-processor/index.ts`,
plus a patch changeset for `@mastra/core`.

## Tests

**Core unit test:**
`packages/core/src/workflows/evented/restart-nested-loop-guard.test.ts`
- Runs on an in-memory store that reports `supportsWorkflowStepGuards()
=== true` and enforces `assertWorkflowStepGuard` the way `@mastra/pg`
does.
- A `dountil` over a nested workflow crashes mid-iteration on host A,
then host B restarts it over the same storage.
- The test asserts that the loop finishes and the leaf is not left
`running`.
- With the `index.ts` line reverted it fails: the leaf stays `running`
under the pre-crash `startedBy` and the run hangs. With the fix it
passes.

**End-to-end test:**
`pubsub/redis-streams/src/durable-full-restart.test.ts` (fixture
`test-fixtures/durable-full-restart.entry.mjs`)
- **Setup:** real Redis and Postgres, separate API and worker processes,
`recovery.durableAgents: 'auto'`, and the same restart hook the deployer
runs at boot.
- **Scenario:** kill both processes mid-tool, then restart both.
- **Each case asserts that:**
  - the run reaches `workflow.end`
  - every tool call completes
  - the run owner lease and the thread lease are both released
- a follow-up run on the same thread is admitted with no
`AgentThreadLeaseConflictError`

| Case | main | this PR |
| --- | --- | --- |
| core: restart of nested loop body (guarded store) | ❌ hangs, leaf
`running` | ✅ |
| SIGKILL both mid-tool, x1 | ❌ run never settles (owner `live:true`,
snapshot `running`) | ✅ |
| SIGTERM both mid-tool, x1 | ✅ (graceful drain doesn't take the restart
path) | ✅ |
| SIGKILL both mid-tool, x2 (killed again after recovery, so the
snapshot must survive a second restart) | not run (x1 already fails) | ✅
|

Re-run on current `main` with the fix:
- core `vitest run src/workflows/evented`: 44 files, 682 passed / 5
skipped
- `durable-full-restart.test.ts`: 3/3 pass
- `tsc --noEmit` on core: clean
- redis-streams `tsc --noEmit` and `tsc --project tsconfig.test.json`
(the fixture typecheck that CI's Worker takeover job runs): clean
- `oxlint` on touched files: clean

### Combined with COR-1502

COR-1502 is a parallel fix on
`user/session-6ca2c63a-0a42-4fed-8de8-25f33217e319` (554226de) for Redis
`LOADING` errors during lease extension. I merged it locally with this
branch:
- the merge had no conflicts
- `durable-full-restart.test.ts`: all 3 cases pass on the merged code
- `evented-redis-loading.test.ts`: passes


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

## ELI5

If the API and worker restart during a run, a nested loop could get
stuck and keep its thread busy. This change preserves the loop’s stored
event information during restart so the run can finish and another run
can use the same thread.

## Changes

- Pass the nested loop leaf’s stored `startedBy` value when the parent
workflow restarts. Time-travel and resumed workflows still skip this
guard.
- Add a core regression test for restarting an evented workflow with
step guards enabled.
- Add a Redis Streams and Postgres integration test for API and worker
restarts. It covers `SIGKILL`, `SIGTERM`, and a second crash after
recovery. It checks run and tool completion, lease release, and a
follow-up run on the same thread.
- Add the integration fixture, include the test in the durable-streams
CI job, and add a patch changeset for `@mastra/core`.

## Tests

The diff adds regression and integration tests. Test-run and type-check
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: review <review@local>
Co-authored-by: NikAiyer <nick.aiyer@gmail.com>
2026-11-04 18:59:50 -08:00
mastra-platform[bot]
a0068a9ad1
feat(core): resumable streams for every Agent (#28424)
> Opened by @user_01KNPFT2RPETZTEP15J3AEBA08

Originally stacked on
[#28416](https://github.com/mastra-ai/mastra/pull/28416), which has
merged. This PR now targets `main`.

## What

Any `Agent` can now have resumable streams, not only durable agents. A
run is published on `agent.stream.<runId>` with a replay cache, so:

- a client can reconnect after a disconnect,
- another reader can follow the run with `agent.observe(runId)`,
- any reader can stop it (`observe().abort()`,
`agent.abortRunStream(runId)`, or the abort-run route).

Durable execution (surviving process restarts) stays with `DurableAgent`
/ `EventedAgent` / `InngestAgent`, which keep publishing through the
same stream layer.

### Config

New `streams?: boolean | { pubsub, cache, shouldCache, cleanupTimeoutMs
}` on `Agent`.

- Omitted: on when the agent is registered on `Mastra`, off for
standalone agents.
- `false`: off. `{ cache: false }`: live only, no replay.
- With `durable`, `streams` keys override `durable` keys. `durable:
true` + `streams: false` keeps publishing, drops the replay cache, and
warns.

### Bus selection
- Registered agents (plain and `DurableAgent` on any engine) publish on
`mastra.pubsub`, so other processes sharing the PubSub and run-record
cache can observe and abort.
- Precedence: `streams.pubsub` > `durable.pubsub` > `mastra.pubsub`. The
evented engine still forces `mastra.pubsub` over an agent-level pubsub
and warns when they differ.
- Unregistered agents keep a private in-process `EventEmitterPubSub`.
- The replay cache wraps the shared bus once (existing `CachingPubSub`
reuse check), so nothing is double-published.

### Behaviour change

With streams on, closing the HTTP stream detaches the reader instead of
aborting the run. To stop a run explicitly, use `POST
/agents/:agentId/runs/:runId/abort`, which now works for plain agents
too (ownership-checked, including across servers sharing the PubSub and
run-record cache), or the thread abort route. `streams: false` keeps the
old behaviour.

## Commits

1. `8c8975ef` loop publishes chunks through a `streamPublisher`
(step-start, finish, CHUNK, SUSPENDED on close, ERROR if the stream ends
without a finish).
2. `f6d7dabf` `Agent.observe` reads the agent's bus;
`hasResumableStreams()` added. DurableAgent opts its inner agent out so
nothing is published twice.
3. `8b33a9d7` abort requests go over the control topic, so any reader on
the bus can stop a run.
4. `92a5a320` server: stream routes gate on `hasResumableStreams`,
observe reads a plain agent's bus, abort-run supports plain runs;
cleanup timers centralised on `AgentStreamBus.scheduleCleanup`.
5. `ff5456df` "Resumable streams" docs page, `Agent` reference entry,
changeset (core minor, server patch).
6. `24936904` registered `DurableAgent` on the default engine publishes
on `mastra.pubsub`. Before, if the bus was read before registration, it
stayed on the private bus and other instances never saw its runs.

## Rebase onto #28416 / main
- `loop/workflows/stream.ts` conflicted with #28157, which added a
`finalization` parameter to `workflowLoopStream`. Kept main's signature
and added `streamPublisher` alongside; snapshot finalization and
publishing both run.
- No textual conflict, but #28531 (follow-up to #28514) made stream
output a proxy, so `fullStream` overrides must call the base getter with
`this`. `Agent.observe` had the old pattern and failed with "Cannot read
private member #options"; main's fix is applied there (folded into
`f6d7dabf`). Reverting it fails both observe tests in
`agent-streams.test.ts`.

## Proof

Head `d2bd22d4`:
- Core `tsc -p tsconfig.build.json`, oxlint, oxfmt clean. `vitest run
src/agent/durable src/agent/streams
src/agent/__tests__/thread-stream-restart.test.ts` plus the
observe-approval-resume, observe-lifecycle and observe-reattach aimock
scenarios: 197 files, 1985 passed, 28 skipped, exit 0.
- Server `tsc` clean; `vitest run src/server/handlers`: 67 files, 2476
passed, 2 skipped, 1 todo.
- Inngest `tsc` clean; `test:unit` 103 passed, 2 failed. The same 2
tests ("stream/generate terminates when the opening event and error
event cannot be published") fail identically on `main` (`df76f896`,
rebuilt core).
- Docs: `remark --frail` and `oxfmt-mdx --check` clean.
- Observation spans suspension: new shared aimock scenario
`observe-approval-resume` on normal, durable, evented and fs engines. An
observer attached before and one attached during the approval wait both
receive the approved answer and `finish`; a fresh replay after
completion holds both segments; reconnecting after the suspension index
repeats nothing; the tool runs once; `onSuspended` fires once; a
cancelled reader leaves the run going.
- Request context: an unscoped Studio caller (auth mapper, Studio FGA,
no server FGA) can observe and abort; other tenants and unscoped
non-Studio callers still get 403; observe resolves the agent with the
request context.
- Shared ownership: each plain run writes a record
(`agent.run.<agentId>.<runId>`: agent, run, resource, thread,
running/suspended/finished) to the replay cache, or `mastra.serverCache`
when replay caching is off, before its first event. Suspended and
finished are written after the terminal event, the record is deleted
with the topic, and it has the run log's 24h TTL. Routes return 404 for
a missing, expired or evicted record and 503 when the cache can't be
read. Abort returns `aborted: true` only when the executing process
acknowledges the stop.
- Two real HTTP servers
(`pubsub/redis-streams/src/plain-run-cross-server.test.ts`: LibSQL file,
Redis Streams PubSub, RedisServerCache, SimpleAuth, aimock): owner
observes on B through suspend, approve on A, and finish; 403/401/404 on
both servers; abort through B confirmed by A; a parked run's abort is
`false`; expired and cleaned-up runs 404; ownership with `cache: false`.
Run with the durable/evented controls (`run-abort-cross-server`,
`observe-cross-process`): 20/20 in 3 consecutive runs. On the
pre-ownership commit the plain suite fails 8/8 (remote observe/abort
404).
- Mutation checks (each restored afterwards): re-adding `closeOnSuspend`
to plain observe fails the normal and fs scenarios; re-adding the HTTP
close on `suspended` fails the server test; dropping the request context
fails the Studio observe/abort and agent lookup tests; removing the
initial, suspended or delete record writes fails the record lifecycle
tests; removing the finished guard, the 503 handling or the
acknowledgement in the abort route fails their tests; acking an abort
that reached an ended run fails the new publisher test.
- No double publishing: the parity, durable-shared-bus and agent-streams
tests still pass (DurableAgent's inner agent keeps `streams: false`; the
replay cache wraps the shared bus once).

## Separate main-merge verification

Conflict resolution is isolated in
[50a9ef89](50a9ef8947),
after candidate `d2bd22d4`; no feature commits were rewritten.

- Merged-result focused core regression suites: 6 files, 37 tests
passed, covering parity, shared buses/run records, remote abort and
approval/resume observation.
- Complete merged-result server-handler suite: 68 files, 2,478 passed, 2
skipped, 1 todo. A separate real-TCP Hono/real-Memory authorization
matrix also passed 13/13, including the formerly failing Studio-only FGA
observe and abort contracts (without expected-failure markers).
- Type-aware oxlint and formatting passed on all 5 conflict-resolved
files.
- Full core/server typechecks are **not clean in the verification
checkout**. Swapping each package to unchanged `main` source in the same
installed dependency environment reproduces the same diagnostics (core
byte-identical; server identical after normalizing source-line
positions). These include AI SDK schema compatibility errors and missing
agent-builder artifacts; no additional diagnostics were introduced by
the conflict resolution.
- A broader core run passed 2,020 tests but exited nonzero: 5 suites
initially lacked the built internal LLM recorder; after building it, all
5 suites passed (24 tests). The crash-recovery worker still exhausted
its JavaScript heap after 8 of 10 tests. The broad run also reported the
baseline type errors above. This is **not** a clean full-core result.
- Follow-up `ec0bc59b` clears control and acknowledgement topics with
the finished run log; `35debe7a` and `920a094a` correct documentation.
Independent verification below includes the cleanup production change.

## Independent adversarial review

Verdict: **approve within the requested scope**, with no actionable
supported-flow defect found. No formal GitHub approval was posted. The
reviewed production head is `ec0bc59b32`;
the only subsequent change in `920a094a` is a checked docs sentence
distinguishing expired ownership from missing replay history.

Independent reviewer ran **343 passing tests**: 38 focused core, 280
server handlers, 8 real two-process TCP/Redis/LibSQL/AIMock cases, 16
public-API processor-safety probes, and 1 actual Redis cleanup probe.

- Redaction/tripwire bypass hypothesis did not reproduce on normal,
durable, evented or filesystem engines, with either immediate or
deferred initiating-stream consumption. Serialized observer frames
excluded the raw sensitive value; redaction replay matched the masked
caller output, and tripwires exposed no raw text. No processor redesign
was made.
- Actual Redis cleanup was tested after an acknowledged cross-node
abort: physical run, control, acknowledgement, counter/list and
ownership keys were first observed, then all ten run-associated keys
disappeared after configured cleanup. This verifies more than the added
clearTopic spy assertion.
- The reviewer used source aliases for the exact production sources in a
disposable checkout, including both child HTTP processes. They did not
independently validate the full build, Inngest, browser Studio Stop,
natural 24-hour expiry or load costs.

## Unverified

- Studio Stop button for thread-less plain runs: not exercised in a
browser.
- Cost: every registered agent publishes each chunk and writes an
ownership record. Not benchmarked.
- Natural 24h expiry: tested by deleting the record, not by waiting.
Merged main now honors the requested minimum TTL for indexed in-memory
logs. Entry-cap eviction can still shorten replay; docs were corrected
in `35debe7a`.
- Abort of a run whose executing process died: returns `aborted: false`
after the ack timeout; the run's record stays until its TTL.

## Assumptions

- InngestAgent keeps its own pubsub/cache resolution. Importing a new
core export would fail `check-core-imports` until core is released, so
no Inngest change or peer-range bump here (and no inngest changeset).
Follow-up after release.
- thread-stream-restart's "leaves nothing" assertion now ignores the
agent stream topic, since run events are kept for `cleanupTimeoutMs` by
design.

## Decisions (confirmed by Tony)

1. Registered `DurableAgent`s on the default engine use `mastra.pubsub`,
same as plain agents; unregistered ones keep a private bus.
2. Streams are on by default for agents registered on `Mastra` and off
for standalone agents; docs explain the cost and how to turn streams
off.
3. With streams on, HTTP disconnect detaches instead of aborting.

## Open question

The Superagent security scan flags (3): a client can start expensive
runs and disconnect, and nothing limits active or concurrent detached
runs. Options: accept and document, cap detached runs, or keep
abort-on-disconnect for HTTP-started runs.

Risk: medium-high — every registered agent now publishes, HTTP
disconnect no longer aborts plain runs, and observe/abort now authorize
plain runs from a shared cache record.


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

## ELI5

If someone disconnects while an agent is working, the agent can keep
running and save its updates so the reader can reconnect. Authorized
readers can also check on or stop a run; this does not add crash
recovery to plain agents.

## What changed

- Added configurable resumable streams for plain `Agent` runs. Streams
default to on for agents registered with `Mastra` and off for standalone
agents.
- Added `observe()` replay and live updates, including observation from
an event offset. Added abort support through `observe().abort()`,
`abortRunStream(runId)`, and server routes.
- When streams are enabled, an HTTP disconnect detaches the reader
instead of aborting the run. For plain agents, `streams: false` disables
publishing. Durable agents continue to publish; `streams: false`
disables their replay cache.
- Added run ownership records and authorization checks. Shared PubSub
and cache support observation and abort across servers. Unknown or
unverified runs return 404; cache-read failures return 503.
- Added run-ID claim checks. A run ID already owned by another resource
is rejected with `AGENT_RUN_ID_ALREADY_CLAIMED` and maps to HTTP 409.
Concurrent claims across processes may still overlap because the cache
has no compare-and-set operation.
- Added cleanup timers that do not keep the process alive. Cache TTL and
eviction can also limit event retention.
- Updated step bookkeeping to use the run’s original owner when
execution replaces its abort signal.
- Added documentation, tests, and a Redis/LibSQL cross-server
integration suite.

## Verification and open questions

The supplied context reports that the merged-result server-handler suite
passed 2,478 tests, with 2 skipped and 1 todo. It also reports real
two-server Redis/LibSQL tests, but provides no exact result count. Full
core and server typechecks were not clean; the reported diagnostics were
reproduced against unchanged `main`. A broader core run stopped after 8
of 10 tests when the crash-recovery worker exhausted its heap. Two
Inngest unit-test failures were also reported on `main`.

The author flagged that detached runs can continue without limits on
active or concurrent runs. Browser testing of Studio Stop for
thread-less plain runs, performance costs, natural 24-hour expiry, and
abort behavior after the executing process dies remain unverified. An
abort request cannot be confirmed if the process running the run is
unavailable.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

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: review <review@local>
2026-11-04 17:29:16 -08:00
Marvin Frachet
fc182d9c14
feat(mcp-apps-components): pin dashboard widgets through standard MCP Apps model context (#29488)
This makes dashboard widget pinning work with any MCP Apps host, using
only standard MCP Apps messages, and gives React hosts a small hook to
wire it up.

When the user clicks a pin, the app sends `ui/update-model-context` with
the full list of widgets the user wants pinned under
`mastra.ai/dashboard-pinned-widgets` in `structuredContent` (each entry
is `{ widget, scope, defaults }`), plus a short text block so the model
knows too. The host still owns the state: it sends pinned ids back in
host context and the buttons follow that. Pin and drilldown state go in
the same update, so one never wipes the other, and quick clicks build on
each other until the host answers. Pin buttons only show when the host
holds the ids array and advertises
`updateModelContext.structuredContent`. Hosts parse the payload with
`dashboardPinnedWidgetsSchema`.

On the host side, `@mastra/playground-ui/domains/mcps` gets
`McpAppHostProvider`, which lets a chat add host-context keys per app
instance and receive raw model context with the app it came from,
without reloading the iframe. The existing text model-context path is
unchanged, and without the provider nothing changes.
`@mastra/mcp-apps-components/host` adds `useMcpAppHost`, which parses
and routes pin updates; that subpath doesn't pull in the app's HTML (1.6
KB vs 2.1 MB).

```tsx
import { McpAppHostProvider } from '@mastra/playground-ui/domains/mcps';
import { useMcpAppHost } from '@mastra/mcp-apps-components/host';

const host = useMcpAppHost({ dashboardPins: { pinnedIds, onPinnedChange } });
<McpAppHostProvider value={host}>{chat}</McpAppHostProvider>;
```

`@mastra/mcp-apps-components` is also added to the playground-snapshot
publish job so the platform frontend can pick it up with playground-ui.

Tested with the real app over an in-memory AppBridge (pin/unpin round
trip through `useMcpAppHost`, rapid clicks, host declining a pin,
drilldown + pins coexisting, capability gating, invalid payloads) and
MSW-backed tests for `McpAppToolResult`/`McpAppViewer` (host-context
changes reach the running app without reload, raw params reach
`onModelContext`, read-only and no-provider cases). Key behaviors were
mutation-checked. Typecheck, oxlint and builds pass for both packages.


Also checked by hand in Studio against `examples/agent`'s dashboard
agent, with a temporary `useMcpAppHost` provider around the chat: pin →
unpin → pin sends exactly one host update per click (with the widget's
defaults), the iframe never reloads, and the agent correctly names the
pinned widget from model context alone.


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

## ELI5

The dashboard can now send its pinned widgets to the app that hosts it.
The host can save those choices and send them back, while apps that do
not use the new host support can continue to work.

## What changed

- Added `McpAppHostProvider` to `@mastra/playground-ui/domains/mcps`. It
provides per-app host context and receives raw model-context updates
while the app is running.
- Added the `@mastra/mcp-apps-components/host` export and
`useMcpAppHost` hook. Hosts can provide pinned widget IDs and handle
validated pin updates.
- Changed dashboard pinning to use `ui/update-model-context`. The app
sends the full requested widget list under
`mastra.ai/dashboard-pinned-widgets`, with a text description and
request number. Pin and drilldown state share an update.
- Pin controls require host-provided pin IDs and support for
`updateModelContext.structuredContent`. The host can disable pinning by
setting the pin context value to `null`.
- Removed the dashboard pin notification API. Hosts now use the
pinned-widget schemas and model-context updates.
- Added `@mastra/mcp-apps-components` to the playground snapshot publish
workflow and updated snapshot release guidance. Snapshot checks and
publishing use production dependency filters.

## Compatibility

Apps can continue to work without `McpAppHostProvider`. The former
dashboard pin notification API was removed and replaced with
model-context updates.

## Tests and validation

Added tests for pin and unpin interactions, pending and declined
requests, host-context updates, model-context handling, capability
gating, and invalid pin data. The PR objectives report typecheck,
oxlint, and builds passing for both packages, plus manual Studio checks.
These results were not independently verified.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-04 17:15:46 -08:00
Ward Peeters
cd96954ced
ci: run Quality assurance and Prebuild on stacked PRs, diffed against main (#29393)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-11-04 14:01:44 +01:00
mastra-platform[bot]
ab4d89cd38
test(redis-streams): run durable worker-takeover suite against real Redis and Postgres (#28952)
> Opened by @user_01KNA8J74D4RF84RXSDRX26BS9

Part 3 of 3, split from #28676. Refs COR-1490. Parts 1 and 2 (#28947,
#28951) are merged into `main`. This PR is based on `main`.

## What this does
The API-loss and worker-takeover guarantees from #28951 only hold with a
shared store that supports run fencing and a transport that works across
processes. In-memory suites can't test that. This PR:
- adds `.github/workflows/test-durable-streams.yml`, which runs the
two-process takeover suite against Redis (`:6381`) and Postgres
(`:5436`) service containers. The checkout uses `persist-credentials:
false`.
- calls it from `test-suite.yml` as the `durable-streams` job. The job
reports its own check but does not gate `Merge Test Reports`, because
its flake rate hasn't been measured yet.
- runs it when `prebuild.yml` sees changes to the evented agent and
workflow code, `packages/core/src/mastra/`, `packages/memory/`,
`pubsub/redis-streams/`, `stores/pg/`, or the workflow files
- extends `pubsub/redis-streams/src/durable-worker-takeover.test.ts` and
adds the `durable-api-loss.entry.mjs` fixture. The scenarios: API
SIGTERM/SIGKILL with remote workers, a thread follow-up after API loss,
a remote abort, worker shutdown, single-process Redis shutdown, and the
original caller completing with and without a survivor that is already
running
- adds `tsconfig.test.json` and a `check:test` script, which type-check
the tests and fixtures against core's `dist`

No changeset: this PR only touches CI and tests.

## Verification
- Reviewer run at `bed900442c` against Redis and Postgres: the
worker-takeover suite passes 11/11. Reverting #28951's production
changes makes 7 of 11 fail.
- `check:test` exits 0 with the single config and covers all 12 package
files, including `agent-thread-worker.entry.ts`.

Risk: low. CI and tests only.

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

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

## ELI5

This PR adds a CI check that runs worker-takeover tests with real Redis
and Postgres. The tests check whether durable work can continue or
recover when the API or a worker stops.

## Summary

- Adds a reusable GitHub Actions workflow with Redis 8 and
pgvector/Postgres 16 services.
- Updates `prebuild.yml` to detect changes that affect durable streams
and pass that result to `test-suite.yml`.
- Adds a `durable-streams` job that runs when the relevant code changes.
- Adds takeover tests for API `SIGTERM` and `SIGKILL`, follow-up
messages, remote aborts, worker shutdown, Redis shutdown, and caller
completion.
- Adds a fixture that records tool execution state in Postgres and uses
Redis Streams for pub/sub.
- Adds `check:test` and TypeScript test configuration for typechecking
the fixtures separately from the package build.

The author reports that `check:test` passed and the takeover suite
passed 11/11 against Postgres and Redis 8. The author also reports that
reverting `packages/core/src` to its state before `#28951` causes the
API `SIGTERM` takeover test to fail. The PR author states that no
changeset is required.

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

---------

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: Nik Aiyer <nik@mastra.ai>
Co-authored-by: review <review@local>
Co-authored-by: mastra-platform[bot] <mastra-platform[bot]@users.noreply.github.com>
2026-11-03 11:41:25 -08:00
Dane - AI (Mastra)
3bdb4ec5f4
chore(deps): update build tools (major) (#29026)
> [!NOTE]
> This PR body was truncated due to platform limits.

This PR contains the following updates:

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

---

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

---

### Release Notes

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

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

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

#####    🐞 Bug Fixes

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

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

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

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

#####    🚀 Features

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

#####    🐞 Bug Fixes

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

#####    🏎 Performance

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

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

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

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

#####    🐞 Bug Fixes

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

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

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

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

#####    🐞 Bug Fixes

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

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

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

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

#####    🚀 Features

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

#####    🐞 Bug Fixes

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

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

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

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

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

#####    🚨 Breaking Changes

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

#####    🚀 Features

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

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


</details>

---

### Configuration

📅 **Schedule**: (UTC)

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

🚦 **Automerge**: Enabled.

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

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend Renovate
CLI](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xOTguMiIsInVwZGF0ZWRJblZlciI6IjQ0LjIwNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0aW9uIl19-->

---------

Co-authored-by: wardpeet <ward@coding-tech.com>
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-11-03 20:18:21 +01:00
Paul
99973935b8
feat(ring-signals): add @mastra/ring-signals package and docs (#28864)
## Description

Adds `@mastra/ring-signals` (`signals/ring`), a `SignalProvider` for
Ring doorbells and cameras, plus its integration guide and reference
page.

- `RingSignals` verifies Ring webhooks (`X-Signature`, HMAC-SHA256 over
the raw body) and sends each enabled event to agent threads as a
notification signal. Devices route to threads added with
`subscribeThread(target, deviceId)`, otherwise to the `target` option
(object or resolver), otherwise to `{ resourceId: <agent id>, threadId:
<deviceId> }`.
- `getRoutes()` returns the Ring routes (`POST /ring/token`, `GET
/ring/link`, `POST /ring/webhook`, `GET /ring/home`, `GET
/ring/media/:kind/:deviceId/:timestamp`), which Mastra adds to the
server automatically.
- Account linking stores each linked account in the channels storage
domain, with tokens encrypted (AES-256-GCM) when `encryptionKey` /
`MASTRA_ENCRYPTION_KEY` is set. Unlinking the app in Ring removes the
stored tokens.
- `ring_snapshot` and `ring_clip` tools fetch media with the linked
account, return signed, expiring media links, and attach files on
channel threads.
- Ported from the working prototype in PaulieScanlon/iot-home-security;
package layout follows `signals/github`. Adds a changeset (minor), a
CODEOWNERS entry, and the lockfile importer.

Tests (`signals/ring/src/ring-signals.test.ts`) run the provider inside
a real `Mastra` + `Agent` + `InMemoryStore`, call the routes through
Hono, and stub only `fetch` for the Ring API and the agent's
`sendNotificationSignal`.

## Related issue(s)

DEVED-559

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

## Checklist

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

Link to Devin session:
https://app.devin.ai/sessions/2cbcddf6003e48f1b776d172de84527c
Open in Devin Desktop:
https://app.devin.ai/desktop/session/2cbcddf6003e48f1b776d172de84527c?variant=devin

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

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

## ELI5

This PR adds a Ring integration for Mastra agents. Ring doorbell and
camera events can reach agent threads, and agents can request snapshots
or video clips for those events.

## What changed

- Added the `@mastra/ring-signals` package with a `RingSignals`
provider, Ring API client, configuration types, and public exports.
- Added webhook signature verification and event routing. Events go to
device subscribers first, then to the configured target, or to a default
agent thread.
- Added account-linking, token, webhook, home, and signed media routes.
Mastra registers the provider’s routes automatically.
- Stored linked Ring accounts in the channels storage domain. Tokens are
encrypted when `encryptionKey` or `MASTRA_ENCRYPTION_KEY` is configured.
Ring unlink events remove stored account tokens.
- Added `ring_snapshot` and `ring_clip` tools. They fetch media from
Ring and can attach files to channel threads. Signed media links are
available when `baseUrl` is configured.
- Added integration and API reference documentation, sidebar entries, a
changeset, and a CODEOWNERS rule.

## Tests

The PR adds tests for provider routes, webhook handling, account
linking, token storage, media links, and tool configuration. Test
execution results were not provided.

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

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-03 17:13:18 +00:00
Anurag Ojha
f62a2d6dc1
fix(observability): pin OTLP exporters to the OpenTelemetry SDK 2 line (#29265)
## Description

A Renovate bump moved the OTLP exporter packages in `observability/*` to
`0.300.0`, the OpenTelemetry SDK 3 line, while `sdk-trace-base`, `core`
and `resources` stayed on 2.x. The two lines need different
`@opentelemetry/api` versions, so npm hoists api 1.9.1 and the 0.300
exporters fail to load with `The requested module '@opentelemetry/api'
does not provide an export named 'SeverityNumber'`. pnpm in the monorepo
never hit it.

What users saw, all reproduced with fresh npm installs from the
registry:

- `import "@mastra/arize"` and `import "@mastra/arthur"` crash (the
linked issue).
- `@mastra/otel-exporter` 1.5.0 exports nothing. It loads its exporters
with a dynamic import, that import fails, and the catch logs "exporter
is not installed" and disables export. ESM and CommonJS, traces and
logs, every protocol, including the install commands in the docs. 1.4.10
exports fine.
- `import "@mastra/laminar"` crashes when installed next to
`@mastra/otel-exporter`.

Changes:

- Move the OTLP exporters back to `^0.223.0`, the last SDK 2 release, in
`@mastra/arize`, `@mastra/arthur`, `@mastra/laminar` and
`@mastra/otel-exporter`. No source change.
- Set `@opentelemetry/api` to `^1.9.0` in arize, arthur, laminar,
otel-exporter and otel-bridge. The same Renovate bump had raised it to
`^1.10.0`, and the SDK 2 packages need api below 1.10, so npm nested a
second api copy under each of our packages. A 1.10 copy cannot see the
tracer provider or the active span registered through the 1.9 copy
(checked with a real two-copy install). In the monorepo pnpm keeps
1.10.0, so only the lockfile specifiers change. Declaring it in arize
and arthur also keeps pnpm linking them to the same SDK instance as
otel-exporter.
- Widen otel-exporter's exporter `peerDependencies` from `^0.218.0`,
which on 0.x only matches 0.218.x, to `>=0.218.0 <0.300.0`, so they
agree with the optional dependencies.
- Add a Renovate rule that holds the six OTLP exporters below `0.300.0`
under `observability/*`. Renovate treats `0.22x -> 0.300` as a minor
update, so the major-approval gate did not stop it. A second rule keeps
the `@opentelemetry/api` ranges under `observability/*` as written and
updates only the lockfile, because the repo-wide `bump` strategy is what
raised them to `^1.10.0`. Remove both rules when `observability/*` moves
to SDK 3 together.
- Add the e2e suite `e2e-tests/npm-import`. It installs one template app
per install shape (arize and arthur, otel-exporter, laminar,
otel-bridge) with npm, not pnpm, imports and requires each package,
checks that npm installs one `@opentelemetry/api` copy, and sends a real
span through `OtelExporter` to a local server. It failed on the old
manifests with the errors above and passes on the fixed ones. It runs in
CI next to the sibling suites.

## Related issue(s)

Fixes #29175

## Type of change

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

## Checklist

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


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

## ELI5

Some packages used OpenTelemetry versions that did not work well
together after a fresh npm install. This PR aligns their version ranges
and adds checks for package loading, shared API installation, and trace
export.

## What changed

- Pins OTLP exporter dependencies to `^0.223.0` in `@mastra/arize`,
`@mastra/arthur`, `@mastra/laminar`, and `@mastra/otel-exporter`.
- Sets `@opentelemetry/api` to `^1.9.0` in the affected observability
packages, including `@mastra/otel-bridge`.
- Widens the six OTLP exporter peer dependency ranges in
`@mastra/otel-exporter` to `>=0.218.0 <0.300.0`.
- Adds Renovate rules to keep OTLP exporters below `0.300.0` and update
the API lockfile without changing its declared range.
- Adds an npm-import E2E suite that checks ESM imports, CommonJS
requires, a single installed API copy, and HTTP/protobuf trace export.
- Adds the suite to the E2E workflow and local registry publish
configuration, and adds patch changesets for the affected packages.

The supplied information does not establish test results.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-03 20:13:37 +05:30
starslingdev[bot]
541819e6fa
ci: install pnpm dependencies from StarSling Disks (#29130) 2026-11-01 08:24:34 -08:00
Ward Peeters
8e73a43d3f
ci: fail Merge Test Reports when a test job did not finish (#28964)
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-30 11:41:53 +01:00
Tyler Barnes
46c6a77d4c
ci: give Affected UNIT 60 minutes for PRs that touch core (#28944)
## Summary
The Affected UNIT job runs every test affected by a PR in one unsharded
vitest run, capped at 20 minutes. When a PR changes `@mastra/core` or
the stores, the affected set is nearly the whole repo. The full suite
needs about 40 minutes of test time (4 shards of 10–15 min each on the
latest main run), so these PRs get cancelled at 20 minutes with no
failing tests. This happened on #28353 twice (~44,880 passing tests when
cancelled) and on #28935.

This raises the cap to 60 minutes. Small PRs are unaffected (they finish
in 1–4 minutes).

## Test plan
- One-line change to `timeout-minutes` on the Affected UNIT job in
`.github/workflows/test-suite.yml`.
- Verify by re-running Affected UNIT on #28353 after merge; it should
complete instead of being cancelled.

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

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

## ELI5

Some changes make the affected test job run many more tests than usual.
This PR gives that job up to 60 minutes instead of 20, so it has more
time to finish.

## Change

- Set `timeout-minutes` to `60` for the `affected-unit-test` job in
`.github/workflows/test-suite.yml`.

The planned rerun to verify completion has not been reported.

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

Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-29 21:38:11 -07:00
Tyler Barnes
64b43eefcc
ci: send Release PR test alerts to the recreated alerts channel (#28938)
Follow-up to #28937 (move Release PR test alerts out of
#eng-maintainers-club). The alerts channel was recreated after that
merged, so this swaps the one-line channel override in prebuild.yml to
the new channel ID. Alpha publish alerts are unchanged. Workflow-only,
no changeset.

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

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

## ELI5

Release PR test alerts now go to the recreated Slack channel. The
previous channel no longer receives these alerts.

## Change

- Updated the channel ID in `.github/workflows/prebuild.yml` from
`C0CD83111EX` to `C0CD83YFFNF`.
- Alpha publish alerts are unchanged.
- This workflow-only change has no changeset.

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

Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-29 18:59:55 -07:00
Tyler Barnes
0730fb40fa
ci: send Release PR test alerts to #eng-release-alerts (#28937)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-29 18:48:47 -07:00
Daniel Lew
aa120ea351
ci: include @mastra/observability in playground snapshots (#28875)
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-29 16:56:52 -04:00
Ward Peeters
e9a658742a
ci(release): publish npm packages in parallel, in dependency order (#28733)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-29 14:14:59 +01:00
Ward Peeters
f1964c0256
ci(e2e): publish a single e2e-test dist-tag for every suite (#28688)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-10-28 14:09:29 +01:00
Ward Peeters
a08f79873e
ci(release): check out full history for stable publishes (#28685)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-28 10:06:51 +01:00
Ward Peeters
29cb6c4867
ci: remove the E2E softwarefactory template job (#28686)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-28 10:04:54 +01:00
Ward Peeters
84fa97871a
Validate the checked-in factory templates and retire the generated softwarefactory-template (#28436)
## Summary

`create-factory` now scaffolds the checked-in
`templates/template-factory` (platform) and
`templates/template-factory-self-hosted` (`--no-platform`) starters
(#28430). The old path — generating `mastra-ai/softwarefactory-template`
from `mastracode/web` with `sync-template.mjs` and pushing it from a
dedicated workflow — no longer feeds anything users receive, so this PR
removes it. The new templates sync through the same `sync-templates.yml`
as every other template.

| Before | After |
| --- | --- |
| `sync-softwarefactory-template.yml` generated a template from
`mastracode/web` and pushed it after an install/typecheck/build check
against published npm | Removed. Both factory templates sync through the
shared `sync-templates.yml`, unchanged |
| `e2e-softwarefactory` generated the template, scaffolded it, and
booted it with auth disabled | Scaffolds both checked-in templates
through the built CLI, typechecks and builds them against the local
package set, and boots the self-hosted template against its own Postgres
(`npm run db:up`) behind WorkOS auth |
| Template edits did not trigger the E2E suite | Changes under
`templates/template-factory*` run it |

Also removes `mastracode/mastra-factory/scripts/sync-template.mjs`, its
test, `template/README.md`, and the `template-out` ignores. The suite's
local registry setup is fixed: it could not resolve the verdaccio bin
(verdaccio 6 only exports `.` and `./package.json`) and, because that
failure happened after the repo was snapshot-versioned, left the working
tree mutated.

Stacked on #28430 → #28255.

## Follow-up after release

Once a `create-factory` release that uses the new templates is on
`latest`, archive `mastra-ai/softwarefactory-template` (don't delete it
— older CLI versions still clone it).

## Test plan

- [x] `create-factory`: tests (55), `tsc --noEmit`, lint
- [x] Both templates typecheck and bundle with `mastra build` against
workspace packages
- [x] Self-hosted template boots under `mastra factory dev` against
Postgres: `/signin` serves the Factory UI, `/auth/me` reports `workos`,
`/api/tools` returns 401
- [x] `e2e-softwarefactory` passes locally (7 tests, ~7 min): both
templates scaffold via the built CLI, typecheck, and build against the
local registry; the self-hosted template boots against `npm run db:up`
Postgres
- [ ] `e2e-softwarefactory` passes in CI

---------

Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-27 17:06:07 +01:00
Damien Schneider
7701b35eaa
chore(lint): enable safe syntax simplification rules at root (#28582)
Enables all eleven requested Oxlint rules as errors in the root config
and migrates the 115 existing findings across 55 files. JSX curly-brace
simplification is limited to props (`props: 'never', children:
'ignore'`), boolean props use shorthand, and empty elements become
self-closing.

The manual edits preserve the exact continued-string and template
values, remove redundant assignment-side non-null assertions, and retain
the indexed-read assertion in fastembed's compound assignment. The
BigInt and octal conversions use native globals and exact values
supported by the existing compilation targets. No lint suppressions were
added.

Validation: the eleven-rule scan reports zero diagnostics; before/after
emitted-JavaScript comparison passes for all 55 migrated files,
including 31 JSX files, after normalizing only the reviewed syntax
rewrites. Formatting and whitespace checks pass. Core utility/clone
tests (146), fastembed pooling tests (9), the changed A2A signature test
(1), and fastembed build-config typechecking pass. The root lint scan
retains the same 1,244 pre-existing diagnostics with no new findings.
GitHub CI now also passes the full lint/format job, build, Mastra Code
typecheck, generated-file check, and bundle validation. Local UI/evals
runs were limited by missing dependencies; the CodeDiff folding failure
was reproduced on unchanged baseline code. A second audit confirmed
native unshadowed globals for all five literal conversions, pure targets
for all twelve assignment rewrites, no references or direct eval in all
eight simplified catches, and ordinary semantics for both computed keys.

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

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

## ELI5

This PR turns on more code-style checks and updates existing code to
pass them. The changes simplify syntax while preserving the intended
behavior.

## Changes

- Enabled eleven Oxlint rules as errors in the root configuration.
- Updated 115 findings across 55 files. Changes include simpler string
and JSX syntax, compound assignments, native BigInt and octal literals,
and catch clauses without unused error variables.
- Configured JSX curly-brace simplification for props only. JSX children
remain unchanged.
- Removed redundant assignment-side non-null assertions while retaining
the indexed-read assertion needed for fastembed’s compound assignment.
- Added no lint suppressions.

## Validation

The author reports zero diagnostics from the eleven-rule scan and no new
findings in the root lint scan, which retains 1,244 pre-existing
diagnostics. Before-and-after emitted-JavaScript comparisons reportedly
pass for all 55 changed files after normalizing the reviewed syntax
rewrites. Formatting and whitespace checks also pass.

Reported tests include 146 core utility and clone tests, 9 fastembed
pooling tests, 1 changed A2A signature test, and fastembed build-config
typechecking. Full workspace lint and the UI/evals suites were limited
by missing dependencies in the checkout. The CodeDiff folding test fails
on unchanged baseline code.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-27 14:00:25 +01:00
Ward Peeters
cb74894ef4
ci: only validate the changeset release plan when a PR adds changesets (#28563)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-10-27 12:25:49 +01:00
Lennart
ac0a24c2a8
docs: strengthen authoring guardrails and prose lint workflow (#28256)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-23 14:34:31 +02:00
Ward Peeters
4c25a7c3f9
ci: run affected tests on regular PRs again (#28252)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-23 13:55:36 +02:00
shreyas-mastra
323c14179f
chore(security): bump Node.js to 22.23.4 / 24.22.1 (CVE-2026-111497) (#28170)
Node.js Oct 2026 security release (v22.23.4 / v24.22.1): fixes Brotli
OOB write RCE CVE-2026-111497, TLS hostname-verification bypasses, dns
NUL truncation, eMudhra CA distrust, undici/OpenSSL/c-ares updates.

Bumps the Node pins in this repo: 24.22.1 for CI and the default E2B
template, 24.22.1 and 22.23.4 for the starter templates and the
otel-bridge example. `node:22-*` image tags stay floating, so they
resolve to the patched release on their own, and engine ranges are
unchanged.

⚠️ 24h soak rule: nodejs.org dist published 2026-10-21 10:33 UTC. Docker
`node:22.23.4-slim`/`-bookworm-slim` published 2026-10-21 17:38 UTC (24h
at 1:38 PM EDT Oct 22); `node:22.23.4-alpine` published 2026-10-22 02:39
UTC (24h at 10:39 PM EDT Oct 22). Do not merge before then.

After merge, images must be rebuilt and redeployed for the fix to take
effect.


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

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

## ELI5
This PR updates Node.js versions used by CI, templates, and E2B sandbox
defaults. It brings them to the versions identified in the PR
description as security updates.

## Changes
- Updates Node.js 24 pins in GitHub Actions workflows and the setup
action from `24.22.0` to `24.22.1`.
- Updates the default Node.js version for E2B templates to `24.22.1`.
- Updates Node.js pins in two templates and an observability example to
`22.23.4` or `24.22.1`.
- Adds a test for the E2B default template’s version-based identity and
a patch changeset for `@mastra/e2b`.

The supplied change summary does not confirm updates to floating
`node:22-*` tags. It does not provide test results or current review
findings.

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

---------

Co-authored-by: Justin Levine <20596508+jal-co@users.noreply.github.com>
2026-10-22 21:39:34 -04:00
mastra-platform[bot]
fb5c594e52
fix: require and declare the Apache-2.0 license in package.json (#28122)
> Opened by @user_01KN4T0VBWE4X5GKHXP2RCP40M

## What

`@mastra/inngest` (reported in #28120) was published without a `license`
field, so npm reported it as "Unlicensed" to license scanners even
though the tarball ships `LICENSE.md` with Apache-2.0. Auditing the repo
showed 12 publishable packages in the same state, not just Inngest.

This PR:

1. Adds `"license": "Apache-2.0"` to every affected manifest:
   - `@mastra/inngest`
   - `@mastra/editor`
- `@mastra/google-cloud-pubsub`, `@mastra/redis-streams`,
`@mastra/valkey-streams`
- `@mastra/cloudflare-d1`, `@mastra/couchbase`, `@mastra/dynamodb`,
`@mastra/elasticsearch`, `@mastra/lance`, `@mastra/mongodb`,
`@mastra/opensearch`
2. Teaches `.github/scripts/validate-pkg-json.mjs` to validate the field
for every package it already checks: missing license or a value other
than `Apache-2.0` fails the `Validate package.json files` CI job.
3. Ships one changeset (`patch` for all 12 packages) describing the
`package.json` update.

The validator's existing scope is unchanged: private packages, the
ignore list, and non-published templates/fixtures are still skipped.

Fixes #28120

## Proof

```
$ node .github/scripts/validate-pkg-json.mjs
✅ All checked package.json files passed validation.
Total: 160 files
```

Negative test — removing the new `license` field from
`workflows/inngest/package.json` and re-running:

```
❌ /workspace/mastra/workflows/inngest/package.json: missing license field
exit=1
```

Restoring the field returns the validator to `exit=0`, proving the check
is what fails rather than an unrelated error.

`npx prettier --check` passes on all changed files.

## Unverified

- `npm view @mastra/inngest license` only reflects the fix after the
next release publishes.

## Risk

low — metadata-only manifest changes plus a CI script check.


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

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

## ELI5

This change adds a clear license label to 12 packages. It also updates a
check that warns if a checked package is missing that label or uses a
different one.

## Summary

- Added `"license": "Apache-2.0"` to 12 package manifests.
- Updated `.github/scripts/validate-pkg-json.mjs` to reject checked
packages when the license field is missing or does not match
`Apache-2.0`. The validator’s existing package scope remains unchanged.
- Added a changeset that declares patch releases for 13 `@mastra`
packages.

## Validation

The author reports that the validator passes for 160 files, and that
removing the license field from `workflows/inngest/package.json`
produces an error and exit code 1. The author also reports that Prettier
checks pass on all changed files. Published npm metadata has not been
verified; it will reflect this change after a release.

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

Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-22 11:48:42 +00:00
Dane - AI (Mastra)
0ed521db82
chore(deps): update github actions (#26814) 2026-10-21 09:26:51 +02:00
Ward Peeters
10f27aa293
ci: stop repeated 'release PR green again' Slack alerts (#27890)
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-21 00:35:05 +02:00
Lennart
6f5a36d8f9
chore(repo): Mention new PR policy (#27829) 2026-10-20 08:38:31 -07:00
Ward Peeters
6f56ba3aa1
ci: prevent repeated release PR failure alerts (#27627)
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-19 10:51:11 +02:00
Ward Peeters
8ea568a973
ci: run the full test suite before alpha publishes (#27344)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>
2026-10-17 17:21:06 -07:00
Tyler Barnes
7ceec4759f
test(ci): time npm-check deadline tests on registry activity, not process start-up (#27339)
Co-authored-by: remy-builder[bot] <324360501+remy-builder[bot]@users.noreply.github.com>
2026-10-16 15:53:21 -07:00
Ward Peeters
0778bf739f
ci: run the full test suite on the Changesets release PR (#27341)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-16 14:18:31 -07:00
Tyler Barnes
b5e6c8f61c
ci(lint): use a blobless checkout for the npm package check (#27215)
## Problem

The `New packages exist on npm` job in `lint.yml` checks out full
history with every old file version (`fetch-depth: 0`, no filter).
Across 182 runs on Oct 15, that checkout took a median of 95s and as
long as 533s. On #27078 it took 8m53s, so the job hit its 10-minute
timeout and GitHub cancelled it before the npm check ran
([run](https://github.com/mastra-ai/mastra/actions/runs/38685545054/job/116259426065)).

## Change

Add `filter: blob:none` to that job's checkout, the same setting
`Validate changeset packages` already uses (its checkout takes about
18s). The check still has the full commit history it needs, and old file
versions are skipped. It only runs `git diff --name-only <base>...HEAD
-- '**/package.json'`, which never reads old file contents, and pnpm
reads package.json files from the working tree, which the checkout still
provides.

## Testing

I ran the check in a fresh `git clone --filter=blob:none` of this repo:
- Replaying the PR that added `@mastra/sprites`, the changed-package
check found exactly that package. With a mock registry that returns 404
for it, the check failed with the recovery instructions (exit 1).
- The check never had to download old file versions: the local count
stayed the same while it ran.
- Checking all 163 publishable packages at `main` passed.
- `yaml-lint` passes, and `actionlint` reports only the existing custom
runner-label warnings.


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

## ELI5
The npm check needs the project’s history to find new packages. It does
not need old copies of every file, so this change skips downloading
those old file contents and can make checkout faster.

## Summary
- Added `filter: blob:none` to the `new-package-npm-check` checkout in
`.github/workflows/lint.yml`.
- Kept `fetch-depth: 0`, so the checkout retains full history.
- Left the package-detection check unchanged.

<!-- 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-10-15 16:56:11 -07:00
Tyler Barnes
4bb2f0ad72
feat(ci): fail PRs and publishes on packages missing from npm (#26721)
## Why

Alpha.9 publish run 38152562840 published 7 packages, then failed
partway through on the brand-new `@mastra/sprites` with `E404 PUT` /
`ERR_PNPM_AUTH_TOKEN_EXCHANGE`. `npm-publish.yml` uses npm trusted
publishing (OIDC) with no token fallback. npm only exchanges the job's
GitHub OIDC token for a publish token if the package exists and has a
trusted publisher matching this repo and workflow, and npm only allows a
trusted publisher on a package that already exists. So a never-published
workspace package, or an existing one with no trusted publisher (or one
for another workflow), breaks the release after other packages have
already gone out. Recovery took an npm org admin doing a manual first
publish and an `npm trust` call, then a rerun.

## What

- **`.github/scripts/check-npm-packages-exist.mjs`** checks that every
non-private workspace package exists on npm, using anonymous registry
reads (works in PR workflows without secrets). `--since <ref>` limits
the check to packages whose `package.json` changed, which catches new
packages and private→public promotions. `--retry-404` waits out registry
propagation delay. A registry it can't reach (exit 2) is reported
separately from a missing package (exit 1), so registry flakiness is
never reported as a missing package.
- **Trusted-publishing check (`--oidc`, publish jobs only; new in this
PR)**: for every package in scope, the script requests a GitHub OIDC
token (audience `npm:registry.npmjs.org`) and POSTs it to
`/-/npm/v1/oidc/token/exchange/package/<name>`. This is the exchange
pnpm 11 and npm 11 perform at publish time (endpoint and request shape
taken from pnpm 11.21's `publish/oidc/authToken.js` and npm 12.2's
`lib/utils/oidc.js`). The token npm returns is discarded and never
printed. A granted token proves npm accepts this job as the package's
trusted publisher (repo, workflow and, if the publisher names one,
GitHub environment). It does not prove the publish itself will be
accepted: npm uses the same exchange for publish, stage publish and
dist-tag, so a trusted publisher limited to staged publishing passes
this check. The placeholder script below checks that permission when it
configures or reads back trust. A refused exchange fails with the
packages named and the fix (`scripts/npm-placeholder-publish.mjs` or
`npm trust github … --file npm-publish.yml`). Registry or GitHub-token
errors are reported separately as "could not verify". The check covers
every package in scope, not just those with a new version, because
stable and snapshot run it before versioning. All 163 current public
packages already have a version published through trusted publishing.
- **PR gate** (`lint.yml`, job *New packages exist on npm*): Changesets
release PRs check every package. Other PRs only check packages whose
`package.json` changed, and PRs that touch none make no registry calls.
PR refs stay out of shell: routing is done with `if:` and the base ref
is passed through `env:`. The gate has no OIDC token, so it only
**warns** (`:⚠️:`, never fails) when a package exists but no
version of it was ever published through trusted publishing. A fresh
placeholder looks like that until CI's first publish.
- **Publish check** in all four publish jobs (prerelease, stable,
snapshot, playground-snapshot): existence check, then the
trusted-publishing check. Each check makes one pass over every package,
then re-checks only the missing or refused ones against one shared
5-minute deadline, which picks up a package or trusted publisher an
admin fixed minutes ago. A failing job therefore takes about one retry
window, however many packages fail. If every package is refused, which
points to a misconfigured job rather than the packages, the check fails
after the first pass. It runs before anything publishes, and for stable
before the version commit is pushed to `main`.
- **`scripts/npm-placeholder-publish.mjs`**: the recovery both checks
point to. An npm org admin runs `node
scripts/npm-placeholder-publish.mjs <package>` after `npm login`. For a
never-published name it publishes an empty `0.0.0` placeholder
(package.json + README, no code from any branch). It then configures
trusted publishing for `npm-publish.yml` (with npm ^11.15.0, the first
version with `--allow-publish`) and reads it back with `npm trust list`.
It skips the setup when a usable trusted publisher is already present,
and fails if npm doesn't report one afterwards. A trusted publisher for
this repo and workflow is usable only if it allows publishing
(`createPackage`; older settings with no permissions field count) and is
not restricted to a GitHub environment, because the publish jobs declare
none. A stage-only or environment-restricted one is reported with the
`npm trust revoke --id` command to remove it, instead of being treated
as configured. CI then publishes the real versions. Prereleases go out
under `alpha`, so `latest` stays on the placeholder until the first
stable release, and the placeholder's description and README point
installers to `<package>@alpha`. The script refuses unknown or private
names, an unreachable registry and a logged-out session, publishes
nothing for a name already on npm, and supports `--dry-run`.

CI-only change, so there is no changeset.

## Testing

- `node --test .github/scripts/check-npm-packages-exist.test.mjs
scripts/npm-placeholder-publish.test.mjs`: 37/37, all against local mock
registries. Against the previous scripts, 12 of the 13 new tests fail,
as does the tightened trust-configuration test. The one exception is the
"no warning" test, which passes on both.
- Trusted-publishing check: trust present (exchange granted), no trust
(exchange refused, package named, fix printed), every package refused
(points at the job), exchange endpoint unreachable (exit 2, not "no
trust"), transient 503/429 recovery, GitHub token endpoint failing,
missing `id-token: write`, and trust appearing within the retry window.
Timing tests cover a run where every package is refused (fails in under
a second with a 60-second window; the earlier per-package polling took
144 seconds) and 24 refused or 24 missing packages (about one 3-second
window; per-package polling took about 7.6 seconds). The tests assert
the request shape (audience, POST path, bearer token) and that no token
appears in the output.
- Placeholder script: runs the real `npm publish`, `npm trust github`
and `npm trust list`, and asserts the uploaded tarball holds only
`README.md` and `package.json` at 0.0.0, with the `@alpha` install
pointer. Trust read-back is covered for already configured, configured
but not reported back (fails), an existing package trusting another
workflow, a stage-only publisher and an environment-restricted publisher
(both fail with revoke steps; both were accepted before), and older
settings with no permissions field (accepted).
- **The token exchange has not been run against live npm with a real
GitHub OIDC token.** That needs `npm-publish.yml` in mastra-ai/mastra,
so the first real run will be the next publish. Locally, read-only: a
fake id token sent to the live exchange endpoint gets `401 OIDC token
exchange error - unauthorized`, which the check reports as refused (exit
1). Without `id-token: write` it exits 2.
- Current main against live npm: all 163 publishable packages exist
(exit 0), with no trusted-publishing warnings.
- Incident replay (tree before the alpha.9 version commit, registry in
its publish-day state): flags only `@mastra/sprites`. Running the
placeholder script then publishes 0.0.0 and sets up trust, and the
re-run check passes.
- The PR that added sprites (#26650, which added the `@mastra/sprites`
package) would have been flagged by the PR gate: of the 32 packages it
changed, only sprites is flagged.
- Live npm, read-only: `--dry-run` for an existing name and for a
never-published name (nothing uploaded).
- actionlint on `lint.yml` and `npm-publish.yml` (no findings besides
the repo-wide custom runner labels); `yaml-lint` on both workflows;
`oxfmt --check` on the scripts.


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

This PR checks that packages exist on npm before release workflows use
them. It also adds a script to prepare new packages for their first npm
release.

## Changes

- Added a pull request check. Changesets release PRs check all
publishable packages. Other PRs check packages whose `package.json`
changed. PRs that change no package manifests make no registry calls.
- Added package-existence and trusted-publishing preflights to the
prerelease, stable, snapshot, and playground-snapshot jobs.
- Added optional `--oidc` checks. A successful token exchange shows that
npm granted the job a token; it does not prove that the token has
publish permission. Without OIDC, the check warns when a package has no
version previously published through trusted publishing.
- Added retries for missing packages and refused token exchanges, using
a shared deadline. The check stops polling when every package’s first
OIDC exchange is refused.
- Added `scripts/npm-placeholder-publish.mjs`. It can publish a public
`0.0.0` placeholder and configure trusted publishing. It rejects
unknown, private, already-published, unverifiable, or unauthenticated
cases, and supports `--dry-run`.
- Added tests for the package checks and placeholder-publishing flows.
- The PR objectives report 37/37 tests passing against local mock
registries and workflow and script lint checks. These results were not
independently verified.
- The PR objectives report that live npm token exchange with a real
GitHub OIDC token has not yet been tested.
<!-- 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-10-14 16:28:27 -07:00
Ward Peeters
32e92b3cb0
ci: speed up the release versioning checkout with a partial clone (#26976)
## Summary

The **Version Packages** workflow (and **Cron Alpha Publish**, which
uses the same pattern) re-checks out the repository with the app token
and `fetch-depth: 0`, so Changesets can find the commit that added each
changeset for changelogs. That full-history fetch downloads every
historical version of every file and took **137s** in [this
run](https://github.com/mastra-ai/mastra/actions/runs/38520173688/job/115707828838),
which is most of the job.

This adds `filter: blob:none` to that checkout. The clone keeps the full
commit graph and all trees, so history lookups work unchanged. Old file
contents are fetched on demand only if something reads them.
`lint-docs.yml`, `prebuild.yml` and others already use the same setting.

## Verification (local, against mastra-ai/mastra)
- `--filter=blob:none` full-history clone of `main`: **9s**, 60 MiB, all
21k commits
- `git log --diff-filter=A --max-count=1 --pretty=format:%H:%P --
<changeset>` (what `@changesets/git` runs) returns identical results to
a full clone for every pending changeset, with no on-demand blob fetches
- `@napi-rs/simple-git` (used by `changesets-changelog-github-local`)
opens the partial clone (`repositoryformatversion = 1`), reports it as
not shallow, and reads commit messages
- Reading an old file version (`git show <old>:package.json`) still
works via on-demand fetch
- Steps after checkout (working-tree diffs, commit, rebase, push) don't
need historical blobs

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

## ELI5

The release workflows need Git history to find changes, but they do not
need every old file version. This change lets them download the history
first and fetch old file data only if needed.

## Changes

- Added `filter: blob:none` to the full-history, app-token checkout in
the Cron Alpha Publish workflow.
- Added the same filter to the full-history, app-token checkout in the
Version Packages workflow.
- Kept `fetch-depth: 0` in both workflows, so both still fetch the full
commit history.

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

Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-13 23:58:59 -07:00