-
Notifications
You must be signed in to change notification settings - Fork 8
fix: resolve three supervisor pulse-blocking bugs #2185
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1528,14 +1528,16 @@ check_dispatch_dedup_guard() { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| local cooldown_secs="${SUPERVISOR_FAILURE_COOLDOWN_SECS:-600}" # 10 minutes default | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| local max_consecutive="${SUPERVISOR_MAX_CONSECUTIVE_FAILURES:-2}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Rule 2: Block after max_consecutive identical failures | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Rule 2: Cancel after max_consecutive identical failures | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Note: queued->blocked is not a valid transition; use cancelled instead. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # The task can be manually re-queued after investigation. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [[ "$consecutive_count" -ge "$max_consecutive" ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| local block_reason="Dispatch dedup guard: $consecutive_count consecutive identical failures (error: ${last_error:-unknown}) — manual intervention required (t1206)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| log_warn " $task_id: BLOCKED by dedup guard — $consecutive_count consecutive identical failures with error '${last_error:-unknown}'" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cmd_transition "$task_id" "blocked" --error "$block_reason" 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| log_warn " $task_id: CANCELLED by dedup guard — $consecutive_count consecutive identical failures with error '${last_error:-unknown}'" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cmd_transition "$task_id" "cancelled" --error "$block_reason" 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| update_todo_on_blocked "$task_id" "$block_reason" 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| send_task_notification "$task_id" "blocked" "$block_reason" 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| store_failure_pattern "$task_id" "blocked" "$block_reason" "dispatch-dedup-guard" 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| send_task_notification "$task_id" "cancelled" "$block_reason" 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| store_failure_pattern "$task_id" "cancelled" "$block_reason" "dispatch-dedup-guard" 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1531
to
1541
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. There is a logic inconsistency here. The PR adds
Suggested change
References
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
Use cancellation-specific TODO updates to avoid state drift.
The task now transitions to
cancelled, but the TODO sync still usesupdate_todo_on_blocked, which will annotate BLOCKED in TODO.md and diverge from the DB state. Please switch toupdate_todo_on_cancelled. Also, the note aboutqueued->blockedbeing invalid is now stale with the new VALID_TRANSITIONS entry—either update it or clarify why cancellation is still preferred here.🛠️ Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents