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
listThreadsmethod 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
- Filter threads by
@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()andgenerate()for tool approval flows, allowing non-streaming use cases to leveragerequireToolApprovalwithout needing to switch to streaming.Previously, tool approval with
requireToolApprovalonly worked withstream(). Now you can use the same approval flow withgenerate()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 resultagent.declineToolCallGenerate({ runId, toolCallId })- Declines a pending tool call and returns the complete result
Server routes added:
POST /api/agents/:agentId/approve-tool-call-generatePOST /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
listThreadsmethod 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
- Filter threads by
@mastra/cloudflare@1.0.0-beta.12
Patch Changes
-
Added new
listThreadsmethod 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
- Filter threads by
@mastra/cloudflare-d1@1.0.0-beta.11
Patch Changes
-
Added new
listThreadsmethod 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
- Filter threads by
@mastra/codemod@0.1.0-beta.7
Patch Changes
-
Add new
v1/client-msg-function-argscodemod. It transforms MastraClient agent method calls to use messages as the first argument. (#12061) -
Added new
listThreadsmethod 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
- Filter threads by
@mastra/convex@0.1.0-beta.9
Patch Changes
-
Added new
listThreadsmethod 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
- Filter threads by
@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()andgenerate()for tool approval flows, allowing non-streaming use cases to leveragerequireToolApprovalwithout needing to switch to streaming.Previously, tool approval with
requireToolApprovalonly worked withstream(). Now you can use the same approval flow withgenerate()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 resultagent.declineToolCallGenerate({ runId, toolCallId })- Declines a pending tool call and returns the complete result
Server routes added:
POST /api/agents/:agentId/approve-tool-call-generatePOST /api/agents/:agentId/decline-tool-call-generate
The playground UI now also supports tool approval when using generate mode.
-
Exported
isProcessorWorkflowfunction from @mastra/core/processors. AddedgetConfiguredProcessorWorkflows()method to agents andlistProcessors()method to the Mastra class for programmatic access to processor information. (#12059) -
Added new
listThreadsmethod 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
- Filter threads by
Patch Changes
-
Fixed agent network mode failing with "Cannot read properties of undefined" error when tools or workflows don't have an
inputSchemadefined. (#12063)- @mastra/core: Fixed
getRoutingAgent()to handle tools and workflows withoutinputSchemaby 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 ofanyOfpatterns that were rejected with "must have a 'type' key" error.
- @mastra/core: Fixed
-
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
/apiroute duringmastra devwhich was accidentally removed. (#12055)
@mastra/dynamodb@1.0.0-beta.11
Patch Changes
-
Added new
listThreadsmethod 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
- Filter threads by
@mastra/lance@1.0.0-beta.12
Patch Changes
-
Added new
listThreadsmethod 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
- Filter threads by
@mastra/libsql@1.0.0-beta.13
Patch Changes
-
Added new
listThreadsmethod 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
- Filter threads by
@mastra/longmemeval@1.0.0-beta.25
Patch Changes
-
Added new
listThreadsmethod 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
- Filter threads by
@mastra/memory@1.0.0-beta.15
Minor Changes
-
Added new
listThreadsmethod 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
- Filter threads by
@mastra/mongodb@1.0.0-beta.13
Patch Changes
-
Added new
listThreadsmethod 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
- Filter threads by
@mastra/mssql@1.0.0-beta.12
Patch Changes
-
Added new
listThreadsmethod 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
- Filter threads by
@mastra/pg@1.0.0-beta.14
Patch Changes
-
Added new
listThreadsmethod 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
- Filter threads by
@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()andgenerate()for tool approval flows, allowing non-streaming use cases to leveragerequireToolApprovalwithout needing to switch to streaming.Previously, tool approval with
requireToolApprovalonly worked withstream(). Now you can use the same approval flow withgenerate()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 resultagent.declineToolCallGenerate({ runId, toolCallId })- Declines a pending tool call and returns the complete result
Server routes added:
POST /api/agents/:agentId/approve-tool-call-generatePOST /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()andgenerate()for tool approval flows, allowing non-streaming use cases to leveragerequireToolApprovalwithout needing to switch to streaming.Previously, tool approval with
requireToolApprovalonly worked withstream(). Now you can use the same approval flow withgenerate()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 resultagent.declineToolCallGenerate({ runId, toolCallId })- Declines a pending tool call and returns the complete result
Server routes added:
POST /api/agents/:agentId/approve-tool-call-generatePOST /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
inputSchemadefined. (#12063)- @mastra/core: Fixed
getRoutingAgent()to handle tools and workflows withoutinputSchemaby 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 ofanyOfpatterns that were rejected with "must have a 'type' key" error.
- @mastra/core: Fixed
@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()andgenerate()for tool approval flows, allowing non-streaming use cases to leveragerequireToolApprovalwithout needing to switch to streaming.Previously, tool approval with
requireToolApprovalonly worked withstream(). Now you can use the same approval flow withgenerate()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 resultagent.declineToolCallGenerate({ runId, toolCallId })- Declines a pending tool call and returns the complete result
Server routes added:
POST /api/agents/:agentId/approve-tool-call-generatePOST /api/agents/:agentId/decline-tool-call-generate
The playground UI now also supports tool approval when using generate mode.
-
Added new
listThreadsmethod 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
- Filter threads by
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
listThreadsmethod 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
- Filter threads by
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