Bug Description
If Memory's flushing limit is set low enough such that one conversation turn is enough to make it overflow and trigger the flushing behavior, it is possible to end up with a list of active messages that begin with a assistant message instead of a user message.
Some providers like Amazon Bedrock do not allow this and return an error, since they require that the first message be a user message.
Version
0.12.52.post1
Steps to Reproduce
- Create FunctionTool such that the token count returned by the tool triggers Memory's flushing behavior
- Create any chat
- Observe that the remaining message in the active queue is only the latest assistant reply
Relevant Logs/Tracbacks