You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gcgj-dify-1.7.0/api/core
xuzijie1995 db91643915 refactor(workflow): Rearchitect stream dependency logic for complex graphs
This commit addresses a critical issue where streaming output would fail in workflows with complex topologies, particularly those involving multiple conditional branches (if/else) that converge on a common node before the LLM and Answer nodes.

The root cause was twofold:
1. A bug in the branch pruning logic () that would incorrectly remove shared downstream nodes, leading to a premature emptying of the  list.
2. A flawed static dependency analysis () that could not correctly resolve dependencies for nodes that were part of multiple, mutually exclusive execution paths.

This refactor introduces a new, robust architecture for streaming dependency management based on the principle of "Static Pre-pruning + Dynamic Adjudication":

- **Fix**: The branch pruning logic in  is now non-recursive and conservative. It only prunes the immediate first node of an unreachable branch, preserving the integrity of shared downstream paths and join points.

- **Refactor**: The old static dependency analysis has been completely removed. This includes deleting the  attribute from the  entity and deleting the associated recursive dependency fetching methods (, ).

- **Feat**: A new method, , has been implemented in . This method performs a real-time, backward traversal of the graph from the streaming node, querying the runtime execution state () to dynamically validate if the *actual* dependency path has been successfully completed. This ensures that streaming decisions are based on the ground truth of the current execution, not a flawed static prediction.

- **Doc**: Added comprehensive docstrings and comments to the modified components to explain the new architecture and the rationale behind the changes.
10 months ago
..
agent Support OAuth Integration for Plugin Tools (#22550) 10 months ago
app Fix/replace datetime patterns with naive utc now (#22654) 10 months ago
base refactor: Remove RepositoryFactory (#19176) 1 year ago
callback_handler Refactor/message cycle manage and knowledge retrieval (#20460) 11 months ago
entities feat: Add Citations and Attributions to Agent Node (#18558) 10 months ago
errors fix(core/errors): change base class of custom exceptions to ValueError (#11955) 1 year ago
extension refactor: Improve model status handling and structured output (#20586) 11 months ago
external_data_tool Enhance Code Consistency Across Repository with `.editorconfig` (#19023) 1 year ago
file fix: drop dead code phase2 unused class (#22042) 10 months ago
helper refactor: Fix some type error (#22594) 10 months ago
llm_generator fix: use model provided by user in prompt generator (#22541) (#22542) 10 months ago
mcp chore: code improvement for mcp_client and mcp_tools_manage_service (#22645) 10 months ago
memory feat(api/repo): Allow to config repository implementation (#21458) 10 months ago
model_runtime feat: add support for dark icons in provider and tool entities (#22081) 10 months ago
moderation Enhance Code Consistency Across Repository with `.editorconfig` (#19023) 1 year ago
ops fix: correct tracing for workflows and chatflows for phoenix (#22547) 10 months ago
plugin Support OAuth Integration for Plugin Tools (#22550) 10 months ago
prompt refactor: decouple Node and NodeData (#22581) 10 months ago
rag fix text splitter (#22596) 10 months ago
repositories feat(workflow_cycle_manager): Removes redundant repository methods and adds caching (#22597) 10 months ago
tools chore: code improvement for mcp_client and mcp_tools_manage_service (#22645) 10 months ago
variables minor code fix: remove duplicate type check branch (#22536) 10 months ago
workflow refactor(workflow): Rearchitect stream dependency logic for complex graphs 10 months ago
__init__.py chore(api/core): apply ruff reformatting (#7624) 2 years ago
hosting_configuration.py chore(provider_manager): Update hosted model's name (#14334) 1 year ago
indexing_runner.py fix: document delete image files check file exist (#21991) 10 months ago
model_manager.py unreachable-code for lb model fetch. (#20797) 11 months ago
provider_manager.py refactor: Improve model status handling and structured output (#20586) 11 months ago