Skip to content

Commit a520cc9

Browse files
committed
make it work with mastra
1 parent 32cb2c7 commit a520cc9

File tree

1 file changed

+2
-2
lines changed
  • typescript-sdk/integrations/mastra/src

1 file changed

+2
-2
lines changed

typescript-sdk/integrations/mastra/src/mastra.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class MastraAgent extends AbstractAgent {
5656
super(rest);
5757
this.agent = agent;
5858
this.resourceId = resourceId;
59-
this.runtimeContext = runtimeContext;
59+
this.runtimeContext = runtimeContext ?? new RuntimeContext();
6060
}
6161

6262
protected run(input: RunAgentInput): Observable<BaseEvent> {
@@ -250,7 +250,7 @@ export class MastraAgent extends AbstractAgent {
250250
);
251251
const resourceId = this.resourceId ?? threadId;
252252
const convertedMessages = convertAGUIMessagesToMastra(messages);
253-
this.runtimeContext?.set('ag-ui', inputContext);
253+
this.runtimeContext?.set('ag-ui', { context: inputContext });
254254
const runtimeContext = this.runtimeContext;
255255

256256
if (this.isLocalMastraAgent(this.agent)) {

0 commit comments

Comments
 (0)