Skip to content

fix: harden memory and kanban reliability - #31564

Open
Thawpoint wants to merge 2 commits into
NousResearch:mainfrom
Thawpoint:fix/kanban-reliability-main
Open

fix: harden memory and kanban reliability#31564
Thawpoint wants to merge 2 commits into
NousResearch:mainfrom
Thawpoint:fix/kanban-reliability-main

Conversation

@Thawpoint

Copy link
Copy Markdown

Summary

  • harden Kanban/cron/gateway reliability paths around WAL/DB checks, low-noise watchdog routing, notifier delivery, and blocked/review handoffs
  • add Hindsight memory budget/config guardrails and test coverage
  • document the low-noise Kanban cron watchdog runbook
  • preserve sticky worker/operator review blocks while avoiding immediate reopen of parentless circuit-breaker gave-up tasks

Test Plan

  • python -m pytest -o 'addopts=' tests/hermes_cli/test_kanban_blocked_sticky.py tests/hermes_cli/test_kanban_db.py::test_recompute_ready_does_not_immediately_reopen_gave_up_tasks -q
  • python -m pytest -o 'addopts=' tests/cron/test_scheduler.py tests/cron/test_vicky_kanban_cron_watchdogs.py tests/gateway/test_kanban_notifier.py tests/gateway/test_kanban_reply_targets.py tests/gateway/test_restart_resume_pending.py tests/hermes_cli/test_config.py tests/hermes_cli/test_kanban_blocked_sticky.py tests/hermes_cli/test_kanban_core_functionality.py tests/hermes_cli/test_kanban_db.py tests/hermes_cli/test_kanban_notify.py tests/hermes_cli/test_kanban_specify.py tests/plugins/memory/test_hindsight_provider.py tests/test_hermes_state_wal_fallback.py tests/tools/test_kanban_tools.py -q

- add Hindsight memory setup/config validation coverage
- harden Kanban notifier cursors, reply targets, and dedicated notification bot routing
- add Kanban DB integrity/repair commands with cooperative maintenance locking
- add watchdog/runbook coverage for low-noise Kanban cron monitoring
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cron Cron scheduler and job management comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins comp/cli CLI entry point, hermes_cli/, setup wizard labels May 24, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the broad reliability work. Some of the targeted failure modes are already addressed on current main, but two parts need rework before any salvage.

Problems

  • gateway/run.py:4673 changes notifier delivery to ("completed",) only. Current main deliberately preserves abnormal-event notification and retry-cycle delivery in gateway/kanban_watchers.py:165-179; tests/hermes_cli/test_kanban_notify.py:82-149 covers this contract.
  • gateway/run.py:4649 introduces HERMES_KANBAN_NOTIFY_IN_GATEWAY despite adding kanban.notify_in_gateway in the same patch. AGENTS.md:102-107 requires behavioral settings to use config.yaml, not new non-secret HERMES_* variables.

Suggested changes

  • Preserve the existing abnormal-event notifier contract; isolate any completion-only policy as a separately configured and tested change.
  • Use only kanban.notify_in_gateway for this behavior.

Automated hermes-sweeper review.

Comment thread gateway/run.py
# task is genuinely done lets the cursor (advanced atomically by
# claim_unseen_events_for_sub) handle dedup, and any retry-loop
# event reaches the user.
TERMINAL_KINDS = ("completed",)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This suppresses blocked/gave_up/crashed/timed_out notifications. Current main intentionally keeps those events visible and retains subscriptions across retry cycles (gateway/kanban_watchers.py:165-179; tests/hermes_cli/test_kanban_notify.py:82-149). Please preserve that contract or split a completion-only policy into a separately configured change.

Comment thread gateway/run.py
except Exception:
logger.warning("kanban notifier: config loader unavailable; disabled")
return
env_override = os.environ.get("HERMES_KANBAN_NOTIFY_IN_GATEWAY", "").strip().lower()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this new non-secret behavioral environment override. The patch already adds kanban.notify_in_gateway; AGENTS.md:102-107 requires user-facing behavioral settings to live in config.yaml rather than new HERMES_* variables.

@teknium1 teknium1 added sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform area/memory Memory subsystem: store, providers, sync, background reviews labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/memory Memory subsystem: store, providers, sync, background reviews comp/cli CLI entry point, hermes_cli/, setup wizard comp/cron Cron scheduler and job management comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants