I’m developing an agent using LangGraph. My main graph nests two subgraphs. I’ve noticed that LangGraph doesn’t natively support an interruption mechanism—by “interruption,” I mean the ability for a user to manually terminate execution at any node and immediately send a new message to continue the conversation. To address this, I’ve wrapped the execution in a Python async manager, using something similar to asyncio.CancelledError to cancel the ongoing run. However, when I restart the conversation, the checkpointed messages are always missing some content, making it difficult to properly restore and continue the dialogue from where it left off.
I’d like the state of all nodes executed prior to termination to be preserved when the interruption occurs. Could you please explain why this is happening, or suggest a more elegant way to handle such interruptions?
Thank you very much for your time—I’d greatly appreciate a prompt reply.