-
Notifications
You must be signed in to change notification settings - Fork 39
fix: add debug logging to AI lifecycle loop #2110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -912,6 +912,10 @@ process_ai_lifecycle() { | |
| local merged_parents="" | ||
| local repos_with_changes="" | ||
|
|
||
| local total_eligible=0 | ||
| total_eligible=$(printf '%s\n' "$eligible_tasks" | grep -c '.' || echo "0") | ||
| log_info "ai-lifecycle: $total_eligible eligible tasks" | ||
|
|
||
| while IFS='|' read -r tid tstatus tpr trepo; do | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regarding the issue where only one task is processed per cycle: if |
||
| [[ -z "$tid" ]] && continue | ||
|
|
||
|
|
@@ -944,6 +948,7 @@ process_ai_lifecycle() { | |
| # Check if a merge happened | ||
| local new_status | ||
| new_status=$(db "$SUPERVISOR_DB" "SELECT status FROM tasks WHERE id = '$(sql_escape "$tid")';" 2>/dev/null || echo "") | ||
| log_info "ai-lifecycle: $tid → $new_status" | ||
| case "$new_status" in | ||
| merged | deploying | deployed) | ||
| merged_count=$((merged_count + 1)) | ||
|
|
@@ -956,6 +961,8 @@ process_ai_lifecycle() { | |
| fi | ||
| ;; | ||
| esac | ||
| else | ||
| log_warn "ai-lifecycle: $tid failed (process_task_lifecycle returned non-zero)" | ||
| fi | ||
|
|
||
| # Track repos that had status tag changes | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of
|| echo "0"as a guard forgrep -cis functionally correct, but for commands that may fail underset -e, the recommended practice is to use|| trueto prevent premature script termination. Whilegrep -calready outputs0to stdout even when no matches are found (though it exits with code 1),|| trueensures adherence to theset -esafety pattern.References