Commit c2b9547
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- .changeset
- e2e-tests/create-mastra
- packages/core/src
- agent
- __tests__
- stream/base
- tools/tool-builder
6 files changed
+478
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
0 commit comments