fix: harden memory and kanban reliability - #31564
Conversation
- 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
teknium1
left a comment
There was a problem hiding this comment.
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:4673changes notifier delivery to("completed",)only. Current main deliberately preserves abnormal-event notification and retry-cycle delivery ingateway/kanban_watchers.py:165-179;tests/hermes_cli/test_kanban_notify.py:82-149covers this contract.gateway/run.py:4649introducesHERMES_KANBAN_NOTIFY_IN_GATEWAYdespite addingkanban.notify_in_gatewayin the same patch.AGENTS.md:102-107requires behavioral settings to useconfig.yaml, not new non-secretHERMES_*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_gatewayfor this behavior.
Automated hermes-sweeper review.
| # 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",) |
There was a problem hiding this comment.
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.
| except Exception: | ||
| logger.warning("kanban notifier: config loader unavailable; disabled") | ||
| return | ||
| env_override = os.environ.get("HERMES_KANBAN_NOTIFY_IN_GATEWAY", "").strip().lower() |
There was a problem hiding this comment.
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.
Summary
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 -qpython -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