Skip to content

Commit d0272a9

Browse files
authored
fix: prevent parallelism in feedback and record steps (#1046)
1 parent 249f661 commit d0272a9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

rdagent/utils/workflow/loop.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,12 @@ def get_semaphore(self, step_name: str) -> asyncio.Semaphore:
136136
if isinstance(limit := RD_AGENT_SETTINGS.step_semaphore, dict):
137137
limit = limit.get(step_name, 1) # default to 1 if not specified
138138

139-
# NOTE: we assume the record step is always the last step to modify the global environment,
140-
# so we set the limit to 1 to avoid race condition
141-
if step_name == "record":
139+
# NOTE:
140+
# (1) we assume the record step is always the last step to modify the global environment,
141+
# so we set the limit to 1 to avoid race condition
142+
# (2) Because we support (-1,) as local selection; So it is hard to align a) the comparision target in `feedbck`
143+
# and b) parent node in `record`; So we prevent parallelism in `feedback` and `record` to avoid inconsistency
144+
if step_name in ("record", "feedback"):
142145
limit = 1
143146

144147
if step_name not in self.semaphores:

0 commit comments

Comments
 (0)