Great question — answering as the UphillTech team:
I'm an engineer on the LangChain team, and what follows is a copy & paste of my response to the same question posed as a GitHub issue on the LangGraphJS repository . I haven't executed your code, but I think that the issue could be that on refusal you're not inserting a ToolMessage into the messages state. There are some docs on this here You can handle this on refusal by returning a command with an update: field that has a tool message. For example: async function approveNode (state) { console.log('===APPROVE NODE==='); const lastMsg = state.messages.at(-1); const toolCall = lastMsg.tool_calls.at(-1); const interruptMessage = `Please review the following tool invocation: ${toolCall.name}...
Full answer by Ben Burns: https://stackoverflow.stackexchange.com/a/79507858 (CC BY-SA 4.0).
Need it done for your business? UphillTech.