This happens because we are not saving the CELL_UPDATE tool failure message in the display_optimized_message_history.
Probably what we need to do is:
- Send the CELL_UPDATE tool failure to the frontend in the on_tool_result callback AND save it to the display_optimized_chat_history
- Make sure that we don't display it as user message in the frontend (this should already be the case, I think)
This happens because we are not saving the CELL_UPDATE tool failure message in the display_optimized_message_history.
Probably what we need to do is: