diff --git a/agent/curator.py b/agent/curator.py index cf4b13f8ef..3bd71d46c0 100644 --- a/agent/curator.py +++ b/agent/curator.py @@ -36,7 +36,7 @@ from tools import skill_usage logger = logging.getLogger(__name__) -DEFAULT_INTERVAL_HOURS = 24 +DEFAULT_INTERVAL_HOURS = 24 * 7 # 7 days DEFAULT_MIN_IDLE_HOURS = 2 DEFAULT_STALE_AFTER_DAYS = 30 DEFAULT_ARCHIVE_AFTER_DAYS = 90 diff --git a/hermes_cli/config.py b/hermes_cli/config.py index c1fcdf976f..22ad4004f3 100644 --- a/hermes_cli/config.py +++ b/hermes_cli/config.py @@ -927,8 +927,8 @@ DEFAULT_CONFIG = { # See `hermes curator status` for the last run summary. "curator": { "enabled": True, - # How long to wait between curator runs (hours). - "interval_hours": 24, + # How long to wait between curator runs (hours). Default: 7 days. + "interval_hours": 24 * 7, # Only run when the agent has been idle at least this long (hours). "min_idle_hours": 2, # Mark a skill as "stale" after this many days without use. diff --git a/hermes_cli/curator.py b/hermes_cli/curator.py index 0325cf5cf6..f580005794 100644 --- a/hermes_cli/curator.py +++ b/hermes_cli/curator.py @@ -55,7 +55,12 @@ def _cmd_status(args) -> int: print(f" runs: {runs}") print(f" last run: {_fmt_ts(last_run)}") print(f" last summary: {summary}") - print(f" interval: every {curator.get_interval_hours()}h") + _ih = curator.get_interval_hours() + _interval_label = ( + f"{_ih // 24}d" if _ih % 24 == 0 and _ih >= 24 + else f"{_ih}h" + ) + print(f" interval: every {_interval_label}") print(f" stale after: {curator.get_stale_after_days()}d unused") print(f" archive after: {curator.get_archive_after_days()}d unused") diff --git a/tests/agent/test_curator.py b/tests/agent/test_curator.py index a9b0929b97..f5449d08e0 100644 --- a/tests/agent/test_curator.py +++ b/tests/agent/test_curator.py @@ -62,7 +62,7 @@ def test_curator_disabled_via_config(curator_env, monkeypatch): def test_curator_defaults(curator_env): c = curator_env["curator"] - assert c.get_interval_hours() == 24 + assert c.get_interval_hours() == 24 * 7 # 7 days assert c.get_min_idle_hours() == 2 assert c.get_stale_after_days() == 30 assert c.get_archive_after_days() == 90 @@ -101,15 +101,20 @@ def test_recent_run_blocks(curator_env): def test_old_run_eligible(curator_env): + """A run older than the configured interval should re-trigger. Use a + 2x-interval cushion so the test doesn't become coupled to the exact + default — bumping DEFAULT_INTERVAL_HOURS shouldn't break it.""" c = curator_env["curator"] - long_ago = datetime.now(timezone.utc) - timedelta(hours=48) + long_ago = datetime.now(timezone.utc) - timedelta( + hours=c.get_interval_hours() * 2 + ) c.save_state({"last_run_at": long_ago.isoformat(), "paused": False}) assert c.should_run_now() is True def test_paused_blocks_even_if_stale(curator_env): c = curator_env["curator"] - long_ago = datetime.now(timezone.utc) - timedelta(days=5) + long_ago = datetime.now(timezone.utc) - timedelta(days=30) c.save_state({"last_run_at": long_ago.isoformat(), "paused": True}) assert c.should_run_now() is False