github mastra-ai/mastra @mastra/core@1.8.0
February 26, 2026

7 hours ago

Highlights

Supervisor Pattern for Multi-Agent Coordination

A new supervisor pattern enables orchestrating multiple agents via stream() and generate(), with delegation hooks, iteration monitoring, completion scoring, memory isolation, tool approval propagation, context filtering, and a bail mechanism.

Metadata-Only Vector Queries (Optional queryVector)

Vector querying now supports metadata-only retrieval by making queryVector optional (with at least one of queryVector or filter required). @mastra/pg’s PgVector.query() explicitly supports filter-only queries, while other vector stores now throw a clear MastraError when metadata-only queries aren’t supported.

More Flexible Evaluations with runEvals Target Options

runEvals adds targetOptions to forward execution/run options into agent.generate() or workflow.run.start(), plus per-item startOptions for workflow-specific overrides (e.g., initialState) on each eval datum.

LSP Diagnostics After Workspace Edits

Workspace edit tools (write_file, edit_file, ast_edit) can now surface Language Server Protocol diagnostics immediately after edits (TypeScript, Python/Pyright, Go/gopls, Rust/rust-analyzer, ESLint), helping catch type/lint errors before the next tool call.

New Blaxel Cloud Sandbox Provider

@mastra/blaxel adds a Blaxel cloud sandbox provider, expanding deployment/runtime options for executing workspace tooling in a managed environment.

Breaking Changes

  • None noted in this changelog.

Changelog

@mastra/core@1.8.0

Minor Changes

  • Make queryVector optional in the QueryVectorParams interface to support metadata-only queries. At least one of queryVector or filter must be provided. Not all vector store backends support metadata-only queries — check your store's documentation for details. (#13286)

    Also fixes documentation where the query() parameter was incorrectly named vector instead of queryVector.

  • Added targetOptions parameter to runEvals that is forwarded directly to agent.generate() (modern path) or workflow.run.start(). Also added per-item startOptions field to RunEvalsDataItem for per-item workflow options like initialState. (#13366)

    New feature: targetOptions

    Pass agent execution options (e.g. maxSteps, modelSettings, instructions) through to agent.generate(), or workflow run options (e.g. perStep, outputOptions) through to workflow.run.start():

    // Agent - pass modelSettings or maxSteps
    await runEvals({
      data,
      scorers,
      target: myAgent,
      targetOptions: { maxSteps: 5, modelSettings: { temperature: 0 } },
    });
    
    // Workflow - pass run options
    await runEvals({
      data,
      scorers,
      target: myWorkflow,
      targetOptions: { perStep: true },
    });

    New feature: per-item startOptions

    Supply per-item workflow options (e.g. initialState) directly on each data item:

    await runEvals({
      data: [
        { input: { query: 'hello' }, startOptions: { initialState: { counter: 1 } } },
        { input: { query: 'world' }, startOptions: { initialState: { counter: 2 } } },
      ],
      scorers,
      target: myWorkflow,
    });

    Per-item startOptions take precedence over global targetOptions for the same key. Runeval-managed options (scorers, returnScorerData, requestContext) cannot be overridden via targetOptions.

  • Add supervisor pattern for multi-agent coordination using stream() and generate(). Includes delegation hooks, iteration monitoring, completion scoring, memory isolation, tool approval propagation, context filtering, and bail mechanism. (#13323)

  • Add LSP diagnostics to workspace edit tools (#13441)

    Language Server Protocol (LSP) diagnostics now appear after edits made with write_file, edit_file, and ast_edit.
    Seeing type and lint errors immediately helps catch issues before the next tool call.
    Edits still work without diagnostics when language servers are not installed.

    Supports TypeScript, Python (Pyright), Go (gopls), Rust (rust-analyzer), and ESLint.

    Example

    Before:

    const workspace = new Workspace({ sandbox, filesystem });

    After:

    const workspace = new Workspace({ sandbox, filesystem, lsp: true });

Patch Changes

  • Propagate tripwire's that are thrown from a nested workflow. (#13502)

  • Added isProviderDefinedTool helper to detect provider-defined AI SDK tools (e.g. google.tools.googleSearch(), openai.tools.webSearch()) for proper schema handling during serialization. (#13507)

  • Fixed ModelRouterEmbeddingModel.doEmbed() crashing with TypeError: result.warnings is not iterable when used with AI SDK v6's embedMany. The result now always includes a warnings array, ensuring forward compatibility across AI SDK versions. (#13369)

  • Fixed build error in ModelRouterEmbeddingModel.doEmbed() caused by warnings not existing on the return type. (#13461)

  • Fixed Harness.createThread() defaulting the thread title to "New Thread" which prevented generateTitle from working (see #13391). Threads created without an explicit title now have an empty string title, allowing the agent's title generation to produce a title from the first user message. (#13393)

  • Prevent unknown model IDs from being sorted to the front in reorderModels(). Models not present in the modelIds parameter are now moved to the end of the array. Fixes #13410. (#13445)

  • Include traceId on scores generated during experiment runs to restore traceability of experiment results (#13464)

  • Fixed skill-read-reference (and getReference, getScript, getAsset in WorkspaceSkillsImpl) to resolve file paths relative to the skill root instead of hardcoded subdirectories (references/, scripts/, assets/). (#13363)

    Previously, calling skill-read-reference with referencePath: "docs/schema.md" would silently fail because it resolved to <skill>/references/docs/schema.md instead of <skill>/docs/schema.md. Now all paths like references/colors.md, docs/schema.md, and ./config.json resolve correctly relative to the skill root. Path traversal attacks (e.g. ../../etc/passwd) are still blocked.

  • Fixed workspace listing to show whether each workspace is global or agent-owned. (#13468)
    Agent-owned workspaces now include the owning agent's ID and name so clients can distinguish them from global workspaces.

  • Fixed Observational Memory not working with AI SDK v4 models (legacy path). The legacy stream/generate path now calls processInputStep, enabling processors like Observational Memory to inject conversation history and observations. (#13358)

  • Added resolveWorkspace() so callers can access a dynamic workspace before the first request. (#13457)

  • Fixed abortSignal not stopping LLM generation or preventing memory persistence. When aborting a stream (e.g., client disconnect), the LLM response no longer continues processing in the background and partial/full responses are no longer saved to memory. Fixes #13117. (#13206)

  • Fixed observation activation to always preserve a minimum amount of context. Previously, swapping buffered observation chunks could unexpectedly drop the context window to near-zero tokens. (#13476)

  • Fixed a crash where the Node.js process would terminate with an unhandled TypeError when an LLM stream encountered an error. The ReadableStreamDefaultController would throw "Controller is already closed" when chunks were enqueued after a downstream consumer cancelled or terminated the stream. All controller.enqueue(), controller.close(), and controller.error() calls now check if the controller is still open before attempting operations. (#13107) (#13206)

  • Updated dependencies [8d14a59]:

    • @mastra/schema-compat@1.1.3

@mastra/agent-builder@1.0.8

Patch Changes

@mastra/ai-sdk@1.1.0

Minor Changes

  • Update peer dependencies to match core package version bump (1.5.0) (#13323)

Patch Changes

@mastra/astra@1.0.1

Patch Changes

@mastra/blaxel@0.0.2

Patch Changes

@mastra/chroma@1.0.1

Patch Changes

@mastra/client-js@1.7.1

Patch Changes

@mastra/convex@1.0.4

Patch Changes

@mastra/couchbase@1.0.1

Patch Changes

@mastra/deployer@1.8.0

Patch Changes

@mastra/deployer-cloud@1.8.0

Patch Changes

@mastra/deployer-cloudflare@1.1.5

Patch Changes

@mastra/deployer-netlify@1.0.9

Patch Changes

@mastra/deployer-vercel@1.0.9

Patch Changes

@mastra/duckdb@1.0.1

Patch Changes

@mastra/elasticsearch@1.1.1

Patch Changes

@mastra/express@1.1.7

Patch Changes

@mastra/fastify@1.1.7

Patch Changes

@mastra/hono@1.1.7

Patch Changes

@mastra/koa@1.2.3

Patch Changes

@mastra/lance@1.0.2

Patch Changes

@mastra/libsql@1.6.2

Patch Changes

  • Fixed observation activation to always preserve a minimum amount of context. Previously, swapping buffered observation chunks could unexpectedly drop the context window to near-zero tokens. (#13476)

  • Add a clear runtime error when queryVector is omitted for vector stores that require a vector for queries. Previously, omitting queryVector would produce confusing SDK-level errors; now each store throws a structured MastraError with ErrorCategory.USER explaining that metadata-only queries are not supported by that backend. (#13286)

  • Updated dependencies [df170fd, ae55343, c290cec, f03e794, aa4a5ae, de3f584, d3fb010, 702ee1c, f495051, e622f1d, 861f111, 00f43e8, 1b6f651, 96a1702, cb9f921, 114e7c1, 1b6f651, 72df4a8]:

    • @mastra/core@1.8.0

@mastra/longmemeval@1.0.9

Patch Changes

@mastra/mcp@1.0.2

Patch Changes

@mastra/mcp-docs-server@1.1.6

Patch Changes

@mastra/memory@1.5.2

Patch Changes

  • Fixed observational memory buffering to preserve more context and activate at the right time. (#13476)

    • Fixed activation timing so observations trigger mid-step as soon as the threshold is crossed, instead of waiting for the next user message.
    • Fixed partial activations that left too much context — activation is now skipped when it can't compress enough, falling back to a full observation instead.
    • Fixed token counting so reasoning-only message parts no longer inflate totals and cause premature context reduction.
    • Clarified blockAfter behavior: values below 100 are treated as multipliers (e.g. 1.2 = 1.2× threshold), values ≥ 100 as absolute token counts.
  • Updated dependencies [df170fd, ae55343, c290cec, f03e794, aa4a5ae, de3f584, d3fb010, 702ee1c, f495051, e622f1d, 8d14a59, 861f111, 00f43e8, 1b6f651, 96a1702, cb9f921, 114e7c1, 1b6f651, 72df4a8]:

    • @mastra/core@1.8.0
    • @mastra/schema-compat@1.1.3

@mastra/mongodb@1.5.2

Patch Changes

  • Fixed observation activation to always preserve a minimum amount of context. Previously, swapping buffered observation chunks could unexpectedly drop the context window to near-zero tokens. (#13476)

  • Add a clear runtime error when queryVector is omitted for vector stores that require a vector for queries. Previously, omitting queryVector would produce confusing SDK-level errors; now each store throws a structured MastraError with ErrorCategory.USER explaining that metadata-only queries are not supported by that backend. (#13286)

  • Updated dependencies [df170fd, ae55343, c290cec, f03e794, aa4a5ae, de3f584, d3fb010, 702ee1c, f495051, e622f1d, 861f111, 00f43e8, 1b6f651, 96a1702, cb9f921, 114e7c1, 1b6f651, 72df4a8]:

    • @mastra/core@1.8.0

@mastra/opencode@0.0.6

Patch Changes

@mastra/opensearch@1.0.1

Patch Changes

@mastra/pg@1.7.0

Minor Changes

  • PgVector.query() now supports querying by metadata filters alone without providing a query vector — useful when you need to retrieve records by metadata without performing similarity search. (#13286)

    Before (queryVector was required):

    const results = await pgVector.query({
      indexName: 'my-index',
      queryVector: [0.1, 0.2, ...],
      filter: { category: 'docs' },
    });

    After (metadata-only query):

    const results = await pgVector.query({
      indexName: 'my-index',
      filter: { category: 'docs' },
    });
    // Returns matching records with score: 0 (no similarity ranking)

    At least one of queryVector or filter must be provided. When queryVector is omitted, results are returned with score: 0 since no similarity computation is performed.

Patch Changes

  • Set REPLICA IDENTITY USING INDEX on the mastra_workflow_snapshot table so PostgreSQL logical replication can track row updates. The table only has a UNIQUE constraint with no PRIMARY KEY, which caused "cannot update table because it does not have a replica identity and publishes updates" errors when logical replication was enabled. Fixes #13097. (#13178)

  • Fixed observation activation to always preserve a minimum amount of context. Previously, swapping buffered observation chunks could unexpectedly drop the context window to near-zero tokens. (#13476)

  • Updated dependencies [df170fd, ae55343, c290cec, f03e794, aa4a5ae, de3f584, d3fb010, 702ee1c, f495051, e622f1d, 861f111, 00f43e8, 1b6f651, 96a1702, cb9f921, 114e7c1, 1b6f651, 72df4a8]:

    • @mastra/core@1.8.0

@mastra/pinecone@1.0.1

Patch Changes

@mastra/playground-ui@15.0.0

Minor Changes

  • Update peer dependencies to match core package version bump (1.5.0) (#13323)

Patch Changes

@mastra/qdrant@1.0.1

Patch Changes

@mastra/rag@2.1.2

Patch Changes

@mastra/react@0.2.7

Patch Changes

  • Added completionResult to MastraUIMessageMetadata (#13323)

  • Updated dependencies:

    • @mastra/client-js@1.7.1

@mastra/s3vectors@1.0.1

Patch Changes

@mastra/schema-compat@1.1.3

Patch Changes

  • Fix ZodNull throwing "does not support zod type: ZodNull" for Anthropic and OpenAI reasoning models. MCP tools with nullable properties in their JSON Schema produce z.null() which was unhandled by these provider compat layers. (#13496)

@mastra/server@1.8.0

Patch Changes

  • Fixed the skill reference endpoint (GET /workspaces/:workspaceId/skills/:skillName/references/:referencePath) returning 404 for valid reference files. (#13506)

  • Fixed GET /api/workspaces returning source: 'mastra' for all workspaces. Agent workspaces now correctly return source: 'agent' with agentId and agentName populated. (#13468)

  • Fixed /tools API endpoint crashing with provider-defined tools (e.g. google.tools.googleSearch(), openai.tools.webSearch()). These tools have a lazy inputSchema that is not a Zod schema, which caused zodToJsonSchema to throw "Cannot read properties of undefined (reading 'typeName')". (#13507)

  • Updated dependencies [df170fd, ae55343, c290cec, f03e794, aa4a5ae, de3f584, d3fb010, 702ee1c, f495051, e622f1d, 861f111, 00f43e8, 1b6f651, 96a1702, cb9f921, 114e7c1, 1b6f651, 72df4a8]:

    • @mastra/core@1.8.0

@mastra/turbopuffer@1.0.1

Patch Changes

@mastra/upstash@1.0.2

Patch Changes

@mastra/vectorize@1.0.1

Patch Changes

Don't miss a new mastra release

NewReleases is sending notifications on new releases.