Interrupt(). How to interrupt for the second time #393

Closed
opened 2026-02-20 17:39:53 -05:00 by yindo · 2 comments
Owner

Originally created by @Saisiva123 on GitHub (Jan 9, 2025).

Checked other resources

  • This is a bug, not a usage question. For questions, please use GitHub Discussions.
  • I added a clear and detailed title that summarizes the issue.
  • I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
  • I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue.

Example Code

def ask_user_node(state: LookupState) -> Command[Literal['lookup_node']]:
        agent_request = state['userAgentInteractionInfo']['agentRequest']

        if 'userResponse' in state['userAgentInteractionInfo']:
            del state['userAgentInteractionInfo']['userResponse']

        user_response = interrupt({
            'id': str(uuid.uuid4()),
            'request': agent_request
        })

        if user_response:
            return Command(goto='lookup_node',
                           resume={'userAgentInteractionInfo': {'agentRequest': agent_request}},
                           update={'messages': [HumanMessage(content=user_response, name="User_Response")], 'userAgentInteractionInfo': {'agentRequest': '', 'userResponse': ''}})

Error Message and Stack Trace (if applicable)

No response

Description

I know the default behavior of interrupt will invoke GraphInterrupt for the first time. When the same node has the interrupt its not halting the execution instead its taking the same old cached value, so is there any extra argument that I can pass so that the interrupt will halt the execution for the second time and wait for the user input

System Info

python -m langchain_core.sys_info

Originally created by @Saisiva123 on GitHub (Jan 9, 2025). ### Checked other resources - [X] This is a bug, not a usage question. For questions, please use GitHub Discussions. - [X] I added a clear and detailed title that summarizes the issue. - [X] I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example). - [X] I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue. ### Example Code ```python def ask_user_node(state: LookupState) -> Command[Literal['lookup_node']]: agent_request = state['userAgentInteractionInfo']['agentRequest'] if 'userResponse' in state['userAgentInteractionInfo']: del state['userAgentInteractionInfo']['userResponse'] user_response = interrupt({ 'id': str(uuid.uuid4()), 'request': agent_request }) if user_response: return Command(goto='lookup_node', resume={'userAgentInteractionInfo': {'agentRequest': agent_request}}, update={'messages': [HumanMessage(content=user_response, name="User_Response")], 'userAgentInteractionInfo': {'agentRequest': '', 'userResponse': ''}}) ``` ### Error Message and Stack Trace (if applicable) _No response_ ### Description I know the default behavior of interrupt will invoke GraphInterrupt for the first time. When the same node has the interrupt its not halting the execution instead its taking the same old cached value, so is there any extra argument that I can pass so that the interrupt will halt the execution for the second time and wait for the user input ### System Info python -m langchain_core.sys_info
yindo closed this issue 2026-02-20 17:39:53 -05:00
Author
Owner

@Saisiva123 commented on GitHub (Jan 9, 2025):

There are many developers who are facing this issue, it would be nicer for the langgraph team to consider this issue as priority.

@Saisiva123 commented on GitHub (Jan 9, 2025): There are many developers who are facing this issue, it would be nicer for the langgraph team to consider this issue as priority.
Author
Owner

@vbarda commented on GitHub (Jan 9, 2025):

This is a duplicate of #2935

@vbarda commented on GitHub (Jan 9, 2025): This is a duplicate of #2935
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#393