Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LangGraph human-in-the-loop (interrupt approvals) is implemented incorrectly #1280

Open
n-sviridenko opened this issue Dec 28, 2024 · 4 comments

Comments

@n-sviridenko
Copy link
Author

n-sviridenko commented Dec 28, 2024

And one more thing, out of topic, but putting here to not forget.

When calling runtime.thread.subscribe() in combination with useThreadRuntime().getState(), it only has messages in the passed state, and I don't see a way to get the whole langgraph state values w/o manually calling langgraph APIs directly, which adds a redundant API call.

@n-sviridenko
Copy link
Author

Also, somehow thread id is not stored in the thread state:

Screenshot 2024-12-28 at 12 34 59

@Yonom
Copy link
Owner

Yonom commented Dec 28, 2024

Thank you for flagging these!

I believe the new interrupt API was added after the stockbroker example was created. I still need to add support for it :)

Three issues:

  1. feat: support new interrupt API
  2. feat: add a standard way of streaming and syncing state (outside of messages)
  3. feat: pass threadId via ThreadListItem / thread.metadata state

For 2.: for the time being you can add additional streaming options when calling LangGraph APIs, then intercept langgraph's response stream (in onNew) to synchronize, say, a zustand store

@Yonom
Copy link
Owner

Yonom commented Jan 3, 2025

#1299

here's the proposed API for interrupt + Command flow

const sendCommand = useLangGraphRuntimeSendCommand();
sendCommand({
  resume: "your value"
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants