This probably applies to other types of messages, but I've only observed with it happening with context messages.
What ends up happening is that two OpenAI API messages containing tool calls get put one after the other in the openaiMessages array, which is a problem because a message containing a tool call must be followed by a message containing the result of that tool call. It's not clear to me how this happens, but I've only observed it happening when messages are received in rapid succession.
This probably applies to other types of messages, but I've only observed with it happening with
contextmessages.What ends up happening is that two OpenAI API messages containing tool calls get put one after the other in the
openaiMessagesarray, which is a problem because a message containing a tool call must be followed by a message containing the result of that tool call. It's not clear to me how this happens, but I've only observed it happening when messages are received in rapid succession.