fix(webapp): abort workflow stream on human input pause - #39775
Open
Souravrajvi0 wants to merge 1 commit into
Open
fix(webapp): abort workflow stream on human input pause#39775Souravrajvi0 wants to merge 1 commit into
Souravrajvi0 wants to merge 1 commit into
Conversation
When a WebApp workflow pauses for human input, keep the initial POST
stream from competing with the resume SSE. Abort the active stream
before opening /workflow/{id}/events and ignore stale Stopped events
from the aborted connection.
Fixes langgenius#39686
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #39686
When a WebApp workflow pauses for human input, the initial
sendWorkflowMessagePOST stream stayed open while a resume SSE (/workflow/{id}/events) was opened. Both streams could deliver conflicting events — the aborted POST stream often emittedworkflow_finishedwithStoppedstatus, causing the UI to show "Stopped by user" even though the worker completed successfully.This change:
getAbortControllerworkflow_pausedStoppedevents from the initial stream while the workflow is pausedScreenshots
Checklist
make lint && make type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint gods