Repository navigation
fix: resolve activeInterruptEvent global state pollution across threads - #2026
the-waste-land wants to merge 1 commit into
Conversation
⏭️ Changeset Not RequiredLatest commit: 76ab2c0 No changes in this PR affected the Changeset is not required for this PR. |
|
@the-waste-land is attempting to deploy a commit to the CopilotKit Team on Vercel. A member of the Team first needs to authorize it. |
|
Fix the issue: #1991 |
|
Great contribution! Much appreciated! |
I found there's still an issue when I have two Node.js instances running the CopilotKit runtime. |
|
Maybe we could get the activeInterruptEvent state from the LangGraph thread state. |
|
@the-waste-land I wouldn't worry about this too much. As you can see there, we are not saving the interrupt anywhere, but rather fetching it before calling the stream. This way we can say "hold on, can we even stream or are there any pending interrupt events". This approach is not exclusive to AG-UI, so it can also be implemented here. It's indeed what you mentioned as "get the activeInterruptEvent state from the LangGraph thread state" If you see issues with the approach you have implemented, I can look into syncing the two implementations and bringing this concept to "remote-lg-action" |
|
#2031 I have created this which follows the AGUI implementation |
Great! Looking forward to the new version. |
What does this PR do?
This PR fixes a global state pollution issue in the LangGraph integration where the
activeInterruptEventvariable was shared across all threads, causing concurrent requests from different browser tabs to interfere with each other.Changes:
activeInterruptEventto thread-specific state management usingMap<threadId, boolean>command.resumebeing added to unrelated thread requestsProblem solved:
command.resumein the payload'NoneType' object is not iterableerrors on the LangGraph server sideRelated PRs and Issues
Checklist