You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: add processInputStep response id rotation (#13887)
This adds the ability for `processInputStep` to rotate the active
response message id, and wires the loop to honor that rotated id through
streamed output and persistence.
Before, the active response id was effectively fixed for the lifetime of
the response. After, a processor can explicitly request a new response
id during `processInputStep`, and the rest of the loop keeps using that
new id consistently.
```ts
// before
processInputStep({ messageId })
// response continues under the original id
```
```ts
// after
processInputStep({ messageId, rotateResponseMessageId })
// response continues under the rotated id
```
This also adds the small observational-memory compatibility guard needed
for that new core capability, so OM fails fast when paired with an older
`@mastra/core` that doesn't support response id rotation yet.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Response message ID rotation during processor execution and streaming.
* New core feature flag: request-response-id-rotation.
* **Bug Fixes**
* Streamed assistant IDs and persisted memory now use the rotated
response ID.
* Avoid merging when a replacement target is sealed to preserve message
integrity.
* **Chores**
* Observational Memory now fails fast if core lacks rotation support.
* **Tests**
* Added tests verifying rotation behavior across processors and
streaming.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Mastra Code (openai/gpt-5.3-codex) <noreply@mastra.ai>
Copy file name to clipboardExpand all lines: packages/core/src/agent/message-list/message-list.ts
+10-9Lines changed: 10 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -824,16 +824,17 @@ export class MessageList {
824
824
}
825
825
}
826
826
}
827
-
// If the last message is an assistant message and the new message is also an assistant message, merge them together and update tool calls with results
828
-
// Use MessageMerger to handle the complex merge logic
0 commit comments