From 9658434da451599341613d9558945305dddbddb4 Mon Sep 17 00:00:00 2001 From: Craig Michael Thompson Date: Wed, 19 Nov 2025 10:29:17 +0000 Subject: [PATCH 1/2] [mastra] Set new memory property on agent.stream We're not setting the new `memory` property when callnig `mastra.stream`, which means that in newer versions of mastra that the `threadId` and `resourceId` properties aren't being persisted through. I've now set this, but kept the old `threadId` and `resourceId` properties around with a deprecation comment instead. --- integrations/mastra/typescript/src/mastra.ts | 25 ++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/integrations/mastra/typescript/src/mastra.ts b/integrations/mastra/typescript/src/mastra.ts index 27cbe4425..159e3fa3c 100644 --- a/integrations/mastra/typescript/src/mastra.ts +++ b/integrations/mastra/typescript/src/mastra.ts @@ -277,11 +277,19 @@ export class MastraAgent extends AbstractAgent { // Local agent - use the agent's stream method directly try { const response = await this.agent.stream(convertedMessages, { - threadId, - resourceId, runId, clientTools, runtimeContext, + memory: { + resource: resourceId, + thread: { + id: threadId + } + }, + + // Deprecated but still set for compatability + threadId, + resourceId }); // For local agents, the response should already be a stream @@ -332,11 +340,20 @@ export class MastraAgent extends AbstractAgent { // Remote agent - use the remote agent's stream method try { const response = await this.agent.stream({ - threadId, - resourceId, runId, messages: convertedMessages, clientTools, + + memory: { + resource: resourceId, + thread: { + id: threadId + } + }, + + // Deprecated but still set for compatability + threadId, + resourceId }); // Remote agents should have a processDataStream method From 8eccad8f512c4d7d78b9bb11eee8d3cd7722d84a Mon Sep 17 00:00:00 2001 From: Craig Michael Thompson Date: Wed, 19 Nov 2025 10:29:45 +0000 Subject: [PATCH 2/2] Update integrations/mastra/typescript/src/mastra.ts --- integrations/mastra/typescript/src/mastra.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/integrations/mastra/typescript/src/mastra.ts b/integrations/mastra/typescript/src/mastra.ts index 159e3fa3c..cfed6fe98 100644 --- a/integrations/mastra/typescript/src/mastra.ts +++ b/integrations/mastra/typescript/src/mastra.ts @@ -343,7 +343,6 @@ export class MastraAgent extends AbstractAgent { runId, messages: convertedMessages, clientTools, - memory: { resource: resourceId, thread: {