claude-evolve 1.8.37 → 1.8.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -933,13 +933,18 @@ ideate_ai_strategies() {
933
933
 
934
934
  echo "[INFO] Strategy results: $strategies_succeeded/$strategies_attempted succeeded" >&2
935
935
 
936
- # REQUIRE ALL strategies to succeed - no partial results
937
- # Accepting partial results leads to endless loops with 1 idea per generation
938
- if [[ $strategies_succeeded -eq $strategies_attempted ]]; then
936
+ # Accept partial results - if ANY strategy succeeded, that's enough
937
+ # The workers will process what we have, and next ideation run can add more
938
+ # AIDEV-NOTE: Previously required ALL strategies to succeed, which caused
939
+ # endless ideation loops because CSV writes weren't rolled back on "rejection"
940
+ if [[ $strategies_succeeded -gt 0 ]]; then
941
+ if [[ $strategies_succeeded -lt $strategies_attempted ]]; then
942
+ echo "[INFO] Partial success: $strategies_succeeded/$strategies_attempted strategies completed" >&2
943
+ echo "[INFO] Workers will process existing ideas, next ideation can add more" >&2
944
+ fi
939
945
  return 0
940
946
  else
941
- echo "[ERROR] Not all ideation strategies succeeded ($strategies_succeeded/$strategies_attempted)" >&2
942
- echo "[ERROR] Rejecting partial results - will retry with exponential backoff" >&2
947
+ echo "[ERROR] All ideation strategies failed (0/$strategies_attempted)" >&2
943
948
  return 1
944
949
  fi
945
950
  }
@@ -1662,6 +1667,18 @@ wait_seconds=300 # Start with 5 minutes
1662
1667
  max_wait_seconds=300 # Cap at 5 minutes
1663
1668
 
1664
1669
  while true; do
1670
+ # AIDEV-NOTE: Check if we already have enough pending ideas for this generation
1671
+ # This prevents endless ideation loops when partial results were written but
1672
+ # the function returned failure (e.g., 2/4 strategies succeeded)
1673
+ pending_count=$(grep -c "^gen${CURRENT_GENERATION}-.*,pending" "$FULL_CSV_PATH" 2>/dev/null || echo "0")
1674
+ if [[ $pending_count -ge $TOTAL_IDEAS ]]; then
1675
+ echo "[INFO] Already have $pending_count pending ideas for generation $CURRENT_GENERATION (target: $TOTAL_IDEAS)"
1676
+ echo "[INFO] Skipping ideation - workers will process existing ideas"
1677
+ exit 0
1678
+ elif [[ $pending_count -gt 0 ]]; then
1679
+ echo "[INFO] Found $pending_count existing pending ideas for generation $CURRENT_GENERATION (target: $TOTAL_IDEAS)"
1680
+ fi
1681
+
1665
1682
  if [[ $use_strategies == true ]]; then
1666
1683
  echo "[INFO] Multi-strategy AI generation mode"
1667
1684
  if ideate_ai_strategies; then
@@ -1,6 +1,8 @@
1
1
  #!/bin/bash
2
2
 
3
- set -e
3
+ # AIDEV-NOTE: Don't use set -e globally - it causes silent exits on any command failure
4
+ # Instead, handle errors explicitly where needed
5
+ # set -e # DISABLED - was causing silent dispatcher crashes
4
6
 
5
7
  # Load configuration
6
8
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -579,8 +581,8 @@ last_stuck_check=0
579
581
 
580
582
  # Main dispatch loop
581
583
  while true; do
582
- # Clean up finished workers
583
- cleanup_workers
584
+ # Clean up finished workers (with error protection)
585
+ cleanup_workers || echo "[WARN] cleanup_workers had an error, continuing..." >&2
584
586
 
585
587
  # Check if API limit was reached
586
588
  if [[ "$api_limit_reached" == "true" ]]; then
@@ -631,8 +633,17 @@ except Exception as e:
631
633
  fi
632
634
  fi
633
635
 
634
- # Get current status
635
- csv_stats=$(get_csv_stats "$FULL_CSV_PATH")
636
+ # Get current status (with error handling to prevent silent crashes)
637
+ csv_stats=$(get_csv_stats "$FULL_CSV_PATH") || {
638
+ echo "[ERROR] Failed to get CSV stats, retrying in 5 seconds..." >&2
639
+ sleep 5
640
+ continue
641
+ }
642
+ if [[ -z "$csv_stats" ]]; then
643
+ echo "[ERROR] Empty CSV stats, retrying in 5 seconds..." >&2
644
+ sleep 5
645
+ continue
646
+ fi
636
647
  read -r total_rows complete_count pending_count <<< "$csv_stats"
637
648
  active_workers=${#worker_pids[@]}
638
649
 
@@ -729,7 +729,8 @@ with EvolutionCSV('$FULL_CSV_PATH') as csv:
729
729
 
730
730
  if [[ $candidates_processed -ge $WORKER_MAX_CANDIDATES ]]; then
731
731
  echo "[WORKER-$$] Reached maximum candidates ($WORKER_MAX_CANDIDATES), exiting for refresh"
732
- break
732
+ echo "[WORKER-$$] Worker exiting (will be restarted by dispatcher if running via 'claude-evolve run')"
733
+ exit 0
733
734
  fi
734
735
  done
735
736
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-evolve",
3
- "version": "1.8.37",
3
+ "version": "1.8.39",
4
4
  "bin": {
5
5
  "claude-evolve": "./bin/claude-evolve",
6
6
  "claude-evolve-main": "./bin/claude-evolve-main",