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

48 commits

Author SHA1 Message Date
dane-ai-mastra[bot]
d60ba71be0 chore: version - exit prerelease mode 2026-11-12 21:12:29 +00:00
dane-ai-mastra[bot]
055a8c3b82 chore: version packages 2026-11-12 04:17:40 +00:00
mastra-platform[bot]
743a02786e
feat(valkey): identify Mastra-created clients with a clientInfoTag (#30156) 2026-11-11 17:57:11 -08:00
Dane - AI (Mastra)
c014d187bb
chore(deps): update docker images (major) (#19788) 2026-11-11 17:08:49 -08:00
dane-ai-mastra[bot]
6e8dfcb83f chore: version - exit prerelease mode 2026-11-03 23:45:58 +00:00
Dane - AI (Mastra)
47a6cd82e5
chore(deps): update ai sdk (#29242)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-11-03 16:12:54 +01:00
dane-ai-mastra[bot]
eed9cc214e chore: version packages 2026-11-01 04:20:58 +00:00
Abhi Aiyer
6ede0f10f6
fix(valkey-streams): trim saved thread-stream events (#29095)
> Opened by @abhiaiyer91

Valkey thread streams currently retain saved run events until their size
limit or idle TTL. Implement run-scoped trimming so persisted stream
parts can be removed without deleting other runs, pinned entries, or
retained terminal events. Closes #28974.

Before: `await pubsub.trimTopic(topic, { runId })` leaves all entries
behind. After: it removes that run's eligible entries; `producedBefore`
bounds removal to saved parts and `retainTerminalEvents` preserves
terminal markers. Cleanup now snapshots the current stream tail, so
ongoing publishers cannot extend the scan indefinitely or have their
later entries deleted by that scan.

## Proof
- Real-Valkey concurrency regression: pause the cleanup scan, publish
another target-run entry, resume, and assert only the in-flight entry
remains. This test failed before the tail-snapshot fix (`[]` instead of
`['in-flight']`) and passed after it.
- Existing real-Valkey integration covers more than one scan page,
other-run isolation, pinned entries, produced-time cutoff, and retained
terminal events; the targeted integration and lease suite passed (7/7).
- Full `@mastra/valkey-streams` tests passed (8 files, 42 tests);
package typecheck, lint (0 errors/warnings), formatting, diff check, and
ESM/CJS build passed.
- Earlier local Life Coach run with Postgres and Valkey emitted a finish
event and left 2 stream entries with the patched adapter, compared to
117 before.

## Unverified
- The Life Coach stream iterator remained open after finish, so that
isolated run was stopped by timeout; it is not a completed end-to-end
test. No sustained-production-throughput or multi-process soak test was
run.

## Risk: medium
- Trimming is best-effort and run-scoped, but removal is irreversible.
Real-Valkey tests cover the bounded concurrent-publish race and
preservation predicates; production scheduling and very large/live
streams have not been soak-tested.

Patch changeset included for `@mastra/valkey-streams`.

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

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

## ELI5

When a run is saved, Valkey can keep its stream entries around and use
extra storage. This change removes eligible entries for that run while
keeping entries that must remain.

## What changed

- Added `ValkeyStreamsPubSub.trimTopic` to delete entries for a
specified `runId`.
- When `producedBefore` is set, the method deletes only entries with a
numeric `data.producedAt` at or before the cutoff. It skips pinned
entries.
- When `retainTerminalEvents` is enabled, the method preserves
`run-registered`, `run-completed`, `run-failed`, and `run-aborted`
events, except those marked `suspended`.
- The scan stops at the stream tail captured before scanning starts.
Entries published during the scan are not included.
- Trimming failures are logged as warnings and do not propagate.
- Added integration tests for run-specific trimming, cutoff and
pinned-entry behavior, terminal-event retention, and entries published
during a scan.
- Added a patch changeset for `@mastra/valkey-streams`.

## Validation

The supplied report says six Valkey integration tests passed and the
package TypeScript check, lint, and build succeeded. It also reports a
local Postgres and Valkey test that left two stream entries after a
finish event, down from 117. The stream iterator remained open, so a
timeout stopped the isolated process; the Valkey regression suite
completed normally.

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

---------

Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-31 14:29:32 -07:00
dane-ai-mastra[bot]
77076a1012 chore: version - exit prerelease mode 2026-10-30 23:02:25 +00:00
dane-ai-mastra[bot]
582ef17a2b
chore: version packages (alpha) (#28888)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-30 14:56:53 -07:00
Ward Peeters
ba8b955b1a
fix(redis-streams,valkey-streams): expire idle streams by default and clear them on thread delete (#28968)
A production Factory deployment ran out of Redis memory. Every key was a
`mastra:topic:*` stream, and almost all of them (3,673 thread streams)
had no expiry. The deployment built `new RedisStreamsPubSub({ url })`
with defaults, and the default `streamIdleTtlMs` was `0`, meaning
streams never expire. Thread streams are open-ended and never get
`clearTopic()`, so they piled up forever. The Redis instance used
`volatile-lru`, which can't evict keys without a TTL, so writes just
started failing.

This PR makes `@mastra/redis-streams` and `@mastra/valkey-streams` give
every stream a sliding 7-day idle TTL by default. Writes refresh it, and
live subscribers keep receiving events after a stream expires because
the read loop recreates it. Streams are an event bus, not storage:
replay history lives in the caching layer and storage, so the backlog
only matters for grouped workers that are offline longer than the TTL.

```ts
// Before: streams never expire unless you opt in
new RedisStreamsPubSub({ url });

// After: 7-day idle TTL by default; opt out explicitly
new RedisStreamsPubSub({ url });
new RedisStreamsPubSub({ url, streamIdleTtlMs: 0 });
```

Both pubsubs now log one warning after they first connect if Redis has
`maxmemory` set with any policy other than `noeviction`. A TTL makes
streams, consumer groups and lease keys evictable under `volatile-*`,
which would silently drop events and leases (ElastiCache defaults to
`volatile-lru`). The check uses `INFO memory` because managed Redis
often blocks `CONFIG GET`.

`memory.deleteThread()` now also deletes the thread's event stream
through the registered Mastra pubsub. This runs fire-and-forget, so
neither deleting a thread nor `memory.settled()` waits on Redis during
an outage. It's skipped on older core versions. Agents configured with
their own pubsub still rely on the TTL.

The docs now require `noeviction`; the Helm guide used to say a
`volatile-*` policy was fine. They also add a runbook for reclaiming
streams created before the TTL: switch to `noeviction`, upgrade the
writers, then expire each stream relative to its last write. Tested
against real Redis/Valkey containers, including a real TTL expiry while
a subscriber is listening and a thread delete with Redis unreachable.


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

## ELI5

Redis and Valkey can keep old event streams forever, which uses storage.
This change removes streams after seven days without writes by default
and cleans up a thread’s stream when the thread is deleted.

## What changed

- Redis and Valkey streams now use a sliding seven-day idle TTL by
default. Writes refresh the TTL; reads do not. Set `streamIdleTtlMs: 0`
to disable expiry.
- The read loop recreates an expired stream so a live subscriber can
continue receiving events.
- After connecting, each pubsub warns once when `maxmemory` is enabled
with a policy other than `noeviction`. The check uses `INFO memory`.
- Thread deletion starts best-effort stream cleanup through the
registered Mastra pubsub without waiting for Redis. Older core versions
skip this cleanup.
- Documentation and the local Docker configuration now recommend
`noeviction`. The documentation also explains how to expire existing
streams that lack a TTL.

## Tests

Tests cover TTL behavior, delivery after expiry for live subscribers,
eviction-policy warnings, and thread-stream cleanup. Test execution
results were not provided.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-30 11:51:23 +01:00
shreyas-mastra
6deb7c0a1e
chore(security): Vanta 2026-10-28 - qs 6.16.1, @modelcontextprotocol/node 2.1.1 floors (#28716)
Refs mastra-ai/platform#2931

Vanta remediation pass for 2026-10-28. It follows #28325, which has
merged.

## 2026-10-28 update
Today's live Vanta export added 3 advisory IDs on `mastra-ai/mastra`
(GitHub/Dependabot). This PR fixes the two that have a published fix and
leaves deepmerge, which has none.

| Package | From → To | Finding | Where | How |
|---|---|---|---|---|
| qs | 6.16.0 → 6.16.1 | CVE-2026-110816 / GHSA-6pq8-jhm2-2vcw (Medium
×4) | root `pnpm-lock.yaml`, 9 `e2e-tests/*` lockfiles,
`scripts/gh-issue-triage/package-lock.json` | Raised the existing floors
`qs@>=6.7.0 <6.16.0: 6.16.0` → `<6.16.1: 6.16.1` and `'qs@<6.7.0':
6.16.0` → `6.16.1`. Raised the npm override in gh-issue-triage. |
| @modelcontextprotocol/node | 2.0.0 → 2.1.1 | GHSA-f897-62hf-6gxq (High
×2; HTTP transports had no body-size or batch-length limit) | root
`pnpm-lock.yaml` (published `@mastra/mcp` 1.18.0, used as `mcp-legacy`),
`scripts/gh-issue-triage/package-lock.json` | New pnpm override
`'@modelcontextprotocol/node@>=2.0.0 <2.1.0': 2.1.1` and a new npm
override in gh-issue-triage. I used 2.1.1 rather than 2.1.2 because
2.1.2 needs a `@modelcontextprotocol/server` peer of `^2.4.0`, while
`@mastra/mcp` 1.18 resolves server 2.3.1. `packages/mcp` itself already
uses node 2.1.2. |

- Both versions are older than the 1-day `minimumReleaseAge`: qs 6.16.1
was published 10-14 and node 2.1.1 on 10-02. I did not use qs 6.16.2
(10-27), which is too new.
- No floors or overrides were removed; existing ones were only raised.
- `pnpm install --frozen-lockfile --lockfile-only` passes at the root.
Each nested e2e workspace was regenerated with `pnpm install
--lockfile-only`.
- Added the empty changeset
`.changeset/vanta-2026-10-28-security-floors.md`. No published package
changes.
- After this change, osv-scanner over all 33 lockfiles reports only the
documented leftovers:
  - zod 3.25.76 (zod v3 compat line on purpose)
  - ai 4.3.19 / `@ai-sdk/provider-utils` 2.2.8 (vendored v4 line)
- `@azure/msal-node` 5.6.0 / 6.0.1 (fix 7.1.0 needs majors in identity
and teams)
  - `@opentelemetry/core` 1.30.1 (needs pubsub 6)
  - extract-zip 2.0.1 (no patched release)
- deepmerge 4.3.1 (CVE-2026-93753 / GHSA-gcqx-w48m-w2h4; no patched
release, 4.3.1 is the latest)


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

## ELI5

This PR updates dependency rules and package versions to use newer
releases, including security fixes for `qs` and
`@modelcontextprotocol/node`. It also updates AI SDK dependencies and
does not include published package changes.

## Summary

- Raise the `qs` override target to `6.16.1` in the root and e2e
workspaces and in `scripts/gh-issue-triage`.
- Add an `@modelcontextprotocol/node` override at `2.1.1` in the root
workspace and `scripts/gh-issue-triage`.
- Update AI SDK dependency versions across package manifests and add a
changeset describing the provider-utils update.
- Add an empty changeset for the security-only dependency updates.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

## Update 2026-10-28 (afternoon)
- Merged origin/main (clean).
- Bumped the AI SDK v5 compat line from @ai-sdk/provider-utils 3.0.41 to
3.0.42 (patch, published 2026-10-21; it blocks `.internal` hostnames in
download URL validation and encodes provider-returned IDs in request
paths). This addresses the Aikido /mastra Highs AIKIDO-2026-10990 and
AIKIDO-2026-10981:
- ai 5.0.277 → 5.0.282, @ai-sdk/gateway 2.0.168 → 2.0.173 (vendored
ai_v5)
- anthropic 2.0.109 → 2.0.110, google 2.0.103 → 2.0.106, groq 2.0.58 →
2.0.59, openai 2.0.135 → 2.0.137, openai-compatible 1.0.58 → 1.0.59, xai
2.0.99 → 2.0.100
- Nested lockfiles updated: memory/integration-tests and
playground/e2e/kitchen-sink.
- No new overrides. Changeset:
`vanta-2026-10-28-ai-sdk-v5-provider-utils.md`.
2026-10-28 18:51:27 -04:00
dane-ai-mastra[bot]
6a191d46dc chore: version - exit prerelease mode 2026-10-28 13:15:52 +00:00
dane-ai-mastra[bot]
2c646b53d0
chore: version packages (alpha) (#28399)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.

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

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

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

# Releases

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

## @mastra/factory@0.25.0-alpha.5


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


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


## @mastra/core@1.80.0-alpha.4


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


## @mastra/acp@0.4.4-alpha.0


## @mastra/claude@0.3.4-alpha.0


## @mastra/cursor@0.3.4-alpha.0


## @mastra/openai@1.1.4-alpha.0


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


## @mastra/auth-better-auth@1.1.9-alpha.0


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


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


## @mastra/auth-firebase@1.1.5-alpha.0


## @mastra/auth-google@0.1.7-alpha.0


## @mastra/auth-neon@0.3.5-alpha.0


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


## @mastra/auth-studio@1.3.11-alpha.1


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


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


## @mastra/agent-browser@0.5.5-alpha.0


## @mastra/browser-viewer@0.2.6-alpha.0


## @mastra/browser-firecrawl@0.2.5-alpha.1


## @mastra/stagehand@0.3.7-alpha.1


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


## @mastra/slack@1.8.0-alpha.1


## @mastra/teams@0.1.3-alpha.0


## @mastra/telegram@0.2.4-alpha.0


## @mastra/client-js@1.57.0-alpha.4


## @mastra/react@1.13.0-alpha.4


## @mastra/isolated-vm@0.1.4-alpha.0


## @mastra/quickjs@0.1.5-alpha.0


## @mastra/deployer-cloud@1.80.0-alpha.4


## @mastra/deployer-cloudflare@1.2.39-alpha.1


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


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


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


## @mastra/voyageai@0.4.3-alpha.0


## @mastra/longmemeval@1.1.39-alpha.4


## @mastra/livekit@0.5.2-alpha.0


## @mastra/opencode@0.1.39-alpha.4


## @mastra/parallel@0.1.4-alpha.0


## create-factory@0.3.1-alpha.4


## @mastra/code-sdk@1.15.1-alpha.5


## mastracode@0.48.1-alpha.4


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


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


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


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


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


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


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


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


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


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


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


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


## @mastra/agent-builder@1.1.31-alpha.2


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


## mastra@1.36.0-alpha.4


## @mastra/codemod@1.1.8-alpha.0


## create-mastra@1.36.0-alpha.4


## @mastra/deployer@1.80.0-alpha.4


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


## @mastra/evals@1.10.9-alpha.0


## @mastra/fastembed@1.3.5-alpha.2


## @mastra/loggers@1.3.10-alpha.1


## @mastra/mcp@2.6.0-alpha.1


## @mastra/mcp-docs-server@1.3.10-alpha.7


## @mastra/mcp-registry-registry@1.1.7-alpha.0


## @mastra/memory@1.39.1-alpha.2


## @mastra/rag@2.7.1-alpha.0


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


## @mastra/server@1.80.0-alpha.4


## @mastra/google-cloud-pubsub@1.1.5-alpha.1


## @mastra/redis-streams@0.6.5-alpha.1


## @mastra/valkey-streams@0.5.7-alpha.1


## @mastra/elysia@0.1.20-alpha.4


## @mastra/express@1.5.24-alpha.4


## @mastra/fastify@1.5.24-alpha.4


## @mastra/hono@1.7.22-alpha.4


## @mastra/koa@1.7.24-alpha.4


## @mastra/nestjs@0.2.39-alpha.4


## @mastra/next@0.2.38-alpha.4


## @mastra/server-adapters-test-suite@0.1.4-alpha.2


## @mastra/tanstack-start@0.2.38-alpha.4


## @mastra/astra@1.1.3-alpha.0


## @mastra/azure-ai-search@0.1.2-alpha.1


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


## @mastra/clickhouse@1.27.0-alpha.1


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


## @mastra/cloudflare-d1@1.4.5-alpha.1


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


## @mastra/couchbase@1.1.4-alpha.1


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


## @mastra/duckdb@1.16.0-alpha.1


## @mastra/dynamodb@1.4.5-alpha.1


## @mastra/elasticsearch@1.4.6-alpha.1


## @mastra/lance@1.5.2-alpha.1


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


## @mastra/mongodb@1.24.1-alpha.1


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


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


## @mastra/opensearch@1.1.4-alpha.1


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


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


## @mastra/pinecone@1.1.3-alpha.0


## @mastra/qdrant@1.1.6-alpha.0


## @mastra/redis@1.4.12-alpha.1


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


## @mastra/spanner@1.10.1-alpha.1


## @mastra/turbopuffer@1.2.3-alpha.0


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


## @mastra/upstash@1.5.5-alpha.1


## @mastra/valkey@0.2.8-alpha.1


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


## @mastra/weaviate@0.1.4-alpha.0


## @mastra/voice-aws-nova-sonic@0.2.6-alpha.0


## @mastra/voice-azure@0.12.3-alpha.0


## @mastra/voice-cloudflare@0.13.4-alpha.0


## @mastra/voice-deepgram@0.13.3-alpha.0


## @mastra/voice-elevenlabs@0.13.3-alpha.0


## @mastra/voice-gladia@0.13.3-alpha.0


## @mastra/voice-google@0.14.4-alpha.0


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


## @mastra/voice-inworld@0.4.6-alpha.0


## @mastra/voice-mistral@0.1.3-alpha.0


## @mastra/voice-modelslab@0.2.3-alpha.0


## @mastra/voice-murf@0.13.3-alpha.0


## @mastra/voice-openai@0.13.4-alpha.0


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


## @mastra/voice-playai@0.13.3-alpha.0


## @mastra/voice-sarvam@1.1.4-alpha.0


## @mastra/voice-speechify@0.14.3-alpha.0


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


## @mastra/inngest@1.10.8-alpha.3


## @mastra/temporal@0.4.18-alpha.4


## @mastra/agentcore@0.5.3-alpha.0


## @mastra/agentfs@0.2.3-alpha.0


## @mastra/apple-container@0.5.2-alpha.0


## @mastra/archil@0.3.2-alpha.0


## @mastra/azure@0.3.3-alpha.1


## @mastra/blaxel@0.10.2-alpha.0


## @mastra/cloudflare-sandbox@0.5.4-alpha.0


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


## @mastra/docker@0.12.1-alpha.0


## @mastra/e2b@0.15.1-alpha.1


## @mastra/e2b-desktop@0.1.10-alpha.1


## @mastra/files-sdk@0.3.3-alpha.0


## @mastra/gcs@0.3.5-alpha.1


## @mastra/google-drive@0.2.4-alpha.0


## @mastra/mesa@0.3.3-alpha.0


## @mastra/modal@0.7.3-alpha.0


## @mastra/platform-workspace@1.10.0-alpha.1


## @mastra/railway@0.10.2-alpha.1


## @mastra/s3@0.6.5-alpha.1


## @mastra/sprites@0.1.2-alpha.0


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


## @internal/playground@1.36.0-alpha.4

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-26 13:49:15 -07:00
Ward Peeters
ce5d4731ee
chore(deps): update dependencies across the monorepo (#28417)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-26 16:59:30 +01:00
dane-ai-mastra[bot]
dacb190944
chore: version packages (alpha) (#28009)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-23 13:57:18 +02:00
Dane - AI (Mastra)
40a522c142
chore(deps): update build tools (#27997) 2026-10-22 14:33:21 +02: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[bot]
4c22623ea3 chore: version - exit prerelease mode 2026-10-21 11:26:39 +00:00
Dane - AI (Mastra)
dbde4bf36a
chore(deps): update ai sdk (#27728)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-10-19 19:04:28 -07:00
dane-ai-mastra[bot]
03e4a73b78
chore: version packages (alpha) (#27375) 2026-10-19 20:45:49 +02:00
Max Katz
fe048f7950
chore(lint): require import type for type-only imports (#27642)
Lint now requires `import type` for imports used only as types, as
`oxlint.config.ts` always intended. The two rules have matched no files
since mastra-ai/mastra#20173 broke their override's glob, so the repo
drifted into mixing `import { type X }`, `import { X }` for types, and
`import type`. This turns them back on and fixes the existing imports.
No runtime behavior changes.

## What changed

- `import/consistent-type-specifier-style` and
`typescript/consistent-type-imports` go from `off` to `error`.
- 186 files: type-only imports become `import type { … }`, split from
value imports where a statement had both. Done with `oxlint --fix` plus
6 files the fixer left with inline `type` specifiers, then `oxfmt`.
- `disallowTypeAnnotations` is now `false`: `typeof import('x')` is
already type-only, and 97 of its 112 uses are the
`vi.importActual<typeof import('./x')>()` pattern in tests.

## Could this change behavior?

Only where a package keeps imports at runtime (`verbatimModuleSyntax`,
via `tsconfig.node.json`) and a statement became fully `import type`,
since that drops the module load. That happens in 18 places: 11 in
tests, and in source `GithubAppIdentity` (factory), `Workspace`,
`SpanType`, `Knowledge` and `WORKSPACE_TOOLS` (core), `Observable` from
`rxjs` (nestjs), and `zod` / `@mastra/mcp` in the server adapter test
suite. None of those modules run code at load time.

## Scope

The other rules the broken glob turned off (`no-unused-vars`,
`no-console`/`no-debugger`, `ban-ts-comment`, `no-require-imports`, the
test-file import ban) stay off for their own PRs.

## Testing

1. `pnpm lint`: passes (the 13 `only-export-components` warnings are
already on `main`).
2. `pnpm turbo build` for the 34 changed packages and `typecheck` for
the ones that have it: pass.
3. The test files that lost a runtime import: pass (core, server,
observability, factory, voice).
2026-10-19 17:35:21 +04:00
Abhi Aiyer
d358bd9d09
fix(redis-streams, valkey-streams): keep redelivered events within maxStreamLength (#25671)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-10-18 11:28:09 -07:00
Max Katz
9a423dae48
refactor(lint): replace ESLint with type-aware oxlint (#27476) 2026-10-18 10:38:35 -07:00
dane-ai-mastra[bot]
a15924e709 chore: version packages 2026-10-16 04:04:12 +00:00
dane-ai-mastra[bot]
81299c921d chore: version - exit prerelease mode 2026-10-11 16:59:51 +00:00
dane-ai-mastra[bot]
ebe143c491 chore: version packages 2026-10-11 04:07:49 +00:00
mastra-platform[bot]
f3edeffe23
fix(valkey-streams): enable TLS for rediss:// and valkeys:// URLs (#26630) 2026-10-10 14:38:32 -07:00
dane-ai-mastra[bot]
b10b70fd77 chore: version - exit prerelease mode 2026-10-07 08:40:03 +00:00
dane-ai-mastra[bot]
9fc60a1748 chore: version packages 2026-10-06 16:05:56 +00:00
mastra-platform[bot]
290c8ea42b
fix(redis-streams,valkey-streams): share one reader per fan-out topic (#25963) 2026-10-06 07:55:59 -07:00
dane-ai-mastra[bot]
8b35a6c1d6 chore: version - exit prerelease mode 2026-10-01 08:22:20 +00:00
dane-ai-mastra[bot]
b782191b6c chore: version packages 2026-09-30 16:07:15 +00:00
mastra-platform[bot]
279d4a7acb
fix(core): prevent long evented workflow steps from running twice on broker redelivery (#24769)
> Opened by @abhiaiyer91

Fixes #24589

## Problem
Evented workflow events are acked only after the handler finishes. If a
step takes longer than the broker's visibility/idle deadline (for
example, Redis/Valkey `reclaimIdleMs`), the broker redelivers the
`workflow.step.run` event to another worker, and the step runs twice at
the same time.

## Changes
- **Heartbeat contract**: `EventCallback` gets an optional 4th
`extend()` argument. `OrchestrationWorker` calls it on an interval
(`leaseRenewIntervalMs`, default 10s) while it handles an event, and
clears the interval when the handler finishes.
- **Step fence**: `WorkflowEventProcessor` claims a `LeaseProvider`
lease for each `workflow.step.run` event and renews it while the step
runs. If another delivery of the same event arrives while the lease is
held, it is acked and dropped. On failure the lease is released so a
retry can run. Backends without lease support keep their current
behavior.
- **Redis/Valkey Streams**: implement `extend` with `XCLAIM … JUSTID` to
reset the entry's idle time. It also pushes back the local
`inFlightTimeoutMs` deadline.
- GCP Pub/Sub needs no change because its client extends ack deadlines
automatically.

Steps should still be idempotent. A worker crash can still cause a step
to run again.

## Test plan
- New `step-run-fence.test.ts`: a redelivery that arrives while a slow
step is running is dropped; the lease is released on failure.
- New `worker.test.ts` case: the worker calls `extend` repeatedly during
a long handler, acks once, and stops the timer afterward.
- New Redis reclaim integration test: a sibling consumer does not
reclaim an entry whose handler keeps extending it.
- core `src/worker` + `src/workflows/evented`: 387 passed. redis-streams
`reclaim` + `pubsub`: 50 passed.

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

If a workflow step takes a long time, the message that started it can
expire and be sent to another worker. This change keeps the message
active and uses a lease to prevent another worker from running the same
step at the same time.

## Summary

- Adds an optional `extend` callback to event handlers and passes it
through the pull transport.
- Renews supported event-delivery leases while `OrchestrationWorker`
processes an event. The interval defaults to 10 seconds and must be
positive and finite when configured.
- Fences identified `workflow.step.run` events with a lease keyed by run
ID and event ID. A duplicate with an active lease is acknowledged
without running; failed runs release the lease so a retry can proceed.
- Adds ownership-checked Redis Streams and Valkey Streams heartbeats.
These refresh the pending entry’s idle time only while the current
consumer still owns it.
- Adds tests for worker heartbeats, step-run fencing, and Redis Streams
heartbeat behavior.

Backends without lease support do not receive delivery heartbeats, and
lease-acquisition errors fall back to running the step without a fence.
A worker crash can still lead to a rerun, so steps should remain
idempotent. Test results were not provided.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-09-30 15:24:52 +01:00
Ward Peeters
bc826e8fb1
refactor: use Web Crypto where synchronous contracts stay intact (#25462)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-09-30 09:45:11 +02:00
dane-ai-mastra[bot]
871bdaa595 chore: version - exit prerelease mode 2026-09-15 09:04:59 +00:00
dane-ai-mastra[bot]
1ae5f46bc1 chore: version packages 2026-09-12 04:04:52 +00:00
Abhi Aiyer
f676631093
fix(valkey-streams): stop reclaim loop redelivering in-flight messages; add inFlightTimeoutMs (#23697)
Co-authored-by: Mastra Code (anthropic/claude-fable-5-1) <noreply@mastra.ai>
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
2026-09-11 18:56:16 -07:00
mastra-platform[bot]
617c1b30e7
fix(core): drain in-flight evented workflow runs before shutdown tears down pubsub (#23168)
Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>
Co-authored-by: Mastra Code (anthropic/claude-fable-5-1) <noreply@mastra.ai>
2026-09-11 17:06:56 -07:00
dane-ai-mastra[bot]
c19a93b095 chore: version - exit prerelease mode 2026-09-03 04:02:53 +00:00
dane-ai-mastra[bot]
e6de774069 chore: version packages 2026-09-02 16:20:22 +00:00
Lennart
e983f74987
chore(*): Update/unify/add READMEs (#22858)
Co-authored-by: Mastra Code (openai/gpt-5.6-sol) <noreply@mastra.ai>
2026-09-02 14:36:59 +02:00
dane-ai-mastra[bot]
fc968c8a9b chore: version packages 2026-09-01 16:28:50 +00:00
Lennart
28ce924276
chore(*): Remove CHANGELOG.md from npm files (#22737) 2026-09-01 10:47:20 +02:00
dane-ai-mastra[bot]
3cd96a3c5a chore: version - exit prerelease mode 2026-08-26 10:43:02 +00:00
dane-ai-mastra[bot]
6eb8bd3513
chore: version packages (alpha) (#22100)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-24 13:08:00 -07:00
Damien Schneider
069a6d6396
fix(ci): give valkey-streams its own vitest project name (#22237) 2026-08-24 12:09:25 -07:00
mastra-platform[bot]
53962e4bf3
Add first-class Valkey storage and PubSub integrations (#22176)
Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>
Co-authored-by: Mastra Code (openai/gpt-5.6-sol) <noreply@mastra.ai>
2026-08-24 09:52:43 -07:00