From aff37fd2e2853d9ececa2f0bb4d16267566c92d4 Mon Sep 17 00:00:00 2001
From: ValueOn AG
Date: Sun, 30 Nov 2025 23:27:46 +0100
Subject: [PATCH] not to trust ai comments, to verify...
---
modules/workflows/processing/modes/modeDynamic.py | 2 +-
modules/workflows/processing/shared/executionState.py | 1 +
.../processing/shared/promptGenerationActionsDynamic.py | 7 +++++++
3 files changed, 9 insertions(+), 1 deletion(-)
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
"""