Skip to content

fix(kanban): stop reclaimed workers before retry#21150

Closed
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/kanban-reclaim-cancel-21141
Closed

fix(kanban): stop reclaimed workers before retry#21150
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/kanban-reclaim-cancel-21141

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Summary

  • terminate host-local kanban workers during stale and manual reclaim before returning the task to ready
  • guard reclaim updates on the previous claim lock so a late worker cannot be overwritten after reclaim waits for shutdown
  • add reclaim coverage for stale-claim and manual-reclaim cancellation paths

Root Cause

Reclaim only cleared the kanban row state. When a task was reclaimed because its lock went stale, or an operator reclaimed it manually, the original worker process kept running. That let the dispatcher spawn a replacement while the old worker was still executing out of band.

Fixes #21141.

Testing

  • /Users/leongong/Desktop/LeonProjects/gho_workspace/hermes-agent/.venv/bin/python -m pytest -o addopts='' tests/hermes_cli/test_kanban_db.py -k 'stale_claim_reclaimed or max_runtime_uses_current_run_start_after_retry'
  • /Users/leongong/Desktop/LeonProjects/gho_workspace/hermes-agent/.venv/bin/python -m pytest -o addopts='' tests/hermes_cli/test_kanban_core_functionality.py -k 'reclaim_task or stale_run_cannot or enforce_max_runtime'
  • /Users/leongong/Desktop/LeonProjects/gho_workspace/hermes-agent/.venv/bin/python -m py_compile hermes_cli/kanban_db.py tests/hermes_cli/test_kanban_db.py tests/hermes_cli/test_kanban_core_functionality.py
  • git diff --check

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard labels May 7, 2026
@teknium1

teknium1 commented May 7, 2026

Copy link
Copy Markdown
Contributor

Merged via #21183 with your commit cherry-picked onto current main — authorship preserved in git log via rebase merge. Thanks @LeonSGP43! Closes #21141.

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

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard 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.

[Bug]: Kanban workers are not cancelled when reclaimed due to timeout/stale_lock

3 participants