Skip to content

Commit c2b9547

Browse files
add resumeGenerate to agent (#11503)
## Description <!-- Provide a brief description of the changes in this PR --> - [x] Add `resumeGenerate` method for resuming agent via generate - [x] Add `runId` and `suspendPayload` to fullOuput of agent stream - [x] Fix `suspendedToolRunId: null` sometimes breaking `agent.stream` ## Related Issue(s) <!-- Link to the issue(s) this PR addresses, using hashtag notation: #123 --> #11485 ## Type of Change - [x] Bug fix (non-breaking change that fixes an issue) - [x] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [x] Test update ## Checklist - [ ] I have made corresponding changes to the documentation (if applicable) - [x] I have added tests that prove my fix is effective or that my feature works <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Resume suspended agent executions via a new generate-based resume API. * Agent output now exposes runId and suspendPayload for clearer result context. * **Bug Fixes** * suspendedToolRunId now defaults to an empty string to avoid null/undefined issues. * **Tests** * Added tests covering generate-based suspend/resume flows across tools and workflows. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>
1 parent ff82d0a commit c2b9547

File tree

6 files changed

+478
-4
lines changed

6 files changed

+478
-4
lines changed

.changeset/silent-ends-lick.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@mastra/core': patch
3+
---
4+
5+
Add `resumeGenerate` method for resuming agent via generate
6+
Add `runId` and `suspendPayload` to fullOutput of agent stream
7+
Default `suspendedToolRunId` to empty string to prevent `null` issue

e2e-tests/create-mastra/create-mastra.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ describe('create mastra', () => {
144144
"weatherTool": {
145145
"description": "Get current weather for a location",
146146
"id": "get-weather",
147-
"inputSchema": "{"json":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"location":{"description":"City name","type":"string"}},"required":["location"],"additionalProperties":false}}",
147+
"inputSchema": "{"json":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"location":{"type":"string","description":"City name"}},"required":["location"],"additionalProperties":false}}",
148148
"outputSchema": "{"json":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"temperature":{"type":"number"},"feelsLike":{"type":"number"},"humidity":{"type":"number"},"windSpeed":{"type":"number"},"windGust":{"type":"number"},"conditions":{"type":"string"},"location":{"type":"string"}},"required":["temperature","feelsLike","humidity","windSpeed","windGust","conditions","location"],"additionalProperties":false}}",
149149
"requireApproval": false,
150150
},

0 commit comments

Comments
 (0)