claude-evolve 1.6.9 → 1.6.11

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.
@@ -26,10 +26,22 @@ TERMINATION_SIGNAL=""
26
26
  cleanup_on_exit() {
27
27
  if [[ -n "$CURRENT_CANDIDATE_ID" ]]; then
28
28
  echo "[WORKER-$$] Worker terminated while processing $CURRENT_CANDIDATE_ID" >&2
29
- # If we're interrupted while processing, leave it as "running"
30
- # This prevents other workers from picking it up in the same session
31
- # A human can manually reset to pending if needed
32
- echo "[WORKER-$$] Leaving $CURRENT_CANDIDATE_ID in current state" >&2
29
+ # Atomically reset status to pending only if it is not already complete
30
+ echo "[WORKER-$$] Determining status before resetting" >&2
31
+ "$PYTHON_CMD" -c "
32
+ import sys
33
+ from lib.evolution_csv import EvolutionCSV
34
+ csv = EvolutionCSV('$FULL_CSV_PATH')
35
+ # Acquire lock and read current status safely
36
+ info = csv.get_candidate_info('$CURRENT_CANDIDATE_ID')
37
+ if info and info.get('status', '').lower() != 'complete':
38
+ csv.update_candidate_status('$CURRENT_CANDIDATE_ID', 'pending')
39
+ print('reset')
40
+ sys.exit(0)
41
+ else:
42
+ # No reset needed
43
+ sys.exit(0)
44
+ " 2>/dev/null || echo "[WORKER-$$] Warning: failed to reset status" >&2
33
45
  fi
34
46
  }
35
47
 
@@ -139,6 +151,8 @@ call_ai_for_evolution() {
139
151
  # Exhausted retries
140
152
  echo "[WORKER-$$] All models hit usage limits after $max_retries retries" >&2
141
153
  echo "[WORKER-$$] Unable to complete evolution due to API limits" >&2
154
+ # Clean up any partial target file before exiting
155
+ rm -f "$target_file"
142
156
  exit 3
143
157
  fi
144
158
  fi
@@ -156,19 +170,18 @@ call_ai_for_evolution() {
156
170
  fi
157
171
  fi
158
172
 
159
- # Success if file was modified OR exit code is 0 (for cases where file validation isn't applicable)
160
- if [[ "$file_was_modified" == "true" ]] || [[ $ai_exit_code -eq 0 ]]; then
161
- if [[ "$file_was_modified" == "true" ]]; then
162
- echo "[WORKER-$$] AI successfully modified $target_file (exit code: $ai_exit_code)" >&2
163
- else
164
- echo "[WORKER-$$] AI succeeded with exit code 0" >&2
165
- fi
173
+ # Success only if the target file was actually modified.
174
+ # Even if AI exited with code 0, if there were no changes, treat as failure to avoid stale copies.
175
+ if [[ "$file_was_modified" == "true" ]]; then
176
+ echo "[WORKER-$$] AI successfully modified $target_file (exit code: $ai_exit_code)" >&2
166
177
  # Output the result for the worker to use
167
178
  echo "$ai_output"
168
179
  return 0
169
180
  fi
170
181
 
171
- # Non-limit failure - don't retry
182
+ # Non-limit failure - no modification detected; clean up the copied file
183
+ echo "[WORKER-$$] AI changed nothing or failed; cleaning up temporary file" >&2
184
+ rm -f "$target_file"
172
185
  echo "[WORKER-$$] AI failed: exit code $ai_exit_code, no file changes detected" >&2
173
186
  return 1
174
187
  done
@@ -580,4 +593,4 @@ with EvolutionCSV('$FULL_CSV_PATH') as csv:
580
593
  CURRENT_CANDIDATE_ID=""
581
594
  done
582
595
 
583
- echo "[WORKER-$$] No more pending candidates, worker exiting"
596
+ echo "[WORKER-$$] No more pending candidates, worker exiting"
package/lib/ai-cli.sh CHANGED
@@ -99,13 +99,13 @@ $prompt"
99
99
  codex-qwen3)
100
100
  # Qwen3-Coder via Codex CLI with Ollama backend (only mildly agentic)
101
101
  local ai_output
102
- ai_output=$(timeout 600 codex exec --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check --oss --model qwen3-coder:30b "$prompt" 2>&1)
102
+ ai_output=$(timeout 1200 codex exec --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check --oss --model qwen3-coder:30b "$prompt" 2>&1)
103
103
  local ai_exit_code=$?
104
104
  ;;
105
105
  codex-oss)
106
- # Codex-OSS via Codex CLI with Ollama backend
106
+ # Codex-OSS via Codex CLI with Ollama backend (longer timeout)
107
107
  local ai_output
108
- ai_output=$(timeout 600 codex exec --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check --oss "$prompt" 2>&1)
108
+ ai_output=$(timeout 1200 codex exec --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check --oss "$prompt" 2>&1)
109
109
  local ai_exit_code=$?
110
110
  ;;
111
111
  aider-qwen3|qwen3)
package/lib/config.sh CHANGED
@@ -61,8 +61,20 @@ DEFAULT_LLM_IDEATE="gemini sonnet-think gpt5high o3high glm grok-4 codex-qwen3 c
61
61
 
62
62
  # Load configuration from config file
63
63
  load_config() {
64
- # Accept config file path as parameter
65
- local config_file="${1:-evolution/config.yaml}"
64
+ # Accept config file path as parameter. If not supplied, look for a user override in
65
+ # $HOME/.config/claude-evolve/config.yaml first, then fall back to the repo default.
66
+ local user_config="$1"
67
+
68
+ if [[ -n "$user_config" ]]; then
69
+ config_file="$user_config"
70
+ else
71
+ local home_config="$HOME/.config/claude-evolve/config.yaml"
72
+ if [[ -f "$home_config" ]]; then
73
+ config_file="$home_config"
74
+ else
75
+ config_file="evolution/config.yaml"
76
+ fi
77
+ fi
66
78
 
67
79
  # Set defaults first
68
80
  EVOLUTION_DIR="$DEFAULT_EVOLUTION_DIR"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-evolve",
3
- "version": "1.6.9",
3
+ "version": "1.6.11",
4
4
  "bin": {
5
5
  "claude-evolve": "./bin/claude-evolve",
6
6
  "claude-evolve-main": "./bin/claude-evolve-main",