Mastra Scopes settled() to One Thread
Mastra’s @mastra/memory adds optional threadId and resourceId scoping to settled(), so callers can await one thread’s Observational Memory work without draining every thread.
Small API change, meaningful concurrency win: `settled()` becomes a precise lifecycle boundary for multi-threaded agent systems.
- –Unscoped `settled()` remains global, preserving existing behavior; scoped calls wait only on the specified thread.
- –This matters because Observational Memory runs Observer and Reflector tasks in the background, requiring settlement before storage shutdown. [Mastra Memory docs](https://mastra.ai/docs/memory/overview)
- –The change aligns with Mastra’s thread-scoped memory direction, while resource-scoped Observational Memory is deprecated. [Observational Memory docs](https://mastra.ai/docs/memory/observational-memory)
- –Developers running concurrent agents, test suites, or serverless handlers can now avoid unrelated threads becoming teardown bottlenecks.
DISCOVERED
20m ago
2026-11-09
PUBLISHED
1h ago
2026-11-09
RELEVANCE
AUTHOR
mastra