@mastra/core@1.27.0
mastra-ai/mastra@mastra/core@1.27.0Apr 24, 2026by PaulieScanlon
AI Summary
Adds CLI-driven browser automation with screencast support, enables S3 prefix mounting for workspace providers, and fixes workflow resume bugs and observational memory conflicts.
Key Highlights
- CLI-Driven Browser Automation + Screencasts with @mastra/browser-viewer.
- S3 'Prefix Mounts' to expose specific subdirectories within a bucket.
- Fixes parallel foreach iterations losing suspendPayload during resume.
- Temporal markers for Observational Memory to handle time gaps.
- New @mastra/tavily package for search tools.
New Features
- BrowserViewer and BrowserCliHandler for Playwright automation.
- @mastra/tavily tools (search, extract, crawl, map).
- Temporal gap markers for observability.
- S3 prefix mount support in workspace packages.
- Fix for savePerStep and observational memory conflicts.
Full Release Notes
## Highlights
### CLI-Driven Browser Automation + Screencasts
`@mastra/core` and the new `@mastra/browser-viewer` package add end-to-end browser automation for CLI-based agent workflows. `BrowserViewer` launches Chrome via Playwright with remote debugging, and a new `BrowserCliHandler` automatically detects browser CLIs (`agent-browser`, `browser-use`, `browse`) and injects the CDP URL into commands — no manual wiring needed. Browser sessions are thread-isolated with automatic lifecycle management, and live screencasts stream directly to Studio. External CDP endpoints (e.g. browser-use cloud) are also supported: the system detects them, skips injection, and connects for screencast.
### S3 “Prefix Mounts” Across Workspace Providers
Workspace packages (`@mastra/s3`, `@mastra/daytona`, `@mastra/e2b`, and `@mastra/blaxel`) now support mounting an S3 subdirectory via a `prefix` option, so sandboxes can expose only a folder within a bucket instead of the entire bucket.
### More Robust Workflow Resumes for Parallel `foreach`
Fixes a workflow snapshot/resume bug where parallel `foreach` iterations could lose their `suspendPayload` when a sibling iteration resumed—important for HITL/tool-approval flows that rely on preserved per-iteration stream state.
### Observational Memory Improvements (Temporal Markers + Correctness Fixes)
Adds opt-in temporal-gap markers (`observationalMemory.temporalMarkers: true`) to inject persisted `<system-reminder type="temporal-gap">` when users return after 10+ minutes, and fixes duplication/conflicts by force-disabling `savePerStep` when observational memory is enabled.
### New Package: `@mastra/tavily`
New integration package wrapping `@tavily/core` as first-class Mastra tools — `createTavilySearchTool`, `createTavilyExtractTool`, `createTavilyCrawlTool`, and `createTavilyMapTool` — with full Zod input/output schemas, lazy client initialization, and a convenience `createTavilyTools()` that returns all four with shared config. API key resolves from config or `TAVILY_API_KEY` env var.
### Breaking Changes
- None noted in this changelog.
## Changelog
### [@mastra/core@1.27.0](https://github.com/mastra-ai/mastra/blob/@mastra/core@1.27.0//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/packages/core/CHANGELOG.md)
#### Minor Changes
- Added support for CLI-driven browser automation with screencast support in `@mastra/core`, including automatic CDP injection for browser CLIs. ([#15415](https://github.com/mastra-ai/mastra/pull/15415))
Fixed local process spawning so workspace-relative `cwd` values no longer get duplicated.
#### Patch Changes
- Update provider registry and model documentation with latest models and providers ([`f112db1`](https://github.com/mastra-ai/mastra/commit/f112db179557ae9b5a0f1d25dc47f928d7d61cd9))
- Fixed `foreach` parallel iterations losing their `suspendPayload` when a sibling iteration was resumed. Previously, every result entry written back to the workflow snapshot had its `suspendPayload` cleared, so iterations that were still suspended (e.g. parallel tool-call approvals each carrying an agent's `__streamState`) lost the context they needed to resume correctly. Suspended iterations now retain their `suspendPayload` across resume cycles; completed iterations still have it cleared to keep snapshots small. ([#15551](https://github.com/mastra-ai/mastra/pull/15551))
```ts
const approvalWorkflow = createWorkflow({ id: "approve" }).foreach(approveToolStep, { concurrency: 5 }).commit();
// Before: resuming the first approval wiped streamState on the others,
// so subsequent resumes lost conversation context.
// After: each suspended iteration keeps its suspendPayload (including
// streamState) until it is individually resumed.
```
- Fixed interaction between savePerStep and observational memory that caused message duplication. The saveStepMessages method redundantly re-added response messages to the message list on every step, duplicating them. Additionally, savePerStep is now force-disabled when observational memory is enabled, since OM handles its own per-step persistence and the two features conflict. ([#15652](https://github.com/mastra-ai/mastra/pull/15652))
- Added opt-in temporal-gap markers for observational memory. When enabled via `observationalMemory.temporalMarkers: true`, the agent receives a `<system-reminder type="temporal-gap">` before any user message that arrives more than 10 minutes after the previous one, so it can anchor responses in real elapsed time. Markers are persisted, surfaced to the observer, and rendered by the MastraCode TUI on reload. ([#15605](https://github.com/mastra-ai/mastra/pull/15605))
### [@mastra/agent-builder@1.0.28](https://github.com/mastra-ai/mastra/blob/@mastra/agent-builder@1.0.28//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/packages/agent-builder/CHANGELOG.md)
#### Patch Changes
- Hide internal log during `mastra dev` startup (that was previously already hidden but got exposed again by a recent change) ([#15616](https://github.com/mastra-ai/mastra/pull/15616))
### [@mastra/blaxel@0.3.0](https://github.com/mastra-ai/mastra/blob/@mastra/blaxel@0.3.0//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/workspaces/blaxel/CHANGELOG.md)
#### Minor Changes
- Added S3 prefix (subdirectory) mount support. You can now mount a specific folder within an S3 bucket instead of the entire bucket by setting the `prefix` option on your S3 filesystem. ([#15171](https://github.com/mastra-ai/mastra/pull/15171))
**Example:**
```typescript
const fs = new S3Filesystem({
bucket: "my-bucket",
region: "us-east-1",
prefix: "workspace/data",
accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!
});
```
When mounted in a sandbox, only the contents under `workspace/data/` in the bucket will be visible at the mount path. This uses the s3fs `bucket:/path` syntax under the hood.
Closes #15147.
#### Patch Changes
### [@mastra/browser-viewer@0.1.0](https://github.com/mastra-ai/mastra/blob/@mastra/browser-viewer@0.1.0//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/browser/browser-viewer/CHANGELOG.md)
#### Minor Changes
- Initial release of @mastra/browser-viewer ([#15415](https://github.com/mastra-ai/mastra/pull/15415))
Playwright-based browser viewer for CLI providers that enables screencast visualization in Studio. Supports thread-isolated browser sessions and automatic CDP connection management.
```typescript
import { BrowserViewer } from "@mastra/browser-viewer";
const workspace = new Workspace({
sandbox: new LocalSandbox({ cwd: "./workspace" }),
browser: new BrowserViewer({
cli: "agent-browser",
headless: false
})
});
```
#### Patch Changes
### [@mastra/clickhouse@1.5.1](https://github.com/mastra-ai/mastra/blob/@mastra/clickhouse@1.5.1//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/stores/clickhouse/CHANGELOG.md)
#### Patch Changes
- Fixed `mastra dev` repeatedly reporting `MIGRATION REQUIRED` on ClickHouse Cloud after `mastra migrate` had already run successfully. The observability migration check now recognizes the engine-name variants that ClickHouse Cloud and replicated clusters use in place of `ReplacingMergeTree`. ([#15623](https://github.com/mastra-ai/mastra/pull/15623))
- Improved ClickHouse v-next observability initialization errors to include the underlying ClickHouse message in the standard error text. This makes init failures actionable in loggers that only print `error.message`. ([#15588](https://github.com/mastra-ai/mastra/pull/15588))
### [@mastra/daytona@0.3.0](https://github.com/mastra-ai/mastra/blob/@mastra/daytona@0.3.0//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/workspaces/daytona/CHANGELOG.md)
#### Minor Changes
- Added S3 prefix (subdirectory) mount support. You can now mount a specific folder within an S3 bucket instead of the entire bucket by setting the `prefix` option on your S3 filesystem. ([#15171](https://github.com/mastra-ai/mastra/pull/15171))
**Example:**
```typescript
const fs = new S3Filesystem({
bucket: "my-bucket",
region: "us-east-1",
prefix: "workspace/data",
accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!
});
```
When mounted in a sandbox, only the contents under `workspace/data/` in the bucket will be visible at the mount path. This uses the s3fs `bucket:/path` syntax under the hood.
Closes #15147.
#### Patch Changes
### [@mastra/e2b@0.2.0](https://github.com/mastra-ai/mastra/blob/@mastra/e2b@0.2.0//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/workspaces/e2b/CHANGELOG.md)
#### Minor Changes
- Added S3 prefix (subdirectory) mount support. You can now mount a specific folder within an S3 bucket instead of the entire bucket by setting the `prefix` option on your S3 filesystem. ([#15171](https://github.com/mastra-ai/mastra/pull/15171))
**Example:**
```typescript
const fs = new S3Filesystem({
bucket: "my-bucket",
region: "us-east-1",
prefix: "workspace/data",
accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!
});
```
When mounted in a sandbox, only the contents under `workspace/data/` in the bucket will be visible at the mount path. This uses the s3fs `bucket:/path` syntax under the hood.
Closes #15147.
#### Patch Changes
### [@mastra/fastify@1.3.11](https://github.com/mastra-ai/mastra/blob/@mastra/fastify@1.3.11//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/server-adapters/fastify/CHANGELOG.md)
#### Patch Changes
- Fix custom route handlers on the Fastify adapter silently overwriting request-body fields named `tools` (e.g. `POST /stored/agents`, `POST /stored/workspaces`). The adapter now exposes registered tools as `registeredTools` in handler params, matching the Express and Hono adapters and the `@mastra/server` handler contract. ([#15635](https://github.com/mastra-ai/mastra/pull/15635))
### [@mastra/memory@1.17.0](https://github.com/mastra-ai/mastra/blob/@mastra/memory@1.17.0//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/packages/memory/CHANGELOG.md)
#### Minor Changes
- Added opt-in temporal-gap markers for observational memory. When enabled via `observationalMemory.temporalMarkers: true`, the agent receives a `<system-reminder type="temporal-gap">` before any user message that arrives more than 10 minutes after the previous one, so it can anchor responses in real elapsed time. Markers are persisted, surfaced to the observer, and rendered by the MastraCode TUI on reload. ([#15605](https://github.com/mastra-ai/mastra/pull/15605))
#### Patch Changes
- Fixed observer agent truncation that could cut UTF-16 surrogate pairs in half when formatting messages, tool results, or observation lines with emoji or other astral-plane characters. This produced lone surrogates that strict JSON parsers (including Anthropic's) reject with errors like `no low surrogate in string`, causing observer runs to fail. ([#15634](https://github.com/mastra-ai/mastra/pull/15634))
### [@mastra/s3@0.4.0](https://github.com/mastra-ai/mastra/blob/@mastra/s3@0.4.0//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/workspaces/s3/CHANGELOG.md)
#### Minor Changes
- Added S3 prefix (subdirectory) mount support. You can now mount a specific folder within an S3 bucket instead of the entire bucket by setting the `prefix` option on your S3 filesystem. ([#15171](https://github.com/mastra-ai/mastra/pull/15171))
**Example:**
```typescript
const fs = new S3Filesystem({
bucket: "my-bucket",
region: "us-east-1",
prefix: "workspace/data",
accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!
});
```
When mounted in a sandbox, only the contents under `workspace/data/` in the bucket will be visible at the mount path. This uses the s3fs `bucket:/path` syntax under the hood.
Closes #15147.
#### Patch Changes
### [@mastra/server@1.27.0](https://github.com/mastra-ai/mastra/blob/@mastra/server@1.27.0//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/packages/server/CHANGELOG.md)
#### Patch Changes
- Forward `requestContext` from the `/approve-tool-call`, `/decline-tool-call`, `/approve-tool-call-generate` and `/decline-tool-call-generate` REST handlers to `agent.approveToolCall(...)` / `declineToolCall(...)` / `approveToolCallGenerate(...)` / `declineToolCallGenerate(...)`. ([#15620](https://github.com/mastra-ai/mastra/pull/15620))
Previously `requestContext` was destructured from the handler arguments but never passed through. On resume, `dynamicInstructions` ran with `requestContext: undefined`, so any value placed on the per-request `RequestContext` by upstream middleware (or by `body.requestContext` auto-merge) was lost for the rest of the turn. Agents whose prompt assembly depends on request-scoped data (e.g. read-only state from the frontend) produced blank or placeholder responses after the user approved a HITL tool call. Other agent entry points (`stream`, `generate`) already forwarded `requestContext` correctly; this brings the approval routes in line.
- Fixed screencast panel staying "Live" after browser closes due to an error. The `ViewerRegistry` now broadcasts `browser_closed` status when a screencast stream emits an error, not just when it stops cleanly. ([#15415](https://github.com/mastra-ai/mastra/pull/15415))
### [@mastra/tavily@1.0.1](https://github.com/mastra-ai/mastra/blob/@mastra/tavily@1.0.1//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/integrations/tavily/CHANGELOG.md)
#### Patch Changes
- Fixed runtime `ERR_MODULE_NOT_FOUND` for `@tavily/core` by making it a direct dependency. Consumers no longer need to install `@tavily/core` manually. ([#15628](https://github.com/mastra-ai/mastra/pull/15628))
### Other updated packages
The following packages were updated with dependency changes only:
- [@mastra/client-js@1.14.1](https://github.com/mastra-ai/mastra/blob/@mastra/client-js@1.14.1//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/client-sdks/client-js/CHANGELOG.md)
- [@mastra/deployer@1.27.0](https://github.com/mastra-ai/mastra/blob/@mastra/deployer@1.27.0//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/packages/deployer/CHANGELOG.md)
- [@mastra/deployer-cloud@1.27.0](https://github.com/mastra-ai/mastra/blob/@mastra/deployer-cloud@1.27.0//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/deployers/cloud/CHANGELOG.md)
- [@mastra/deployer-cloudflare@1.1.25](https://github.com/mastra-ai/mastra/blob/@mastra/deployer-cloudflare@1.1.25//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/deployers/cloudflare/CHANGELOG.md)
- [@mastra/deployer-netlify@1.1.1](https://github.com/mastra-ai/mastra/blob/@mastra/deployer-netlify@1.1.1//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/deployers/netlify/CHANGELOG.md)
- [@mastra/deployer-vercel@1.1.19](https://github.com/mastra-ai/mastra/blob/@mastra/deployer-vercel@1.1.19//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/deployers/vercel/CHANGELOG.md)
- [@mastra/editor@0.7.18](https://github.com/mastra-ai/mastra/blob/@mastra/editor@0.7.18//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/packages/editor/CHANGELOG.md)
- [@mastra/express@1.3.11](https://github.com/mastra-ai/mastra/blob/@mastra/express@1.3.11//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/server-adapters/express/CHANGELOG.md)
- [@mastra/hono@1.4.6](https://github.com/mastra-ai/mastra/blob/@mastra/hono@1.4.6//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/server-adapters/hono/CHANGELOG.md)
- [@mastra/koa@1.4.11](https://github.com/mastra-ai/mastra/blob/@mastra/koa@1.4.11//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/server-adapters/koa/CHANGELOG.md)
- [@mastra/longmemeval@1.0.30](https://github.com/mastra-ai/mastra/blob/@mastra/longmemeval@1.0.30//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/explorations/longmemeval/CHANGELOG.md)
- [@mastra/mcp-docs-server@1.1.27](https://github.com/mastra-ai/mastra/blob/@mastra/mcp-docs-server@1.1.27//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/packages/mcp-docs-server/CHANGELOG.md)
- [@mastra/opencode@0.0.27](https://github.com/mastra-ai/mastra/blob/@mastra/opencode@0.0.27//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/integrations/opencode/CHANGELOG.md)
- [@mastra/playground-ui@23.0.1](https://github.com/mastra-ai/mastra/blob/@mastra/playground-ui@23.0.1//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/packages/playground-ui/CHANGELOG.md)
- [@mastra/react@0.2.28](https://github.com/mastra-ai/mastra/blob/@mastra/react@0.2.28//private/var/folders/d4/mn8gvlx91cz80s_9c4gjr12r0000gn/T/mastra-mastra-ai-mastra-_mastra_core_1.27.0/client-sdks/react/CHANGELOG.md)