Skip to content

fix(kanban): don't classify unobserved worker exits as systemic failures - #83066

Open
julio-cloudvisor wants to merge 1 commit into
NousResearch:mainfrom
devisory-engineering:upstream-exit-unclassified
Open

julio-cloudvisor wants to merge 1 commit into
NousResearch:mainfrom
devisory-engineering:upstream-exit-unclassified

Conversation

@julio-cloudvisor

Copy link
Copy Markdown

Problem

After a dispatcher restart, the next sweep can find several tasks still recorded as running even 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 normalized pid N not alive error.

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_up after one counted failure.

Current main still includes every crash detail in the systemic fingerprint count. It does not distinguish the unknown exit kind from an observed non-zero exit or fatal signal when deciding whether to collapse the limit.

Fix

Carry an unclassified bit 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:

  • an unclassified worker death under a live dispatcher still counts as an ordinary crash;
  • a worker death followed by claimer death still counts, proving the patch does not infer a no-fault restart from PID liveness;
  • four concurrent unclassified exits each record one failure but do not force the systemic limit, so the cards remain retryable under the configured limit;
  • a cohort of matching, observed real crashes still takes the systemic path and trips immediately.

Before opening the PR I would rebase and run the full kanban database suite on current main.

Test run

Rebased on current main and 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.

@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 Aug 10, 2026
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

No deployments
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.

2 participants