Skip to content

fix: clear dedup guard state on task reset#2189

Merged
marcusquinn merged 1 commit intomainfrom
bugfix/dedup-guard-reset-state
Feb 23, 2026
Merged

fix: clear dedup guard state on task reset#2189
marcusquinn merged 1 commit intomainfrom
bugfix/dedup-guard-reset-state

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 23, 2026

Summary

  • cmd_reset() in state.sh clears retries, error, session_id, etc. when resetting a task to queued, but did not clear last_failure_at or consecutive_failure_count
  • This caused the dedup guard (check_dispatch_dedup_guard) to see stale failure counts and cancel tasks on their next dispatch attempt
  • Root cause of t004.35 and t005.5 being falsely cancelled after manual re-queue

Fix

Added last_failure_at = NULL and consecutive_failure_count = 0 to the cmd_reset() UPDATE statement, matching what reset_failure_dedup_state() already does for successful completions.

Summary by CodeRabbit

  • Bug Fixes
    • Task reset operations now properly clear failure tracking metadata, ensuring a fresh state when resuming previously failed tasks.

…ions

cmd_reset() was clearing retries and error but not last_failure_at or
consecutive_failure_count. When tasks were manually re-queued, stale dedup
state persisted and the dedup guard cancelled them on next dispatch attempt.

Root cause of t004.35 and t005.5 being falsely cancelled after re-queue.
@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@marcusquinn marcusquinn merged commit 0f74334 into main Feb 23, 2026
5 of 6 checks passed
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 23, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

The supervisor state script's task reset operation now clears failure tracking metadata during reset to queued state, resetting the failure timestamp and consecutive failure counter to their initial values.

Changes

Cohort / File(s) Summary
Failure Metadata Reset
.agents/scripts/supervisor/state.sh
Modified cmd_reset to clear last_failure_at (set to NULL) and reset consecutive_failure_count to 0 when transitioning a task back to queued state.

Possibly related PRs

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

When tasks must rise and try once more,
Fresh metadata clears what came before,
The slate is wiped, the counters fall,
A clean reset for one and all! 🔄

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/dedup-guard-reset-state

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 42 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Mon Feb 23 03:16:15 UTC 2026: Code review monitoring started
Mon Feb 23 03:16:15 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 42

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 42
  • VULNERABILITIES: 0

Generated on: Mon Feb 23 03:16:18 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant