fix(kanban): extend stale claim instead of killing live worker#23071
Closed
konsisumer wants to merge 1 commit into
Closed
fix(kanban): extend stale claim instead of killing live worker#23071konsisumer wants to merge 1 commit into
konsisumer wants to merge 1 commit into
Conversation
Workers running slow models (e.g. kimi-k2.6) can spend longer than DEFAULT_CLAIM_TTL_SECONDS inside a single tool-free LLM call, making no tool calls and therefore not heartbeating. release_stale_claims previously reclaimed these healthy workers, producing the spawn-then-immediately-reclaim loop reported in NousResearch#23025. When a stale-by-TTL claim's host-local worker PID is still alive, extend the claim (emit a claim_extended event) rather than killing it. enforce_max_runtime / detect_crashed_workers remain the upper bounds for genuinely wedged or dead workers. Reclaim events now also record claim_expires, last_heartbeat_at, worker_pid, and host_local so operators can see why a worker was killed.
teknium1
added a commit
that referenced
this pull request
May 10, 2026
Contributor
|
Salvage merged via PR #23442 (rebase) — your fix shipped on Clean fix shape — host-local + alive-PID gate before reclaim, deferring to Thanks @konsisumer! |
This was referenced May 10, 2026
JZKK720
pushed a commit
to JZKK720/hermes-agent
that referenced
this pull request
May 11, 2026
rmulligan
pushed a commit
to rmulligan/hermes-agent
that referenced
this pull request
May 11, 2026
JinyuID
pushed a commit
to JinyuID/hermes-agent
that referenced
this pull request
May 11, 2026
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
jsboige
pushed a commit
to jsboige/hermes-agent
that referenced
this pull request
May 14, 2026
AlexFoxD
pushed a commit
to AlexFoxD/hermes-agent
that referenced
this pull request
May 21, 2026
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
Seven74AI
pushed a commit
to Seven74AI/hermes-agent
that referenced
this pull request
Jun 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stop reclaiming kanban tasks whose worker subprocess is still alive (#23025).
What changed and why
release_stale_claimsnow skips reclaim when the host-localworker_pidis alive, extendingclaim_expiresbyDEFAULT_CLAIM_TTL_SECONDSand emitting a newclaim_extendedevent. Slow models (kimi-k2.6 in the report) can spend longer than the 15-min TTL inside a single tool-free LLM call, sokanban_heartbeatnever fires; the previous behavior killed those healthy workers and respawned new ones that hit the same trap, producing the empty-workspace stall loop the reporter described.enforce_max_runtimeanddetect_crashed_workersremain the upper bounds for genuinely wedged or dead workers — neither is touched here.reclaimedevents now carryclaim_expires,last_heartbeat_at,worker_pid,host_local, andnow, so operators can tell at a glance whether a kill was timing-driven or a worker that genuinely went away.How to test
pytest tests/hermes_cli/test_kanban_db.py tests/tools/test_kanban_tools.py tests/stress/test_concurrency_reclaim_race.py -q --timeout=60(112 passed locally).test_stale_claim_with_live_pid_extends_instead_of_reclaiming(live PID → claim extended, no SIGTERM,claim_extendedevent emitted) andtest_stale_claim_reclaim_event_records_diagnostic_payload(dead PID → reclaim event records expiry + heartbeat).test_stale_claim_reclaimedupdated to simulate a dead PID, exercising the path that should still kill + reclaim.What platforms tested on
Fixes #23025