Gemini API call errors due to empty reasoning message
AgentMemory
Using Gemini 3 flash + a mastra-built agent. I recently turned on reasoning tokens for my agent. Since that change we've seen some "poisoned" conversations due to a message in the history having an emty reasoning part
Our agent has message memory on, so after the user gets 1 bad message, all subsequent messages fail with:
Unable to submit request because it must include at least one parts field, which describes the prompt input
Unable to submit request because it must include at least one parts field, which describes the prompt input
Ideally we'd filter out these invalid message parts when sending the next message to the agent. However, there's no way I can filter them out on my side unless we manually handle message memory ourselves.