Repository navigation
fix(workflow): sync conversation variables after iteration frames - #43329
Closed
Souravrajvi0 wants to merge 3 commits into
Closed
Souravrajvi0 wants to merge 3 commits into
Souravrajvi0 wants to merge 3 commits into
Conversation
6 tasks done
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-10-11 03:36:53.975535590 +0000
+++ /tmp/pyrefly_pr.txt 2026-10-11 03:36:45.907497421 +0000
@@ -4913,15 +4913,11 @@
ERROR Argument `core.workflow.nodes.human_input.entities.HumanInputNodeData` is not assignable to parameter `data` with type `graphon.nodes.human_input.entities.HumanInputNodeData` in function `graphon.nodes.human_input.human_input_node.HumanInputNode.__init__` [bad-argument-type]
--> tests/unit_tests/core/workflow/graph_engine/test_parallel_human_input_join_resume.py:222:14
ERROR Argument `Sequence[type[GraphEngineEvent]]` is not assignable to parameter `expected_sequence` with type `list[type[GraphEngineEvent]]` in function `TableTestRunner._validate_event_sequence` [bad-argument-type]
- --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:352:21
+ --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:354:21
ERROR `graph` is uninitialized [unbound-name]
- --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:405:23
+ --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:407:23
ERROR `graph_runtime_state` is uninitialized [unbound-name]
- --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:406:37
-ERROR Argument `str` is not assignable to parameter `object` with type `LiteralString` in function `list.append` [bad-argument-type]
- --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:634:23
-ERROR Argument `str` is not assignable to parameter `object` with type `LiteralString` in function `list.append` [bad-argument-type]
- --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:635:23
+ --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:408:37
ERROR Argument `str` is not assignable to parameter `object` with type `LiteralString` in function `list.append` [bad-argument-type]
--> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:636:23
ERROR Argument `str` is not assignable to parameter `object` with type `LiteralString` in function `list.append` [bad-argument-type]
@@ -4929,15 +4925,19 @@
ERROR Argument `str` is not assignable to parameter `object` with type `LiteralString` in function `list.append` [bad-argument-type]
--> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:638:23
ERROR Argument `str` is not assignable to parameter `object` with type `LiteralString` in function `list.append` [bad-argument-type]
- --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:646:31
+ --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:639:23
ERROR Argument `str` is not assignable to parameter `object` with type `LiteralString` in function `list.append` [bad-argument-type]
- --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:648:35
+ --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:640:23
+ERROR Argument `str` is not assignable to parameter `object` with type `LiteralString` in function `list.append` [bad-argument-type]
+ --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:648:31
ERROR Argument `str` is not assignable to parameter `object` with type `LiteralString` in function `list.append` [bad-argument-type]
--> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:650:35
ERROR Argument `str` is not assignable to parameter `object` with type `LiteralString` in function `list.append` [bad-argument-type]
--> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:652:35
ERROR Argument `str` is not assignable to parameter `object` with type `LiteralString` in function `list.append` [bad-argument-type]
- --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:661:27
+ --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:654:35
+ERROR Argument `str` is not assignable to parameter `object` with type `LiteralString` in function `list.append` [bad-argument-type]
+ --> tests/unit_tests/core/workflow/graph_engine/test_table_runner.py:663:27
ERROR Class member `FakeBindingResolver.resolve` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
--> tests/unit_tests/core/workflow/nodes/agent_v2/test_agent_node.py:146:9
ERROR Argument `tuple[WorkflowAgentSessionScope, str, SessionSnapshot | None]` is not assignable to parameter `object` with type `tuple[WorkflowAgentSessionScope, str, SessionSnapshot | None, str | None, str | None]` in function `list.append` [bad-argument-type]
@@ -5745,19 +5745,19 @@
ERROR Object of class `object` has no attribute `tool` [missing-attribute]
--> tests/unit_tests/core/workflow/test_node_runtime.py:887:12
ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `GraphRuntimeState` in function `core.workflow.workflow_entry.WorkflowEntry.__init__` [bad-argument-type]
- --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:62:29
+ --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:63:29
ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `GraphRuntimeState` in function `core.workflow.workflow_entry.WorkflowEntry.__init__` [bad-argument-type]
- --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:119:37
+ --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:120:37
ERROR Class member `EmptySplitKey.split` overrides parent class `UserString` in an inconsistent manner [bad-override]
- --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:708:17
+ --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:710:17
ERROR Class member `EmptySplitKey.split` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
- --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:708:17
+ --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:710:17
ERROR `TestMappingUserInputsBranches.test_rejects_invalid_node_variable_key.EmptySplitKey` is not assignable to dict key type `str` [bad-assignment]
- --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:713:35
+ --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:715:35
ERROR Argument `TestWorkflowEntryNodeLayers.test_run_node_with_layers_reports_success.FakeNode` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.workflow.workflow_entry.WorkflowEntry._run_node_with_layers` [bad-argument-type]
- --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:782:78
+ --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:784:78
ERROR Argument `TestWorkflowEntryNodeLayers.test_run_node_with_layers_reports_errors.FakeNode` is not assignable to parameter `node` with type `Node[Unknown]` in function `core.workflow.workflow_entry.WorkflowEntry._run_node_with_layers` [bad-argument-type]
- --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:816:73
+ --> tests/unit_tests/core/workflow/test_workflow_entry_helpers.py:818:73
ERROR Missing argument `case` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
--> tests/unit_tests/enterprise/telemetry/test_contracts.py:110:30
ERROR Missing argument `tenant_id` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
|
Contributor
Pyrefly Type Coverage
|
Contributor
|
@Souravrajvi0 Please fix the CI checks and we can process this PR. |
Stream29
self-requested a review
October 10, 2026 13:27
Reintroduce propagation of conversation-scoped variable updates from iteration subgraphs to the parent variable pool, which was lost when workflow execution moved into Graphon. Wire a Dify iteration container handler into GraphEngine and restore the table-driven regression test. Fixes langgenius#43312
Replace subclassing the final Graphon IterationContainerHandler with a delegating container handler, update WorkflowEntry test expectations, and add the missing test return annotation for pyrefly.
Souravrajvi0
force-pushed
the
feat/iteration-conversation-variable-sync-0f01
branch
from
October 10, 2026 13:37
1e40d99 to
cff2b47
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #43329 +/- ##
=======================================
Coverage 88.81% 88.82%
=======================================
Files 5319 5320 +1
Lines 329341 329402 +61
Branches 66005 66010 +5
=======================================
+ Hits 292520 292578 +58
Misses 31592 31592
- Partials 5229 5232 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
Closing in favor of the planned Graphon fix in #43312. The issue remains open until Dify integrates and verifies the fix. |
This was referenced Oct 21, 2026
Conversation variable writes inside an Iteration never reach the parent frame
langgenius/graphon#350
Closed
2 of 5 tasks
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.
Important
Fixes #<issue number>.Summary
Fixes #43312 (regression of #26367).
When workflow execution moved into the Graphon package, iteration subgraphs stopped propagating
conversation.*variable updates back to the parent variable pool. Conversation variables written inside an iteration were visible during the iteration but reverted after it finished, breaking downstream Answer nodes.This PR registers a Dify
IterationContainerHandlersubclass that syncs conversation-scoped variables from each completed iteration frame to the parent pool before scheduling the next frame. The table-driven regression test from #26368 is restored.Screenshots
Checklist
make lint && make type-check(backend) andvp staged(frontend) to appease the lint gods