claude-evolve 1.6.9 → 1.6.10
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.
- package/bin/claude-evolve-worker +10 -9
- package/package.json +1 -1
package/bin/claude-evolve-worker
CHANGED
|
@@ -139,6 +139,8 @@ call_ai_for_evolution() {
|
|
|
139
139
|
# Exhausted retries
|
|
140
140
|
echo "[WORKER-$$] All models hit usage limits after $max_retries retries" >&2
|
|
141
141
|
echo "[WORKER-$$] Unable to complete evolution due to API limits" >&2
|
|
142
|
+
# Clean up any partial target file before exiting
|
|
143
|
+
rm -f "$target_file"
|
|
142
144
|
exit 3
|
|
143
145
|
fi
|
|
144
146
|
fi
|
|
@@ -156,19 +158,18 @@ call_ai_for_evolution() {
|
|
|
156
158
|
fi
|
|
157
159
|
fi
|
|
158
160
|
|
|
159
|
-
# Success if
|
|
160
|
-
if
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
else
|
|
164
|
-
echo "[WORKER-$$] AI succeeded with exit code 0" >&2
|
|
165
|
-
fi
|
|
161
|
+
# Success only if the target file was actually modified.
|
|
162
|
+
# Even if AI exited with code 0, if there were no changes, treat as failure to avoid stale copies.
|
|
163
|
+
if [[ "$file_was_modified" == "true" ]]; then
|
|
164
|
+
echo "[WORKER-$$] AI successfully modified $target_file (exit code: $ai_exit_code)" >&2
|
|
166
165
|
# Output the result for the worker to use
|
|
167
166
|
echo "$ai_output"
|
|
168
167
|
return 0
|
|
169
168
|
fi
|
|
170
169
|
|
|
171
|
-
# Non-limit failure -
|
|
170
|
+
# Non-limit failure - no modification detected; clean up the copied file
|
|
171
|
+
echo "[WORKER-$$] AI changed nothing or failed; cleaning up temporary file" >&2
|
|
172
|
+
rm -f "$target_file"
|
|
172
173
|
echo "[WORKER-$$] AI failed: exit code $ai_exit_code, no file changes detected" >&2
|
|
173
174
|
return 1
|
|
174
175
|
done
|
|
@@ -580,4 +581,4 @@ with EvolutionCSV('$FULL_CSV_PATH') as csv:
|
|
|
580
581
|
CURRENT_CANDIDATE_ID=""
|
|
581
582
|
done
|
|
582
583
|
|
|
583
|
-
echo "[WORKER-$$] No more pending candidates, worker exiting"
|
|
584
|
+
echo "[WORKER-$$] No more pending candidates, worker exiting"
|