#useLangGraphInterrupt seems to force resume a node

1 messages · Page 1 of 1 (latest)

misty stump
#

I have a node that takes user input and uses the input to update the message. Then it goes to the next node. The node returns
Command(
resume=user_input,
update={
"messages": [
user_input,
]
},
goto="<next-node>",
)
However, from the LangSmith traces, I'm seeing {"graph":null,"update":null,"resume":"<user input>","goto":null} being returned from the UI, causing the conversation to be stuck. Is this a correct observation? And how do I resolve this? Thanks!

dapper drift
#

Hi @misty stump, UI is only returning the resume field, causing the conversation to stall because your node isn’t handling the resume input properly. Have you had a chance to check this CopilotKit example.

misty stump
#

@dapper drift Thanks. This example doesn't use interrupt though. What exactly does the UI return? Is it an instance of Command? It doesn't seem to be just purely user input

exotic adder
misty stump
#

Thanks @exotic adder! This is helpful. Is it possible to modify it to fit my use case? I want to use the update and goto fields as well.
My (multi)-agent app works on the studio but fails when integrated wiith copilotkit

misty stump
#

I tried the following but it didn't work

    """Ask the user for input."""
    # Get the Command object from the frontend
    command = interrupt(state.messages[-1].content)

    # Modify the Command object
    modified_command = Command(
        resume=command.resume,  # Use the original resume value
        update={
            "messages": [
                command.resume,  # Add the resume value to messages
            ]
        },
        goto="next_agent",
    )```
severe carbon
#

Hi @misty stump, would you mind opening a GitHub Issue as it sounds like adding the other fields would be a feature request and this seems reasonable?

misty stump
#

Yeah sure, will do!