@Logan M Thanks for your reply. It's a bit tricky to create a google colab version because the interaction happens in realtime over websockets. The specific use case I'm debugging is the user disconnecting (navigating away from the page...) and returning later. The context gets serialized as you suggested. But when the user comes back later, establishes a new websocket connection, and starts interacting with the agent to reply to the latest message, after 2 iterations I get:
llama_index.core.workflow.errors.WorkflowRuntimeError: Error in step 'run_agent_step': Error code: 400 - {'error': {'message': "Invalid parameter: Duplicate value for 'tool_call_id' of 'call_GwlY8eGG80cPcXhEhw5OSMP0', in messages[6] and messages[7].", 'type': 'invalid_request_error', 'param': 'messages.[7].tool_call_id', 'code': None}}