fix: Show AI enhancement progress for small batches (<10)
PROBLEM: - Progress indicator only showed every 5 batches or at completion - When enhancing 1-4 patterns, no progress was visible - User saw "Enhancing 1 patterns..." → "Enhanced 1 patterns" with no progress SOLUTION: - Modified progress condition to always show for small jobs (total < 10) - Original: `if completed % 5 == 0 or completed == total` - Updated: `if total < 10 or completed % 5 == 0 or completed == total` IMPACT: - Now shows "Progress: 1/3 batches completed" for small jobs - Large jobs (10+) still show every 5th batch to avoid spam - Applied to both _enhance_patterns_parallel and _enhance_examples_parallel FILES: - ai_enhancer.py line 301-302 (patterns) - ai_enhancer.py line 439-440 (test examples) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -298,7 +298,8 @@ class PatternEnhancer(AIEnhancer):
|
|||||||
try:
|
try:
|
||||||
results[idx] = future.result()
|
results[idx] = future.result()
|
||||||
completed += 1
|
completed += 1
|
||||||
if completed % 5 == 0 or completed == total:
|
# Show progress: always for small jobs (<10), every 5 for larger jobs
|
||||||
|
if total < 10 or completed % 5 == 0 or completed == total:
|
||||||
logger.info(f" Progress: {completed}/{total} batches completed")
|
logger.info(f" Progress: {completed}/{total} batches completed")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning(f"⚠️ Batch {idx} failed: {e}")
|
logger.warning(f"⚠️ Batch {idx} failed: {e}")
|
||||||
@@ -435,7 +436,8 @@ class TestExampleEnhancer(AIEnhancer):
|
|||||||
try:
|
try:
|
||||||
results[idx] = future.result()
|
results[idx] = future.result()
|
||||||
completed += 1
|
completed += 1
|
||||||
if completed % 5 == 0 or completed == total:
|
# Show progress: always for small jobs (<10), every 5 for larger jobs
|
||||||
|
if total < 10 or completed % 5 == 0 or completed == total:
|
||||||
logger.info(f" Progress: {completed}/{total} batches completed")
|
logger.info(f" Progress: {completed}/{total} batches completed")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning(f"⚠️ Batch {idx} failed: {e}")
|
logger.warning(f"⚠️ Batch {idx} failed: {e}")
|
||||||
|
|||||||
Reference in New Issue
Block a user