Repository navigation
Description
Summary
kanban.failure_limit does not auto-block tasks when the worker crashes before sending its first heartbeat. Affected cases include invalid skill names, import errors, and any startup exception. The task respawns indefinitely — every dispatch_interval_seconds — regardless of failure_limit value.
Reproduction
- Create a kanban task with a skill name that doesn't exist:
hermes kanban create --board <board> --body "test" --skills nonexistent-skill - Set
kanban.failure_limit: 2in config (or any value) - Observe: task spawns, crashes with
ValueError: Unknown skill(s), gets reclaimed and respawned every 60s without ever being auto-blocked
Root cause
The crash happens before the worker writes its first heartbeat or lock entry. detect_crashed_workers identifies the dead process, but the consecutive_failures counter stored against the task lock entry is never created (no lock = no counter). Each dispatch cycle therefore sees the task as having 0 failures and re-claims it, resetting the circuit breaker window.
Post-heartbeat crashes (worker dies mid-execution) correctly increment consecutive_failures because a lock entry exists.
Impact (real-world case)
Observed in production on hermes-agent 0.14.0:
- Skill name typo (
foundry-vtt-mcp-macos→foundry-vtt-macos) caused 1192 consecutive crashes over 48 hours failure_limit: 2never triggered- System load peaked at 17.26 on a 20-core M1 Ultra
- Contributed to gateway crash loop → 1000+ Discord reconnect attempts → system reboot
Expected behaviour
After failure_limit consecutive pre-heartbeat crashes, the task should be auto-blocked with a diagnostic message explaining the startup failure (same as post-heartbeat auto-block behaviour).
Suggested fix
Track pre-heartbeat spawn failures in a separate counter on the task record itself (not on the transient lock entry), so the circuit breaker fires regardless of whether a heartbeat was ever sent.
Note: PR #33747 (preflight skill validation at dispatch time) addresses the skill-name case specifically and will prevent this for that class of errors. This issue covers the general mechanism — any startup crash bypasses the circuit breaker today.
Environment
- hermes-agent 0.14.0 / 0.15.1
- macOS 15 (M1 Ultra)
kanban.failure_limit: 2,kanban.dispatch_interval_seconds: 60
Activity
ga1205 commentedon Jun 5, 2026
I would not consider this a P3. It is much more severe. I'm having this issue in production now. I wanted to have a good summary for this note, so the following was organized with Claude's help. The issue is significant though as it affects a number of other reported bugs and can result in Codex being fully used up AND runaway costs with API keys. That is very serious. Here's what I'm seeing:
I hit this in production last night, with a variant mechanism and a nastier issue than the original report above. Sharing because I think the impact class is mis-triaged as P3/cosmetic: this is a cost-control failure, not a cosmetic one.
Environment
nousresearch/hermes-agent:latest), s6 container layoutkanban.dispatch_in_gateway: truehermes profile create <name> --clone)What happened
A dispatcher picked up a simple retrieval task. The worker completed the work successfully, but:
kanban_completewas rejected withcould not complete <id> (unknown id or already terminal). The dispatcher's watchdog had already declared the run dead (pid <n> not alive, consistently at ~28s into each run) and re-queued the task. This looks like Protocol violations (rc=0 without complete/block) don't increment failure_limit counter #32747 / fix(kanban): count stale-claim reclaims toward circuit breaker #35212 territory: the work finishes, the completion handshake loses the race, and the breaker counter never advances.consecutive_crashes=10and posted a[critical]diagnostic, but withfailure_limitat its default of 2 the task was never auto-blocked. The diagnostics counter and the circuit-breaker counter are evidently different state, and the breaker never fires on this path.hermes kanban runs <id>gives a clean repro record, 6 of the 10:(The ~28s constant interval on a named-profile worker may also relate to #36981.)
Why this is worse than "cosmetic"
Each phantom-crash respawn is a full paid LLM run. The cascade we ate:
HTTP 429: usage limit reached),fallback_providersentry silently rolled onto the metered API key. The unbounded crash loop graduates from "burning quota" to "burning money" with no ceiling,The original report's 1,192-crashes-in-48h case shows the loop is unbounded in time; ours shows each loop iteration can be a full-cost model invocation routed to a paid API. An unbounded retry loop with paid-API fallback is effectively an uncapped spend bug. I'd argue for P1/P2.
Suggested fix (supporting the OP's and as diagnosed by Claude)
Track consecutive non-success attempts on the task record itself (the diagnostics system already counts them correctly;
consecutive_crashes=10was right there), and have the breaker read that, so it fires regardless of heartbeat/lock state and regardless of crash classification (pre-heartbeat, watchdog reclaim, rejected completion / protocol violation). That single change would close the gap in #35202, #32747, and #35212 together.GottZ commentedon Jul 30, 2026
Summary
One PR, #35212, addresses #35202 by recording failures when stale host-local claims are reclaimed, targeting the pre-heartbeat crash path whose failure count otherwise remains at zero. Its current diff only partially covers the root cause because it uses the default failure limit and applies to every host-local stale reclaim rather than specifically confirmed dead-worker reclaims.
Related pull requests
best fix— (+69/-0) — partial fix; keep open for revision: the diff adds_record_task_failure()torelease_stale_claims()and tests repeated dead-PID reclaims through auto-blocking, directly addressing the reported counter bypass. Consistent with the contributor keep_open review on fix(kanban): count stale-claim reclaims toward circuit breaker #35212, it does not propagate the configuredfailure_limit, and itsif host_localcondition also counts live-PID/stale-heartbeat reclaims, so the scope must be narrowed and the shared limit-propagation issue corrected before merge.Suggested consolidation
Merge #35212 after revising it to distinguish confirmed dead-worker reclaims from live-PID heartbeat-stale reclaims, pass the configured
failure_limitthrough the reclaim and related recorder paths, and test the configured-limit behavior. It is the only and best candidate for #35202, but the visible contributor keep_open review identifies concrete defects in the current diff, so merging it unchanged is not recommended; there are no duplicate PRs to close.Complex graph
flowchart LR classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937 classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151 classDef best stroke-width:3px,stroke:#b45309 classDef target stroke-width:3px,stroke:#4338ca I35202(["issue #35202 (open)"]) P35212["PR #35212 (open)"] P35212 -->|best fix| I35202 class I35202 open class I35202 target class P35212 open class P35212 best click I35202 "https://github.com/NousResearch/hermes-agent/issues/35202" click P35212 "https://github.com/NousResearch/hermes-agent/pull/35212"Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label).
Cross-PR triage: Reviewed 1 pull request and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 4 kB of PR diffs, 6 kB of issue/PR text, 9 kB of discussion (4 comments), 2 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.