Skip to content

fix(kanban): reset failure counters on unblock_task - #24022

Closed
bradhallett wants to merge 1 commit into
NousResearch:mainfrom
bradhallett:fix/kanban-unblock-reset-failures
Closed

fix(kanban): reset failure counters on unblock_task#24022
bradhallett wants to merge 1 commit into
NousResearch:mainfrom
bradhallett:fix/kanban-unblock-reset-failures

Conversation

@bradhallett

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes a bug where unblock_task() resets task status but leaves consecutive_failures and last_failure_error intact. The next failure immediately re-trips the circuit breaker because the counter is still at max.

Related Issue

No existing issue — discovered during operational review of fleet-wide kanban dispatch failures.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • hermes_cli/kanban_db.py — Added consecutive_failures = 0, last_failure_error = NULL to the UPDATE in unblock_task()
  • tests/hermes_cli/test_kanban_db.py — Added test_unblock_resets_failure_counters regression test

How to Test

  1. Create a task, claim it, block it
  2. Set consecutive_failures = 5 via raw SQL
  3. Call unblock_task() — verify counters are zeroed
  4. Run: python -m pytest tests/hermes_cli/test_kanban_db.py -q -k unblock
4 passed, 79 deselected in 0.55s

Checklist

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits
  • I searched for existing PRs — no duplicates found
  • My PR contains only changes related to this fix
  • I've run tests and they pass
  • I've added tests for my changes
  • Tested on macOS 15

When a task is manually unblocked (blocked → ready/todo), the
consecutive_failures counter and last_failure_error were left intact.
The next failure would immediately re-trip the circuit breaker because
the counter was still at or above the failure limit.

Reset both fields on unblock so the task gets a fresh retry budget.

Includes a regression test that verifies counters are zeroed.
@alt-glitch alt-glitch added type/bug Something isn't working comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have labels May 11, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #28379 (cherry-picked onto current main with your authorship preserved via rebase-merge — commit f042931). Thanks for the contribution!

@teknium1 teknium1 closed this May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants