diff --git a/modules/workflows/processing/modes/modeDynamic.py b/modules/workflows/processing/modes/modeDynamic.py index f91a4080..dac6211f 100644 --- a/modules/workflows/processing/modes/modeDynamic.py +++ b/modules/workflows/processing/modes/modeDynamic.py @@ -104,7 +104,7 @@ class DynamicMode(BaseMode): state = TaskExecutionState(taskStep) # Dynamic mode uses max_steps instead of max_retries - state.max_steps = max(1, int(getattr(workflow, 'maxSteps', 5))) + state.max_steps = max(1, int(getattr(workflow, 'maxSteps', 10))) logger.info(f"Using Dynamic mode execution with max_steps: {state.max_steps}") step = 1 diff --git a/modules/workflows/processing/shared/executionState.py b/modules/workflows/processing/shared/executionState.py index a783e544..fd1299cf 100644 --- a/modules/workflows/processing/shared/executionState.py +++ b/modules/workflows/processing/shared/executionState.py @@ -76,6 +76,7 @@ def shouldContinue(observation: Optional[Observation], review=None, current_step try: # Stop if max steps reached if current_step >= max_steps: + logger.info(f"Stopping workflow: reached max_steps limit ({current_step} >= {max_steps})") return False # Check review decision (can be ReviewResult model or dict) diff --git a/modules/workflows/processing/shared/promptGenerationActionsDynamic.py b/modules/workflows/processing/shared/promptGenerationActionsDynamic.py index c0af7adf..ae59fafc 100644 --- a/modules/workflows/processing/shared/promptGenerationActionsDynamic.py +++ b/modules/workflows/processing/shared/promptGenerationActionsDynamic.py @@ -328,6 +328,11 @@ DOCUMENTS: {{KEY:AVAILABLE_DOCUMENTS_INDEX}} === NEXT ACTIONS === Follow the improvement suggestions from CONTENT VALIDATION in priority order. Each suggestion indicates what action to take next. +CRITICAL: Use structureComparison and gap information from CONTENT VALIDATION to determine what is MISSING: +- Check "structureComparison.found" vs "structureComparison.required" to see what's already delivered +- Check "structureComparison.gap" to see what's missing. If quantitative gaps are available, use them. +- Next action should ONLY generate the MISSING part, NOT repeat what's already delivered + === OUTPUT FORMAT === {{ "status": "continue", @@ -347,9 +352,11 @@ Follow the improvement suggestions from CONTENT VALIDATION in priority order. Ea - nextActionParameters: concrete parameters (check AVAILABLE_METHODS for valid names) - documentList: ONLY exact references from AVAILABLE_DOCUMENTS_INDEX (do not invent) - nextActionObjective: describe what this action will achieve based on the FIRST improvement suggestion from CONTENT VALIDATION +- CRITICAL: Use structureComparison.gap to specify the missing part in nextActionParameters - Do NOT repeat failed actions - suggest DIFFERENT approach - If ACTION HISTORY shows repeated actions, suggest a fundamentally different approach - nextActionObjective must directly address the highest priority improvement suggestion from CONTENT VALIDATION +- If validation shows partial data delivered, next action should CONTINUE from where it stopped, not restart """