From 12d4e8a850f51ca43555ddb577a4f60833ef78a8 Mon Sep 17 00:00:00 2001 From: you-n-g Date: Wed, 9 Jul 2025 18:36:05 +0800 Subject: [PATCH] fix: prevent parallelism in feedback and record steps (#1046) --- rdagent/utils/workflow/loop.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rdagent/utils/workflow/loop.py b/rdagent/utils/workflow/loop.py index e650bda9..ed2360e3 100644 --- a/rdagent/utils/workflow/loop.py +++ b/rdagent/utils/workflow/loop.py @@ -136,9 +136,12 @@ class LoopBase: if isinstance(limit := RD_AGENT_SETTINGS.step_semaphore, dict): limit = limit.get(step_name, 1) # default to 1 if not specified - # NOTE: we assume the record step is always the last step to modify the global environment, - # so we set the limit to 1 to avoid race condition - if step_name == "record": + # NOTE: + # (1) we assume the record step is always the last step to modify the global environment, + # so we set the limit to 1 to avoid race condition + # (2) Because we support (-1,) as local selection; So it is hard to align a) the comparision target in `feedbck` + # and b) parent node in `record`; So we prevent parallelism in `feedback` and `record` to avoid inconsistency + if step_name in ("record", "feedback"): limit = 1 if step_name not in self.semaphores: