Skip to content

fix(fail-branch): prevent streaming output in exception branches #17153

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

Merged
merged 2 commits into from
Apr 16, 2025

Conversation

Nov1c444
Copy link
Collaborator

Summary

Prevent streaming output in exception branches.

Screenshots

Before After
image image

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

@Nov1c444 Nov1c444 requested a review from laipz8200 March 31, 2025 02:05
@Gevtolev Gevtolev marked this pull request as ready for review April 8, 2025 01:29
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. 🐞 bug Something isn't working labels Apr 8, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 16, 2025
@crazywoola crazywoola requested a review from Copilot April 16, 2025 13:12
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

A concise PR that fixes the issue of streaming output occurring in exception branches by updating stream routing logic and adding a new test.

  • Modified test cases to verify that streaming output no longer occurs in exception branches.
  • Updated stream processor logic to remove the current node id from answer dependencies when evaluating success branch edges.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
api/tests/unit_tests/core/workflow/nodes/test_continue_on_error.py Adds tests to ensure streaming is prevented in exception branches, including verifying event types.
api/core/workflow/nodes/answer/answer_stream_processor.py Updates comment and edge selection logic to correctly remove node dependencies for successful branch streaming.

@laipz8200 laipz8200 merged commit c91045a into main Apr 16, 2025
9 checks passed
@laipz8200 laipz8200 deleted the fix/fail-branch-stream branch April 16, 2025 14:34
@laipz8200
Copy link
Member

Please remember to open an issue before creating a pull request.

@Nov1c444
Copy link
Collaborator Author

Please remember to open an issue before creating a pull request.

Got it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants