codeharness 0.19.1 → 0.19.3
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/dist/index.js +1861 -879
- package/package.json +1 -1
- package/ralph/ralph.sh +27 -1
package/package.json
CHANGED
package/ralph/ralph.sh
CHANGED
|
@@ -38,7 +38,7 @@ LOG_DIR=""
|
|
|
38
38
|
# Loop limits
|
|
39
39
|
MAX_ITERATIONS=${MAX_ITERATIONS:-50}
|
|
40
40
|
MAX_STORY_RETRIES=${MAX_STORY_RETRIES:-10}
|
|
41
|
-
LOOP_TIMEOUT_SECONDS=${LOOP_TIMEOUT_SECONDS:-
|
|
41
|
+
LOOP_TIMEOUT_SECONDS=${LOOP_TIMEOUT_SECONDS:-43200} # 12 hours default
|
|
42
42
|
ITERATION_TIMEOUT_MINUTES=${ITERATION_TIMEOUT_MINUTES:-30}
|
|
43
43
|
|
|
44
44
|
# Rate limiting
|
|
@@ -560,6 +560,12 @@ execute_iteration() {
|
|
|
560
560
|
loop_start_sha=$(git rev-parse HEAD 2>/dev/null || echo "")
|
|
561
561
|
fi
|
|
562
562
|
|
|
563
|
+
# Snapshot sprint-state.json before iteration (for timeout delta capture)
|
|
564
|
+
local state_snapshot_path="ralph/.state-snapshot.json"
|
|
565
|
+
if [[ -f "sprint-state.json" ]]; then
|
|
566
|
+
cp "sprint-state.json" "$state_snapshot_path" 2>/dev/null || true
|
|
567
|
+
fi
|
|
568
|
+
|
|
563
569
|
log_status "LOOP" "Iteration $iteration — Task: ${task_id:-'(reading from prompt)'}"
|
|
564
570
|
local timeout_seconds=$((ITERATION_TIMEOUT_MINUTES * 60))
|
|
565
571
|
|
|
@@ -686,6 +692,26 @@ execute_iteration() {
|
|
|
686
692
|
return 0
|
|
687
693
|
elif [[ $exit_code -eq 124 ]]; then
|
|
688
694
|
log_status "WARN" "Iteration timed out after ${ITERATION_TIMEOUT_MINUTES}m"
|
|
695
|
+
|
|
696
|
+
# Capture timeout report
|
|
697
|
+
if command -v npx &>/dev/null; then
|
|
698
|
+
log_status "INFO" "Capturing timeout report..."
|
|
699
|
+
npx codeharness timeout-report \
|
|
700
|
+
--story "${task_id:-unknown}" \
|
|
701
|
+
--iteration "$iteration" \
|
|
702
|
+
--duration "$ITERATION_TIMEOUT_MINUTES" \
|
|
703
|
+
--output-file "$output_file" \
|
|
704
|
+
--state-snapshot "$state_snapshot_path" 2>/dev/null && \
|
|
705
|
+
log_status "INFO" "Timeout report saved" || \
|
|
706
|
+
log_status "WARN" "Failed to capture timeout report"
|
|
707
|
+
fi
|
|
708
|
+
|
|
709
|
+
# Verify report file exists with non-zero content
|
|
710
|
+
local report_file="ralph/logs/timeout-report-${iteration}-${task_id:-unknown}.md"
|
|
711
|
+
if [[ -s "$report_file" ]]; then
|
|
712
|
+
log_status "INFO" "Timeout report verified: $report_file"
|
|
713
|
+
fi
|
|
714
|
+
|
|
689
715
|
return 1
|
|
690
716
|
else
|
|
691
717
|
# Check for API limit
|