Repository navigation
fix(kanban): don't classify unobserved worker exits as systemic failures - #83066
Open
julio-cloudvisor wants to merge 1 commit into
Open
julio-cloudvisor wants to merge 1 commit into
julio-cloudvisor wants to merge 1 commit into
Conversation
garadice
added a commit
to garadice/hermes-agent
that referenced
this pull request
Sep 8, 2026
…vity, sync exit_kind contract - DispatchResult.supervisor_restarts: new field, plumbed from detect_crashed_workers._last_supervisor_restart in _run_reclaim_phase — dispatch_once callers (CLI output, telemetry, on_kanban_dispatch_tick) can now see neutral gateway-restart releases. - _TICK_ACTIVITY_FIELDS: count supervisor_restarts as tick activity so a restart releasing N pre-boot claims no longer reports outcome='idle'. - plugins.py on_kanban_worker_exited contract: document the new 'supervisor_restart' exit_kind value. - _supervisor_restart_collateral docstring: prove only what durable state proves (unobserved-by-any-live-dispatcher) and name the residual one-shot-dispatcher ambiguity explicitly (NousResearch#83066, NousResearch#103961). - Regression tests: tick-level red/green test for the plumb + whitelist. Co-authored-by: crazyief <8566250+crazyief@users.noreply.github.com>
garadice
added a commit
to garadice/hermes-agent
that referenced
this pull request
Sep 22, 2026
…vity, sync exit_kind contract - DispatchResult.supervisor_restarts: new field, plumbed from detect_crashed_workers._last_supervisor_restart in _run_reclaim_phase — dispatch_once callers (CLI output, telemetry, on_kanban_dispatch_tick) can now see neutral gateway-restart releases. - _TICK_ACTIVITY_FIELDS: count supervisor_restarts as tick activity so a restart releasing N pre-boot claims no longer reports outcome='idle'. - plugins.py on_kanban_worker_exited contract: document the new 'supervisor_restart' exit_kind value. - _supervisor_restart_collateral docstring: prove only what durable state proves (unobserved-by-any-live-dispatcher) and name the residual one-shot-dispatcher ambiguity explicitly (NousResearch#83066, NousResearch#103961). - Regression tests: tick-level red/green test for the plumb + whitelist. Co-authored-by: crazyief <8566250+crazyief@users.noreply.github.com>
This branch has not been deployed
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.
Problem
After a dispatcher restart, the next sweep can find several tasks still recorded as
runningeven though their worker PIDs are dead. The new dispatcher cannot recover the exit status because the reap registry was in the old process, so each death becomes the same normalizedpid N not aliveerror.The systemic-failure detector groups three or more identical fingerprints and forces an effective failure limit of one. A restart with several in-flight workers can therefore mass-block healthy cards on first contact, even when the configured failure limit is higher.
We have seen this in a multi-profile deployment: one dispatcher restart left four healthy cards with unclassified dead workers, and the shared fingerprint sent all four directly to
gave_upafter one counted failure.Current main still includes every crash detail in the systemic fingerprint count. It does not distinguish the
unknownexit kind from an observed non-zero exit or fatal signal when deciding whether to collapse the limit.Fix
Carry an
unclassifiedbit with each crash detail and exclude those rows from the systemic-failure accelerator. An unclassified worker still counts one ordinary failure against the task's configured limit; it simply cannot make a cohort systemic when the only shared fact is that the dispatcher lost their exit evidence.That conservative boundary is intentional. The durable state cannot distinguish a worker killed by the restart from a genuine SIGKILL or OOM death whose dispatcher disappeared before persisting the status. Treating every unknown exit as no-fault would hide real crashes. Keeping the ordinary failure while declining to collapse the limit avoids both errors.
Observed exits remain unchanged: repeated matching non-zero exits or crash signals can still trigger the systemic accelerator.
Testing
The carried patch covers the ambiguous and observed cases separately:
Before opening the PR I would rebase and run the full kanban database suite on current main.
Test run
Rebased on current
mainand re-verified:scripts/run_tests.sh tests/hermes_cli/test_kanban_db.py tests/hermes_cli/test_kanban_core_functionality.py — 57 passed, 0 failed.