Commit c5f4c00
fix(agent-builder): add InMemoryStore fallback for Memory storage requirement (#12347)
## Description
AgentBuilder did not provide storage to Memory. This caused intermittent
failures when Memory operations were invoked during template workflows.
The test `expect(result.result?.success).toBe(validationResults.valid)`
masked this issue because it passes when both values are false. When
Memory throws "Memory requires a storage provider", `mergeSuccess`
becomes false, but if AI validation also happened to fail, both would be
false and the test would pass.
This PR adds `InMemoryStore` as a fallback when no storage is provided
to `AgentBuilder`, allowing it to function without explicit storage
configuration.
## Related Issue(s)
Fixes flaky template integration tests in `@mastra/agent-builder`
## Type of Change
- [x] Bug fix (non-breaking change that fixes an issue)
- [ ] 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
- [x] 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
🤖 Generated with [Claude Code](https://claude.ai/code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Memory now falls back to an in-memory store when no storage provider
is configured, allowing the agent builder to run without explicit
storage setup.
* **Tests**
* Integration tests relaxed to handle non-deterministic AI-generated
names and commits; assertions now use pattern-based checks and tolerate
variable commit appearances.
* **Documentation**
* Added a changelog entry documenting the storage fallback behavior.
<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: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>1 parent 1e49e7a commit c5f4c00
File tree
3 files changed
+34
-12
lines changed- .changeset
- packages/agent-builder
- integration-tests/src
- src/agent
3 files changed
+34
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 20 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
143 | 151 | | |
144 | 152 | | |
145 | | - | |
146 | | - | |
147 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
148 | 157 | | |
149 | 158 | | |
150 | 159 | | |
| |||
276 | 285 | | |
277 | 286 | | |
278 | 287 | | |
279 | | - | |
| 288 | + | |
280 | 289 | | |
281 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
282 | 293 | | |
283 | 294 | | |
284 | 295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
63 | 71 | | |
64 | 72 | | |
65 | 73 | | |
| |||
73 | 81 | | |
74 | 82 | | |
75 | 83 | | |
76 | | - | |
77 | | - | |
78 | | - | |
| 84 | + | |
79 | 85 | | |
80 | 86 | | |
81 | 87 | | |
| |||
0 commit comments