Skip to content

fix(dispatch): use update_todo_on_cancelled after cancelled transition (GH#3436)#4477

Merged
alex-solovyev merged 1 commit intomainfrom
bugfix/qd-3436-pr-2185-review-feedback
Mar 13, 2026
Merged

fix(dispatch): use update_todo_on_cancelled after cancelled transition (GH#3436)#4477
alex-solovyev merged 1 commit intomainfrom
bugfix/qd-3436-pr-2185-review-feedback

Conversation

@alex-solovyev
Copy link
Collaborator

@alex-solovyev alex-solovyev commented Mar 13, 2026

Summary

  • Fixes state mismatch in check_dispatch_dedup_guard: after transitioning a task to cancelled via cmd_transition, the TODO.md update was calling update_todo_on_blocked, causing TODO.md to show BLOCKED while the DB recorded CANCELLED.
  • Replace with update_todo_on_cancelled (identical signature: task_id, reason) so both DB and TODO.md reflect the same terminal state.
  • Update function header comment and inline comment to say cancelled instead of blocked, replacing the stale note about queued->blocked validity with a clearer explanation referencing VALID_TRANSITIONS.

Changes

  • .agents/scripts/supervisor-archived/dispatch.sh — 1 file, 7 insertions / 6 deletions

Verification

  • shellcheck -S error passes with zero violations on the modified file.
  • update_todo_on_cancelled exists in todo-sync.sh:1072 with the same (task_id, reason) signature as update_todo_on_blocked.
  • Bug confirmed present before fix: grep -n "update_todo_on_blocked" dispatch.sh returned line 1493 inside the cancelled branch.

Closes #3436

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Tasks now transition to "cancelled" status instead of "blocked" after two consecutive identical failures, improving clarity in task management and workflow visibility.

…_blocked after cancelled transition

After the dedup guard transitions a task to 'cancelled' via cmd_transition,
the subsequent TODO.md update was calling update_todo_on_blocked, causing
TODO.md to show BLOCKED while the DB recorded CANCELLED — a state mismatch.

Replace with update_todo_on_cancelled (same signature: task_id, reason) so
both the DB and TODO.md reflect the same terminal state.

Also update the function header comment and inline comment to say 'cancelled'
instead of 'blocked', removing the stale note about queued->blocked validity
and replacing it with a clearer explanation referencing VALID_TRANSITIONS.

Fixes #3436 (PR #2185 review feedback from CodeRabbit)
@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!

@github-actions github-actions bot added the bug Auto-created from TODO.md tag label Mar 13, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 13, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 29de3f04-fd15-4725-97d3-86e52415a4fb

📥 Commits

Reviewing files that changed from the base of the PR and between 100b635 and 9988ec9.

📒 Files selected for processing (1)
  • .agents/scripts/supervisor-archived/dispatch.sh

Walkthrough

The dispatch.sh script's deduplication logic is corrected to transition tasks to "cancelled" state instead of "blocked" following two consecutive identical failures, and the associated TODO sync call is updated from update_todo_on_blocked to update_todo_on_cancelled for consistency.

Changes

Cohort / File(s) Summary
Dispatch Dedup State Transition
.agents/scripts/supervisor-archived/dispatch.sh
Changed the post-dedup failure state target from "blocked" to "cancelled" and updated the TODO sync helper call from update_todo_on_blocked to update_todo_on_cancelled to ensure consistent state representation across DB and TODO.md records.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

code-reviews-actioned

Poem

🚫 From blocked to cancelled, the dispatch flow aligns,
TODO states now match where the logic winds,
A small but critical fix makes the watchers smile,
Consistency restored, one script at a time! 📋✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main fix: replacing update_todo_on_blocked with update_todo_on_cancelled after a cancelled state transition to fix state mismatch between DB and TODO.md.
Linked Issues check ✅ Passed The PR successfully addresses the primary objective from issue #3436: replacing update_todo_on_blocked with update_todo_on_cancelled to sync TODO.md state with the database after cancellation.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the identified state mismatch bug; no unrelated modifications or scope creep detected in the dispatch.sh changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/qd-3436-pr-2185-review-feedback
📝 Coding Plan
  • Generate coding plan for human review comments

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
Contributor

🔍 Code Quality Report

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

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

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Mar 13 22:54:50 UTC 2026: Code review monitoring started
Fri Mar 13 22:54:50 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 414

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 414
  • VULNERABILITIES: 0

Generated on: Fri Mar 13 22:54:52 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

@alex-solovyev alex-solovyev merged commit 289965e into main Mar 13, 2026
25 of 26 checks passed
@alex-solovyev alex-solovyev deleted the bugfix/qd-3436-pr-2185-review-feedback branch March 13, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Auto-created from TODO.md tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quality-debt: PR #2185 review feedback (critical)

1 participant