feat(ai): interrupt tool batch on queued messages

This commit is contained in:
Peter Steinberger 2025-12-20 16:15:40 +01:00 committed by Mario Zechner
parent 6a319f9c3c
commit 117af076c4
3 changed files with 242 additions and 6 deletions

View file

@ -795,6 +795,8 @@ The Agent API streams events during execution, allowing you to build reactive UI
This continues until the assistant produces a response without tool calls.
**Queued messages**: If you provide `getQueuedMessages` in the loop config, the agent checks for queued user messages after each tool call. When queued messages are found, any remaining tool calls from the current assistant message are skipped and returned as error tool results (`isError: true`) with the message "Skipped due to queued user message." The queued user messages are injected before the next assistant response.
### Event Flow Example
Given a prompt asking to calculate two expressions and sum them:
@ -1139,4 +1141,4 @@ If you get "The requested model is not supported" error, enable the model manual
## License
MIT
MIT