Repository navigation
Description
Self Checks
- I have searched for existing issues, including closed ones.
- I confirm that I am using English to submit this report.
RAGFlow workspace code commit ID
RAGFlow image version
Source checkout (go 1.27.3, pure-Go unit test run with CGO_ENABLED=0); no container image involved.
Other environment information
- OS: Windows
- Package:
internal/agent/workflowx - No external services or native libraries required to reproduce.
Actual behavior
AddParallelNode builds one parallelBridgeState when the node is compiled and captures it in the lambda closure. The inner sub-workflow is compiled with a store backed by that single map. Every compiled.Invoke of the outer workflow therefore reads and writes the same per-item checkpoint map.
Consequences:
- A fresh run with a different outer checkpoint ID reuses item checkpoints from an earlier interrupted run:
step1is skipped and the stale result is returned ([101 601]instead of[501 601]). compose.WithForceNewRun()reuses the same item checkpoints, so an item that should interrupt returns successfully instead.- Two concurrent invocations share one bridge map and leak each other's item checkpoints; both resumes return mixed results (
[101 601]). - Completed items keep their sub-checkpoints after a resume, so later resumes carry stale child checkpoints.
Expected behavior
Each parallel invocation owns its own bridge state. Fresh runs and forced-new runs start with empty per-item state; concurrent runs cannot see each other's checkpoints; resuming rehydrates only the checkpoints persisted in the parallel node's own state, and drops them as items complete.
Steps to reproduce
$env:PATH = "C:\Users\tumma\tools\go\bin;$env:PATH"
$env:CGO_ENABLED = "0"
cd <ragflow checkout>
go test -v -count=1 ./internal/agent/workflowxOn the unfixed tree, these new regression tests fail (4 top-level failures, 2 subtest failures):
TestParallel_FreshRunIsolatedFromPriorInterruptedRun(sequential and concurrent)TestParallel_ForceNewRunDoesNotReuseSubCheckpointsTestParallel_ConcurrentFreshRunsIsolateSubCheckpointsTestParallel_MultiInterruptResumeDropsCompletedItemCheckpoints
Additional information
Fix: allocate parallelBridgeState inside each runParallelInvoke, register a stateless parallelBridgeStore on the compiled sub-workflow, delete an item's checkpoint after a successful item invocation, and rehydrate only from persisted ItemCheckpoints on resume. All 104 package tests pass with the fix applied; go vet on workflowx, runtime, and dsl is clean.
Activity