Skip to content

fix(workflow): avoid exponential response path enumeration on LTS 1.13 - #46589

Merged
wylswz merged 2 commits into
lts/1.13.xfrom
laipz8200/eng-1501-lts-response-reachability
Nov 18, 2026
Merged

wylswz merged 2 commits into
lts/1.13.xfrom
laipz8200/eng-1501-lts-response-reachability

Conversation

@laipz8200

Copy link
Copy Markdown
Member

Fixes ENG-1501.

Summary

Reconverging branches can create trillions of complete paths in a small workflow, causing response registration to hang the worker before execution starts. Replace complete-path enumeration with reachability over nonblocking and observed taken edges. Each search visits each node once while preserving selector-dependent blocking and ordered early streaming.

Store observed edge decisions in version 2 coordinator snapshots. Existing version 1 snapshots retain their residual path conditions when restored. Version 2 snapshots require patched workers.

LTS context

Based on the latest lts/1.13.x commit, fd0f575fcc316e207f025712e44bbdcdef9e80a0. This is a direct fix for the LTS implementation: Dify main uses Graphon, and the related upstream fix in langgenius/graphon#400 is still a draft. There is no equivalent Dify main commit to cherry-pick yet.

Replace complete-path enumeration with bounded reachability over nonblocking and observed taken edges, preventing reconverging branches from hanging workers before execution.

Persist observed edge decisions in version 2 coordinator snapshots while preserving residual path conditions when restoring version 1 snapshots. Cover graph traversal bounds, activation semantics, streaming output, and checkpoint compatibility.
@laipz8200
laipz8200 requested a review from a team November 17, 2026 09:59
@github-actions github-actions Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 39.08% 39.11% +0.03%
Strict coverage 38.48% 38.51% +0.03%
Typed symbols 19,955 19,980 +25
Untyped symbols 31,594 31,594 0
Modules 2869 2870 +1

Wait for the consumer to receive all published messages before closing the Redis subscription. Closing as soon as producers finish races with the listener and can discard the final messages under CI load. Keep cleanup in a finally block so failures still stop the subscriber.
@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 7 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (lts/1.13.x@fd0f575). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...h/graph_engine/response_coordinator/coordinator.py 80.00% 3 Missing and 4 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             lts/1.13.x   #46589   +/-   ##
=============================================
  Coverage              ?   53.52%           
=============================================
  Files                 ?     1334           
  Lines                 ?   107407           
  Branches              ?    13298           
=============================================
  Hits                  ?    57485           
  Misses                ?    47747           
  Partials              ?     2175           
Flag Coverage Δ
api 53.52% <80.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wylswz
wylswz merged commit 202caf1 into lts/1.13.x Nov 18, 2026
12 of 13 checks passed
@wylswz
wylswz deleted the laipz8200/eng-1501-lts-response-reachability branch November 18, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants