Pure-graph parallel dispatch runs all next-nodes concurrently whenever len > 1, ignoring each node's parallel flag #97
Labels
No labels
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
#77 Epic: LLM Agent Runtime Stabilization — reliability, resource enforcement & correctness hardening
cleveragents/cleveractors-core
#98 TDD: Pure-graph parallel dispatch runs all next-nodes concurrently whenever len > 1, ignoring each node's
parallel flag
cleveragents/cleveractors-core
#117 fix(langgraph): gate pure graph concurrent node dispatch on per-node parallel flag
cleveragents/cleveractors-core
Reference
cleveragents/cleveractors-core#97
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Metadata
fix(langgraph): gate pure graph concurrent node dispatch on per-node parallel flagbugfix/m1-pure-graph-parallel-node-gateBackground and context
§6.7 (Parallel Execution) of the Actor Configuration Standard states: "The
graph-level
parallel_execution: trueflag declares that the graph mayexecute multiple ready nodes concurrently. The flag does not by itself cause
parallelism; each individual node MUST additionally declare
parallel: truein its node configuration to participate in parallel execution... Non-
parallel-marked nodes are executed sequentially." §12.3 (Concurrency)
reiterates: nodes MAY execute in parallel only when (a)
parallel_execution: true, AND (b) the next-node set has more than one element, AND (c) thenodes have
parallel: truein their config.PureLangGraphparses each node'sparallelflag (NodeConfig.parallel,default
False,nodes.py:106) and even ships a correct helpercan_execute_parallel()(nodes.py:922-924) — used correctly by the older,unused LangGraph-dependent engine at
langgraph/graph.py:296-299. However,the three concurrent-dispatch sites in the actively-used pure-graph engine
(
src/cleveractors/langgraph/pure_graph.py, inexecute()at line 1078, andboth
execute_stream()branches at lines 1860 and 1965) never call it:This fires every candidate next-node concurrently whenever the
graph-level flag is on (the default) and there is more than one candidate —
regardless of whether any individual node opted in via
parallel: true.No node in
packages/porting-actor-tools-graph-no_prune-single_thread-skills_b.yamldeclares
parallel: trueanywhere, and itsmainroute setsparallel_execution: true. Whenever_get_next_nodes()returns more thanone candidate for that graph (see companion issue #95, whose
content_not_containsdefect is one way this happens), both candidates runconcurrently via
asyncio.gather/asyncio.create_task, even though thegraph draws a strict sequential chain. This was observed in a real run: the
tool calls for
code-review-fixes1andui-coder-designerinterleaved inthe log instead of running strictly one after another.
This is a distinct, independent contract violation from #95 — it would
surface for any graph that legitimately produces 2+ next-nodes (e.g. a
genuine fan-out with only some nodes marked
parallel: true), not only thespecific
content_not_containsscenario.Current behavior
_get_next_nodes()returns 2+ candidates and the graph-levelparallel_executionistrue(the default), all candidates aredispatched concurrently via
asyncio.gather, with no check of each node'sown
parallelconfig flag.NodeConfig.parallel/can_execute_parallel()are parsed and availablebut never consulted by the active pure-graph engine.
Expected behavior
parallel: trueon the node itself should run concurrently (joined viaasyncio.gather); the remaining non-parallel-marked nodes should runsequentially.
parallel_execution: falseat the graph level, all nodes runsequentially regardless of their individual
parallelflags (this outergate is already correct — only the per-node gate is missing).
Acceptance criteria
parallel: true, all executesequentially (one completes before the next starts) even when
parallel_execution: true.parallel: trueand othersdon't, only the
parallel: truesubset runs concurrently viaasyncio.gather; the remaining nodes run sequentially, per §6.7 steps1-4.
parallel_execution: false, all nodes run sequentiallyregardless of individual
parallelflags (no regression).pure_graph.py(execute()and bothexecute_stream()branches).Supporting information
docs/index.md§6.7 (Parallel Execution), §12.3 (Concurrency).src/cleveractors/langgraph/pure_graph.pylines 1078, 1860, 1965(dispatch sites);
NodeConfig.parallel(defaultFalse);can_execute_parallel()helper (correctly used by the unusedlanggraph/graph.pyengine, unused inpure_graph.py).packages/porting-actor-tools-graph-no_prune-single_thread-skills_b.yaml— no node declares
parallel: true; the route setsparallel_execution: true.client/test_app.pyrun: interleaved tool calls fromcode-review-fixes1,ui-coder-designer, andcode-adjustments-classifier1where the graph places them strictly sequentially.
by the separately-filed
content_not_containscondition bug (#95), whichis what produces the 2+ candidate set in this particular graph — but this
dispatch-gating defect is independent and would surface with any 2+
candidate set regardless of cause.
Subtasks
next_nodes/content_next_nodesto the subset wherenode.can_execute_parallel()is true at all three dispatch sites insrc/cleveractors/langgraph/pure_graph.py(lines 1078, 1860, 1965);gather only that subset concurrently, execute the remainder
sequentially.
non-parallel, no-node-marked-parallel, and
parallel_execution: falsecases.
complete in declaration order (via shared state ordering) when none
are marked
parallel: true.nox -s coverage_report.nox(all default sessions), fix any errors.Definition of Done
This issue is complete when:
Metadata exactly.
@tdd_issue/@tdd_issue_N) passeswith
@tdd_expected_failremoved.master, reviewed, and merged.parallelflag #98parallelflag