Mastra Changelog 2025-11-20

ยท

Nov 20, 2025

This week we fixed some critical issues with OpenAI streaming and added fine-grained stream control for AI SDK v5.

Release: @mastra/core@0.24.3

Let's see what all is new...

Generate Endpoint Fix for OpenAI Streaming

We've switched to using proper generate endpoints for model calls, fixing a critical permission issue with OpenAI streaming. No more 403 errors when your users don't have full model permissions - the generate endpoint respects granular API key scopes properly.

This change (PR #10239) adds support for doGenerate in LanguageModelV2, ensuring your production deployments work reliably regardless of API key permission levels.

AI SDK v5: Fine-Grained Stream Control

Building custom UIs? You now have complete control over what gets sent in your AI SDK streams. Configure exactly which message chunks your frontend receives with the new sendStart, sendFinish, sendReasoning, and sendSources options.

 1// Using the chatRoute helper
 2import { chatRoute } from "@mastra/ai-sdk";
 3
 4chatRoute({
 5path: "/chat",
 6agent: "weatherAgent",
 7sendStart: false,      // Skip initialization chunks
 8sendFinish: true,      // Keep completion signals
 9sendReasoning: false,  // Omit reasoning traces
10sendSources: true      // Include source attributions
11})// Before: Everything was hardcoded
12// After: Pick what you need
13toAISdkV5Stream(stream, {
14  sendStart: false,      // Skip initialization chunks
15  sendFinish: true,      // Keep completion signals
16  sendReasoning: false,  // Omit reasoning traces
17  sendSources: true      // Include source attributions
18})

Breaking Change: AgentStreamToAISDKTransformer now accepts an options object instead of a single lastMessageId parameter. Update integrations accordingly. (PR #10127)

Tripwire Support for Stream Safety

Ever needed to signal special conditions during streaming? Tripwire data chunks let you emit events when rate limits approach, content filters trigger, or other runtime conditions occur.

 1// Tripwire chunks automatically convert to AI SDK format
 2{
 3  type: 'tripwire',
 4  payload: { tripwireReason: 'Rate limit approaching' }
 5}
 6// Becomes: { type: 'data-tripwire', data: { tripwireReason: '...' }}

Your frontend can now react intelligently to these signals without breaking the stream flow. (PR #10269)

Other Notable Updates

  • Auth Provider Options: All auth providers (@mastra/auth-*) now support passing through custom options PR #10284
  • MCP Server Timeout: Configure timeouts for MCP servers to prevent hanging connections PR #9891
  • Workflow Deprecation Fix: Agent networks now use .fullStream instead of iterating WorkflowRunOutput directly PR #10306
  • Vector Definition Fix: Resolved Pinecone integration issues PR #10150
  • Create-Mastra Improvements: Better Bun runtime detection and cleanup on failure PR #10307

For the complete list of changes across all packages, check out the full release notes.

That's all for this week!

Happy building! ๐Ÿš€

Stay up to date