Skip to content

Commit 8311acf

Browse files
refactor: consolidate triplicated CSV/text loop-task expansion in process.py (#1957)
* refactor: consolidate triplicated CSV/text loop-task expansion in process.py This consolidates three near-identical implementations of CSV/text-file loop-task expansion onto the existing _create_loop_subtasks() helper: - Enhanced _create_loop_subtasks() with optional decision_mode parameter - Replaced inline start-task logic (lines 1116-1205) with helper call - Replaced inline mid-workflow logic (lines 1273-1330) with helper call Removes ~300 lines of duplicated logic and fixes latent CSV-parsing inconsistency where inline copies used plain csv.reader() instead of csv.reader(f, quotechar='"', escapechar='\\'). All loop feature behavior preserved: CSV/text files, decision-task creation with inherited next_tasks, and sync/async paths work identically. Fixes #1953 Co-authored-by: MervinPraison <MervinPraison@users.noreply.github.com> * fix: resolve critical issues in loop task consolidation - Fix lexicographic sorting that breaks ordering with 10+ subtasks - Retire parent loop task after expansion to prevent completion blocking - Replace placeholder task names in decision conditions with concrete names - Use is_start flag instead of name sorting for proper subtask selection Addresses reviewer feedback from Greptile and CodeRabbit on PR #1957 Co-authored-by: Mervin Praison <MervinPraison@users.noreply.github.com> --------- Co-authored-by: praisonai-triage-agent[bot] <272766704+praisonai-triage-agent[bot]@users.noreply.github.com> Co-authored-by: MervinPraison <MervinPraison@users.noreply.github.com>
1 parent 3015ce4 commit 8311acf

1 file changed

Lines changed: 105 additions & 171 deletions

File tree

  • src/praisonai-agents/praisonaiagents/process

0 commit comments

Comments
 (0)