github mastra-ai/mastra @mastra/core@1.0.0-beta.25
January 20, 2026

latest releases: mastra@1.0.1, create-mastra@1.0.1, @mastra/server@1.0.4...
14 hours ago

Changelog

@mastra/ai-sdk@1.0.0-beta.16

Patch Changes

  • Fixed start chunk being dropped when using toAISdkStream with partial options. The start message with messageId is now correctly emitted according to the AI SDK stream protocol. (#12069)

@mastra/braintrust@1.0.0-beta.16

Patch Changes

  • Fixed exporting tags for root observability spans in Braintrust exporter. (#12057)

    This was broken in PR: 11870.


@mastra/clickhouse@1.0.0-beta.11

Patch Changes

  • Added new listThreads method for flexible thread filtering across all storage adapters. (#11832)

    New Features

    • Filter threads by resourceId, metadata, or both (with AND logic for metadata key-value pairs)
    • All filter parameters are optional, allowing you to list all threads or filter as needed
    • Full pagination and sorting support

    Example Usage

    // List all threads
    const allThreads = await memory.listThreads({});
    
    // Filter by resourceId only
    const userThreads = await memory.listThreads({
      filter: { resourceId: 'user-123' },
    });
    
    // Filter by metadata only
    const supportThreads = await memory.listThreads({
      filter: { metadata: { category: 'support' } },
    });
    
    // Filter by both with pagination
    const filteredThreads = await memory.listThreads({
      filter: {
        resourceId: 'user-123',
        metadata: { priority: 'high', status: 'open' },
      },
      orderBy: { field: 'updatedAt', direction: 'DESC' },
      page: 0,
      perPage: 20,
    });

    Security Improvements

    • Added validation to prevent SQL injection via malicious metadata keys
    • Added pagination parameter validation to prevent integer overflow attacks

@mastra/client-js@1.0.0-beta.25

Minor Changes

  • Added human-in-the-loop (HITL) tool approval support for generate() method. (#12056)

    Why: This provides parity between stream() and generate() for tool approval flows, allowing non-streaming use cases to leverage requireToolApproval without needing to switch to streaming.

    Previously, tool approval with requireToolApproval only worked with stream(). Now you can use the same approval flow with generate() for non-streaming use cases.

    Using tool approval with generate()

    const output = await agent.generate('Find user John', {
      requireToolApproval: true,
    });
    
    // Check if a tool is waiting for approval
    if (output.finishReason === 'suspended') {
      console.log('Tool requires approval:', output.suspendPayload.toolName);
    
      // Approve the tool call
      const result = await agent.approveToolCallGenerate({
        runId: output.runId,
        toolCallId: output.suspendPayload.toolCallId,
      });
    
      console.log(result.text);
    }

    Declining a tool call

    if (output.finishReason === 'suspended') {
      const result = await agent.declineToolCallGenerate({
        runId: output.runId,
        toolCallId: output.suspendPayload.toolCallId,
      });
    }

    New methods added:

    • agent.approveToolCallGenerate({ runId, toolCallId }) - Approves a pending tool call and returns the complete result
    • agent.declineToolCallGenerate({ runId, toolCallId }) - Declines a pending tool call and returns the complete result

    Server routes added:

    • POST /api/agents/:agentId/approve-tool-call-generate
    • POST /api/agents/:agentId/decline-tool-call-generate

    The playground UI now also supports tool approval when using generate mode.

  • Added processor resource to the JavaScript client SDK. You can now list processors, get processor details, and execute processors via the client: (#12059)

    // List all processors
    const processors = await client.listProcessors();
    
    // Get processor details
    const details = await client.getProcessor('my-processor').details();
    
    // Execute a processor
    const result = await client.getProcessor('my-processor').execute({
      phase: 'input',
      messages: [{ role: 'user', content: { format: 2, parts: [{ type: 'text', text: 'Hello' }] } }],
    });
  • Added new listThreads method for flexible thread filtering across all storage adapters. (#11832)

    New Features

    • Filter threads by resourceId, metadata, or both (with AND logic for metadata key-value pairs)
    • All filter parameters are optional, allowing you to list all threads or filter as needed
    • Full pagination and sorting support

    Example Usage

    // List all threads
    const allThreads = await memory.listThreads({});
    
    // Filter by resourceId only
    const userThreads = await memory.listThreads({
      filter: { resourceId: 'user-123' },
    });
    
    // Filter by metadata only
    const supportThreads = await memory.listThreads({
      filter: { metadata: { category: 'support' } },
    });
    
    // Filter by both with pagination
    const filteredThreads = await memory.listThreads({
      filter: {
        resourceId: 'user-123',
        metadata: { priority: 'high', status: 'open' },
      },
      orderBy: { field: 'updatedAt', direction: 'DESC' },
      page: 0,
      perPage: 20,
    });

    Security Improvements

    • Added validation to prevent SQL injection via malicious metadata keys
    • Added pagination parameter validation to prevent integer overflow attacks

@mastra/cloudflare@1.0.0-beta.12

Patch Changes

  • Added new listThreads method for flexible thread filtering across all storage adapters. (#11832)

    New Features

    • Filter threads by resourceId, metadata, or both (with AND logic for metadata key-value pairs)
    • All filter parameters are optional, allowing you to list all threads or filter as needed
    • Full pagination and sorting support

    Example Usage

    // List all threads
    const allThreads = await memory.listThreads({});
    
    // Filter by resourceId only
    const userThreads = await memory.listThreads({
      filter: { resourceId: 'user-123' },
    });
    
    // Filter by metadata only
    const supportThreads = await memory.listThreads({
      filter: { metadata: { category: 'support' } },
    });
    
    // Filter by both with pagination
    const filteredThreads = await memory.listThreads({
      filter: {
        resourceId: 'user-123',
        metadata: { priority: 'high', status: 'open' },
      },
      orderBy: { field: 'updatedAt', direction: 'DESC' },
      page: 0,
      perPage: 20,
    });

    Security Improvements

    • Added validation to prevent SQL injection via malicious metadata keys
    • Added pagination parameter validation to prevent integer overflow attacks

@mastra/cloudflare-d1@1.0.0-beta.11

Patch Changes

  • Added new listThreads method for flexible thread filtering across all storage adapters. (#11832)

    New Features

    • Filter threads by resourceId, metadata, or both (with AND logic for metadata key-value pairs)
    • All filter parameters are optional, allowing you to list all threads or filter as needed
    • Full pagination and sorting support

    Example Usage

    // List all threads
    const allThreads = await memory.listThreads({});
    
    // Filter by resourceId only
    const userThreads = await memory.listThreads({
      filter: { resourceId: 'user-123' },
    });
    
    // Filter by metadata only
    const supportThreads = await memory.listThreads({
      filter: { metadata: { category: 'support' } },
    });
    
    // Filter by both with pagination
    const filteredThreads = await memory.listThreads({
      filter: {
        resourceId: 'user-123',
        metadata: { priority: 'high', status: 'open' },
      },
      orderBy: { field: 'updatedAt', direction: 'DESC' },
      page: 0,
      perPage: 20,
    });

    Security Improvements

    • Added validation to prevent SQL injection via malicious metadata keys
    • Added pagination parameter validation to prevent integer overflow attacks

@mastra/codemod@0.1.0-beta.7

Patch Changes

  • Add new v1/client-msg-function-args codemod. It transforms MastraClient agent method calls to use messages as the first argument. (#12061)

  • Added new listThreads method for flexible thread filtering across all storage adapters. (#11832)

    New Features

    • Filter threads by resourceId, metadata, or both (with AND logic for metadata key-value pairs)
    • All filter parameters are optional, allowing you to list all threads or filter as needed
    • Full pagination and sorting support

    Example Usage

    // List all threads
    const allThreads = await memory.listThreads({});
    
    // Filter by resourceId only
    const userThreads = await memory.listThreads({
      filter: { resourceId: 'user-123' },
    });
    
    // Filter by metadata only
    const supportThreads = await memory.listThreads({
      filter: { metadata: { category: 'support' } },
    });
    
    // Filter by both with pagination
    const filteredThreads = await memory.listThreads({
      filter: {
        resourceId: 'user-123',
        metadata: { priority: 'high', status: 'open' },
      },
      orderBy: { field: 'updatedAt', direction: 'DESC' },
      page: 0,
      perPage: 20,
    });

    Security Improvements

    • Added validation to prevent SQL injection via malicious metadata keys
    • Added pagination parameter validation to prevent integer overflow attacks

@mastra/convex@0.1.0-beta.9

Patch Changes

  • Added new listThreads method for flexible thread filtering across all storage adapters. (#11832)

    New Features

    • Filter threads by resourceId, metadata, or both (with AND logic for metadata key-value pairs)
    • All filter parameters are optional, allowing you to list all threads or filter as needed
    • Full pagination and sorting support

    Example Usage

    // List all threads
    const allThreads = await memory.listThreads({});
    
    // Filter by resourceId only
    const userThreads = await memory.listThreads({
      filter: { resourceId: 'user-123' },
    });
    
    // Filter by metadata only
    const supportThreads = await memory.listThreads({
      filter: { metadata: { category: 'support' } },
    });
    
    // Filter by both with pagination
    const filteredThreads = await memory.listThreads({
      filter: {
        resourceId: 'user-123',
        metadata: { priority: 'high', status: 'open' },
      },
      orderBy: { field: 'updatedAt', direction: 'DESC' },
      page: 0,
      perPage: 20,
    });

    Security Improvements

    • Added validation to prevent SQL injection via malicious metadata keys
    • Added pagination parameter validation to prevent integer overflow attacks

@mastra/core@1.0.0-beta.25

Minor Changes

  • Added human-in-the-loop (HITL) tool approval support for generate() method. (#12056)

    Why: This provides parity between stream() and generate() for tool approval flows, allowing non-streaming use cases to leverage requireToolApproval without needing to switch to streaming.

    Previously, tool approval with requireToolApproval only worked with stream(). Now you can use the same approval flow with generate() for non-streaming use cases.

    Using tool approval with generate()

    const output = await agent.generate('Find user John', {
      requireToolApproval: true,
    });
    
    // Check if a tool is waiting for approval
    if (output.finishReason === 'suspended') {
      console.log('Tool requires approval:', output.suspendPayload.toolName);
    
      // Approve the tool call
      const result = await agent.approveToolCallGenerate({
        runId: output.runId,
        toolCallId: output.suspendPayload.toolCallId,
      });
    
      console.log(result.text);
    }

    Declining a tool call

    if (output.finishReason === 'suspended') {
      const result = await agent.declineToolCallGenerate({
        runId: output.runId,
        toolCallId: output.suspendPayload.toolCallId,
      });
    }

    New methods added:

    • agent.approveToolCallGenerate({ runId, toolCallId }) - Approves a pending tool call and returns the complete result
    • agent.declineToolCallGenerate({ runId, toolCallId }) - Declines a pending tool call and returns the complete result

    Server routes added:

    • POST /api/agents/:agentId/approve-tool-call-generate
    • POST /api/agents/:agentId/decline-tool-call-generate

    The playground UI now also supports tool approval when using generate mode.

  • Exported isProcessorWorkflow function from @mastra/core/processors. Added getConfiguredProcessorWorkflows() method to agents and listProcessors() method to the Mastra class for programmatic access to processor information. (#12059)

  • Added new listThreads method for flexible thread filtering across all storage adapters. (#11832)

    New Features

    • Filter threads by resourceId, metadata, or both (with AND logic for metadata key-value pairs)
    • All filter parameters are optional, allowing you to list all threads or filter as needed
    • Full pagination and sorting support

    Example Usage

    // List all threads
    const allThreads = await memory.listThreads({});
    
    // Filter by resourceId only
    const userThreads = await memory.listThreads({
      filter: { resourceId: 'user-123' },
    });
    
    // Filter by metadata only
    const supportThreads = await memory.listThreads({
      filter: { metadata: { category: 'support' } },
    });
    
    // Filter by both with pagination
    const filteredThreads = await memory.listThreads({
      filter: {
        resourceId: 'user-123',
        metadata: { priority: 'high', status: 'open' },
      },
      orderBy: { field: 'updatedAt', direction: 'DESC' },
      page: 0,
      perPage: 20,
    });

    Security Improvements

    • Added validation to prevent SQL injection via malicious metadata keys
    • Added pagination parameter validation to prevent integer overflow attacks

Patch Changes

  • Fixed agent network mode failing with "Cannot read properties of undefined" error when tools or workflows don't have an inputSchema defined. (#12063)

    • @mastra/core: Fixed getRoutingAgent() to handle tools and workflows without inputSchema by providing a default empty schema fallback.
    • @mastra/schema-compat: Fixed Zod v4 optional/nullable fields producing invalid JSON schema for OpenAI structured outputs. OpenAI now correctly receives type: ["string", "null"] instead of anyOf patterns that were rejected with "must have a 'type' key" error.
  • Fixed duplicate storage initialization when init() is called explicitly before other methods. The augmentWithInit proxy now tracks when init() is called directly, preventing subsequent method calls from triggering init() again. This resolves the high volume of requests to storage backends (like Turso) during agent streaming with memory enabled. (#12067)

  • chore(core): MessageHistory input processor pass resourceId for storage (#11910)


@mastra/deployer@1.0.0-beta.25

Patch Changes

  • Add back /api route during mastra dev which was accidentally removed. (#12055)

@mastra/dynamodb@1.0.0-beta.11

Patch Changes

  • Added new listThreads method for flexible thread filtering across all storage adapters. (#11832)

    New Features

    • Filter threads by resourceId, metadata, or both (with AND logic for metadata key-value pairs)
    • All filter parameters are optional, allowing you to list all threads or filter as needed
    • Full pagination and sorting support

    Example Usage

    // List all threads
    const allThreads = await memory.listThreads({});
    
    // Filter by resourceId only
    const userThreads = await memory.listThreads({
      filter: { resourceId: 'user-123' },
    });
    
    // Filter by metadata only
    const supportThreads = await memory.listThreads({
      filter: { metadata: { category: 'support' } },
    });
    
    // Filter by both with pagination
    const filteredThreads = await memory.listThreads({
      filter: {
        resourceId: 'user-123',
        metadata: { priority: 'high', status: 'open' },
      },
      orderBy: { field: 'updatedAt', direction: 'DESC' },
      page: 0,
      perPage: 20,
    });

    Security Improvements

    • Added validation to prevent SQL injection via malicious metadata keys
    • Added pagination parameter validation to prevent integer overflow attacks

@mastra/lance@1.0.0-beta.12

Patch Changes

  • Added new listThreads method for flexible thread filtering across all storage adapters. (#11832)

    New Features

    • Filter threads by resourceId, metadata, or both (with AND logic for metadata key-value pairs)
    • All filter parameters are optional, allowing you to list all threads or filter as needed
    • Full pagination and sorting support

    Example Usage

    // List all threads
    const allThreads = await memory.listThreads({});
    
    // Filter by resourceId only
    const userThreads = await memory.listThreads({
      filter: { resourceId: 'user-123' },
    });
    
    // Filter by metadata only
    const supportThreads = await memory.listThreads({
      filter: { metadata: { category: 'support' } },
    });
    
    // Filter by both with pagination
    const filteredThreads = await memory.listThreads({
      filter: {
        resourceId: 'user-123',
        metadata: { priority: 'high', status: 'open' },
      },
      orderBy: { field: 'updatedAt', direction: 'DESC' },
      page: 0,
      perPage: 20,
    });

    Security Improvements

    • Added validation to prevent SQL injection via malicious metadata keys
    • Added pagination parameter validation to prevent integer overflow attacks

@mastra/libsql@1.0.0-beta.13

Patch Changes

  • Added new listThreads method for flexible thread filtering across all storage adapters. (#11832)

    New Features

    • Filter threads by resourceId, metadata, or both (with AND logic for metadata key-value pairs)
    • All filter parameters are optional, allowing you to list all threads or filter as needed
    • Full pagination and sorting support

    Example Usage

    // List all threads
    const allThreads = await memory.listThreads({});
    
    // Filter by resourceId only
    const userThreads = await memory.listThreads({
      filter: { resourceId: 'user-123' },
    });
    
    // Filter by metadata only
    const supportThreads = await memory.listThreads({
      filter: { metadata: { category: 'support' } },
    });
    
    // Filter by both with pagination
    const filteredThreads = await memory.listThreads({
      filter: {
        resourceId: 'user-123',
        metadata: { priority: 'high', status: 'open' },
      },
      orderBy: { field: 'updatedAt', direction: 'DESC' },
      page: 0,
      perPage: 20,
    });

    Security Improvements

    • Added validation to prevent SQL injection via malicious metadata keys
    • Added pagination parameter validation to prevent integer overflow attacks

@mastra/longmemeval@1.0.0-beta.25

Patch Changes

  • Added new listThreads method for flexible thread filtering across all storage adapters. (#11832)

    New Features

    • Filter threads by resourceId, metadata, or both (with AND logic for metadata key-value pairs)
    • All filter parameters are optional, allowing you to list all threads or filter as needed
    • Full pagination and sorting support

    Example Usage

    // List all threads
    const allThreads = await memory.listThreads({});
    
    // Filter by resourceId only
    const userThreads = await memory.listThreads({
      filter: { resourceId: 'user-123' },
    });
    
    // Filter by metadata only
    const supportThreads = await memory.listThreads({
      filter: { metadata: { category: 'support' } },
    });
    
    // Filter by both with pagination
    const filteredThreads = await memory.listThreads({
      filter: {
        resourceId: 'user-123',
        metadata: { priority: 'high', status: 'open' },
      },
      orderBy: { field: 'updatedAt', direction: 'DESC' },
      page: 0,
      perPage: 20,
    });

    Security Improvements

    • Added validation to prevent SQL injection via malicious metadata keys
    • Added pagination parameter validation to prevent integer overflow attacks

@mastra/memory@1.0.0-beta.15

Minor Changes

  • Added new listThreads method for flexible thread filtering across all storage adapters. (#11832)

    New Features

    • Filter threads by resourceId, metadata, or both (with AND logic for metadata key-value pairs)
    • All filter parameters are optional, allowing you to list all threads or filter as needed
    • Full pagination and sorting support

    Example Usage

    // List all threads
    const allThreads = await memory.listThreads({});
    
    // Filter by resourceId only
    const userThreads = await memory.listThreads({
      filter: { resourceId: 'user-123' },
    });
    
    // Filter by metadata only
    const supportThreads = await memory.listThreads({
      filter: { metadata: { category: 'support' } },
    });
    
    // Filter by both with pagination
    const filteredThreads = await memory.listThreads({
      filter: {
        resourceId: 'user-123',
        metadata: { priority: 'high', status: 'open' },
      },
      orderBy: { field: 'updatedAt', direction: 'DESC' },
      page: 0,
      perPage: 20,
    });

    Security Improvements

    • Added validation to prevent SQL injection via malicious metadata keys
    • Added pagination parameter validation to prevent integer overflow attacks

@mastra/mongodb@1.0.0-beta.13

Patch Changes

  • Added new listThreads method for flexible thread filtering across all storage adapters. (#11832)

    New Features

    • Filter threads by resourceId, metadata, or both (with AND logic for metadata key-value pairs)
    • All filter parameters are optional, allowing you to list all threads or filter as needed
    • Full pagination and sorting support

    Example Usage

    // List all threads
    const allThreads = await memory.listThreads({});
    
    // Filter by resourceId only
    const userThreads = await memory.listThreads({
      filter: { resourceId: 'user-123' },
    });
    
    // Filter by metadata only
    const supportThreads = await memory.listThreads({
      filter: { metadata: { category: 'support' } },
    });
    
    // Filter by both with pagination
    const filteredThreads = await memory.listThreads({
      filter: {
        resourceId: 'user-123',
        metadata: { priority: 'high', status: 'open' },
      },
      orderBy: { field: 'updatedAt', direction: 'DESC' },
      page: 0,
      perPage: 20,
    });

    Security Improvements

    • Added validation to prevent SQL injection via malicious metadata keys
    • Added pagination parameter validation to prevent integer overflow attacks

@mastra/mssql@1.0.0-beta.12

Patch Changes

  • Added new listThreads method for flexible thread filtering across all storage adapters. (#11832)

    New Features

    • Filter threads by resourceId, metadata, or both (with AND logic for metadata key-value pairs)
    • All filter parameters are optional, allowing you to list all threads or filter as needed
    • Full pagination and sorting support

    Example Usage

    // List all threads
    const allThreads = await memory.listThreads({});
    
    // Filter by resourceId only
    const userThreads = await memory.listThreads({
      filter: { resourceId: 'user-123' },
    });
    
    // Filter by metadata only
    const supportThreads = await memory.listThreads({
      filter: { metadata: { category: 'support' } },
    });
    
    // Filter by both with pagination
    const filteredThreads = await memory.listThreads({
      filter: {
        resourceId: 'user-123',
        metadata: { priority: 'high', status: 'open' },
      },
      orderBy: { field: 'updatedAt', direction: 'DESC' },
      page: 0,
      perPage: 20,
    });

    Security Improvements

    • Added validation to prevent SQL injection via malicious metadata keys
    • Added pagination parameter validation to prevent integer overflow attacks

@mastra/pg@1.0.0-beta.14

Patch Changes

  • Added new listThreads method for flexible thread filtering across all storage adapters. (#11832)

    New Features

    • Filter threads by resourceId, metadata, or both (with AND logic for metadata key-value pairs)
    • All filter parameters are optional, allowing you to list all threads or filter as needed
    • Full pagination and sorting support

    Example Usage

    // List all threads
    const allThreads = await memory.listThreads({});
    
    // Filter by resourceId only
    const userThreads = await memory.listThreads({
      filter: { resourceId: 'user-123' },
    });
    
    // Filter by metadata only
    const supportThreads = await memory.listThreads({
      filter: { metadata: { category: 'support' } },
    });
    
    // Filter by both with pagination
    const filteredThreads = await memory.listThreads({
      filter: {
        resourceId: 'user-123',
        metadata: { priority: 'high', status: 'open' },
      },
      orderBy: { field: 'updatedAt', direction: 'DESC' },
      page: 0,
      perPage: 20,
    });

    Security Improvements

    • Added validation to prevent SQL injection via malicious metadata keys
    • Added pagination parameter validation to prevent integer overflow attacks

@mastra/playground-ui@7.0.0-beta.25

Patch Changes

  • Added human-in-the-loop (HITL) tool approval support for generate() method. (#12056)

    Why: This provides parity between stream() and generate() for tool approval flows, allowing non-streaming use cases to leverage requireToolApproval without needing to switch to streaming.

    Previously, tool approval with requireToolApproval only worked with stream(). Now you can use the same approval flow with generate() for non-streaming use cases.

    Using tool approval with generate()

    const output = await agent.generate('Find user John', {
      requireToolApproval: true,
    });
    
    // Check if a tool is waiting for approval
    if (output.finishReason === 'suspended') {
      console.log('Tool requires approval:', output.suspendPayload.toolName);
    
      // Approve the tool call
      const result = await agent.approveToolCallGenerate({
        runId: output.runId,
        toolCallId: output.suspendPayload.toolCallId,
      });
    
      console.log(result.text);
    }

    Declining a tool call

    if (output.finishReason === 'suspended') {
      const result = await agent.declineToolCallGenerate({
        runId: output.runId,
        toolCallId: output.suspendPayload.toolCallId,
      });
    }

    New methods added:

    • agent.approveToolCallGenerate({ runId, toolCallId }) - Approves a pending tool call and returns the complete result
    • agent.declineToolCallGenerate({ runId, toolCallId }) - Declines a pending tool call and returns the complete result

    Server routes added:

    • POST /api/agents/:agentId/approve-tool-call-generate
    • POST /api/agents/:agentId/decline-tool-call-generate

    The playground UI now also supports tool approval when using generate mode.

  • Fix navigation for processors Studio tab (#12062)

  • Added Processors tab to Mastra Studio. You can now view all configured processors, see which agents use them, and test processors directly from the UI. Processor workflows automatically redirect to the workflow graph view with a simplified input mode for testing. (#12059)


@mastra/react-hooks@1.0.0-beta.25

Minor Changes

  • Added human-in-the-loop (HITL) tool approval support for generate() method. (#12056)

    Why: This provides parity between stream() and generate() for tool approval flows, allowing non-streaming use cases to leverage requireToolApproval without needing to switch to streaming.

    Previously, tool approval with requireToolApproval only worked with stream(). Now you can use the same approval flow with generate() for non-streaming use cases.

    Using tool approval with generate()

    const output = await agent.generate('Find user John', {
      requireToolApproval: true,
    });
    
    // Check if a tool is waiting for approval
    if (output.finishReason === 'suspended') {
      console.log('Tool requires approval:', output.suspendPayload.toolName);
    
      // Approve the tool call
      const result = await agent.approveToolCallGenerate({
        runId: output.runId,
        toolCallId: output.suspendPayload.toolCallId,
      });
    
      console.log(result.text);
    }

    Declining a tool call

    if (output.finishReason === 'suspended') {
      const result = await agent.declineToolCallGenerate({
        runId: output.runId,
        toolCallId: output.suspendPayload.toolCallId,
      });
    }

    New methods added:

    • agent.approveToolCallGenerate({ runId, toolCallId }) - Approves a pending tool call and returns the complete result
    • agent.declineToolCallGenerate({ runId, toolCallId }) - Declines a pending tool call and returns the complete result

    Server routes added:

    • POST /api/agents/:agentId/approve-tool-call-generate
    • POST /api/agents/:agentId/decline-tool-call-generate

    The playground UI now also supports tool approval when using generate mode.


@mastra/schema-compat@1.0.0-beta.8

Patch Changes

  • Fixed agent network mode failing with "Cannot read properties of undefined" error when tools or workflows don't have an inputSchema defined. (#12063)
    • @mastra/core: Fixed getRoutingAgent() to handle tools and workflows without inputSchema by providing a default empty schema fallback.
    • @mastra/schema-compat: Fixed Zod v4 optional/nullable fields producing invalid JSON schema for OpenAI structured outputs. OpenAI now correctly receives type: ["string", "null"] instead of anyOf patterns that were rejected with "must have a 'type' key" error.

@mastra/server@1.0.0-beta.25

Minor Changes

  • Added human-in-the-loop (HITL) tool approval support for generate() method. (#12056)

    Why: This provides parity between stream() and generate() for tool approval flows, allowing non-streaming use cases to leverage requireToolApproval without needing to switch to streaming.

    Previously, tool approval with requireToolApproval only worked with stream(). Now you can use the same approval flow with generate() for non-streaming use cases.

    Using tool approval with generate()

    const output = await agent.generate('Find user John', {
      requireToolApproval: true,
    });
    
    // Check if a tool is waiting for approval
    if (output.finishReason === 'suspended') {
      console.log('Tool requires approval:', output.suspendPayload.toolName);
    
      // Approve the tool call
      const result = await agent.approveToolCallGenerate({
        runId: output.runId,
        toolCallId: output.suspendPayload.toolCallId,
      });
    
      console.log(result.text);
    }

    Declining a tool call

    if (output.finishReason === 'suspended') {
      const result = await agent.declineToolCallGenerate({
        runId: output.runId,
        toolCallId: output.suspendPayload.toolCallId,
      });
    }

    New methods added:

    • agent.approveToolCallGenerate({ runId, toolCallId }) - Approves a pending tool call and returns the complete result
    • agent.declineToolCallGenerate({ runId, toolCallId }) - Declines a pending tool call and returns the complete result

    Server routes added:

    • POST /api/agents/:agentId/approve-tool-call-generate
    • POST /api/agents/:agentId/decline-tool-call-generate

    The playground UI now also supports tool approval when using generate mode.

  • Added new listThreads method for flexible thread filtering across all storage adapters. (#11832)

    New Features

    • Filter threads by resourceId, metadata, or both (with AND logic for metadata key-value pairs)
    • All filter parameters are optional, allowing you to list all threads or filter as needed
    • Full pagination and sorting support

    Example Usage

    // List all threads
    const allThreads = await memory.listThreads({});
    
    // Filter by resourceId only
    const userThreads = await memory.listThreads({
      filter: { resourceId: 'user-123' },
    });
    
    // Filter by metadata only
    const supportThreads = await memory.listThreads({
      filter: { metadata: { category: 'support' } },
    });
    
    // Filter by both with pagination
    const filteredThreads = await memory.listThreads({
      filter: {
        resourceId: 'user-123',
        metadata: { priority: 'high', status: 'open' },
      },
      orderBy: { field: 'updatedAt', direction: 'DESC' },
      page: 0,
      perPage: 20,
    });

    Security Improvements

    • Added validation to prevent SQL injection via malicious metadata keys
    • Added pagination parameter validation to prevent integer overflow attacks

Patch Changes

  • Fix navigation for processors Studio tab (#12062)

  • Added new /api/processors endpoints to list, get details, and execute processors. Processor workflows are now auto-detected based on their schema. (#12059)


@mastra/upstash@1.0.0-beta.12

Patch Changes

  • Added new listThreads method for flexible thread filtering across all storage adapters. (#11832)

    New Features

    • Filter threads by resourceId, metadata, or both (with AND logic for metadata key-value pairs)
    • All filter parameters are optional, allowing you to list all threads or filter as needed
    • Full pagination and sorting support

    Example Usage

    // List all threads
    const allThreads = await memory.listThreads({});
    
    // Filter by resourceId only
    const userThreads = await memory.listThreads({
      filter: { resourceId: 'user-123' },
    });
    
    // Filter by metadata only
    const supportThreads = await memory.listThreads({
      filter: { metadata: { category: 'support' } },
    });
    
    // Filter by both with pagination
    const filteredThreads = await memory.listThreads({
      filter: {
        resourceId: 'user-123',
        metadata: { priority: 'high', status: 'open' },
      },
      orderBy: { field: 'updatedAt', direction: 'DESC' },
      page: 0,
      perPage: 20,
    });

    Security Improvements

    • Added validation to prevent SQL injection via malicious metadata keys
    • Added pagination parameter validation to prevent integer overflow attacks

mastra@1.0.0-beta.17

Patch Changes

  • Added Processors tab to Mastra Studio. You can now view all configured processors, see which agents use them, and test processors directly from the UI. Processor workflows automatically redirect to the workflow graph view with a simplified input mode for testing. (#12059)


Full Changelog: 091e0d6

Don't miss a new mastra release

NewReleases is sending notifications on new releases.