Skip to content

fix(cli): tolerate cron jobs without repeat metadata#20264

Closed
leonardsellem wants to merge 1 commit into
NousResearch:mainfrom
leonardsellem:fix/cron-list-null-repeat
Closed

fix(cli): tolerate cron jobs without repeat metadata#20264
leonardsellem wants to merge 1 commit into
NousResearch:mainfrom
leonardsellem:fix/cron-list-null-repeat

Conversation

@leonardsellem

Copy link
Copy Markdown
Contributor

Summary

  • treat null or absent cron repeat metadata as infinite when rendering hermes cron list
  • add a regression test covering both repeat: null and missing repeat keys

Verification

  • PYTEST_ADDOPTS= PYTEST_PLUGINS= /home/ubuntu/.hermes/hermes-agent/venv/bin/python -m pytest tests/hermes_cli/test_cron.py::TestCronCommandLifecycle::test_list_tolerates_null_and_missing_repeat_metadata -q
  • PYTEST_ADDOPTS= PYTEST_PLUGINS= /home/ubuntu/.hermes/hermes-agent/venv/bin/python -m pytest tests/hermes_cli/test_cron.py -q
  • HERMES_HOME=/home/ubuntu/.hermes PYTHONPATH=$PWD /home/ubuntu/.hermes/hermes-agent/venv/bin/python hermes_cli/main.py cron list --all (exit 0, printed 14 jobs / 14 repeat lines)

Related cron suite note: the broader cron-related subset currently has pre-existing failures on upstream main in this homelab test environment (delivery target thread id leakage / scheduler tests), so I kept the green gate to the directly touched CLI test module plus the live-list smoke above.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cron Cron scheduler and job management comp/cli CLI entry point, hermes_cli/, setup wizard labels May 5, 2026
@mohamedorigami-jpg

Copy link
Copy Markdown
Contributor

Nice fix. The same or {} pattern also applies to schedule and deliver fields in cron_list()schedule_display can be null and deliver can be None instead of a list. Worth rolling those in as well?

@teknium1

Copy link
Copy Markdown
Contributor

This looks implemented on current main by the automated hermes-sweeper review.

Evidence:

  • hermes_cli/cron.py:87 now does repeat_info = job.get("repeat") or {}, so both a missing repeat key and a present-but-null "repeat": null record render as infinite repeat instead of crashing.
  • tests/hermes_cli/test_cron.py:115 adds a regression test for the null-repeat persisted-job shape and asserts Repeat: ∞.
  • The implementation landed in b0d234f068952e7bc198759ae3ca2cda99bae491 (fix(cron): don't crash on cron list when a job's repeat is null), which is contained in v2026.6.5.

The later comment about applying the same defensive pattern to schedule / deliver is useful adjacent hardening, but the repeat-metadata crash fix from this PR is already present on main.

@teknium1 teknium1 closed this Jun 11, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jun 11, 2026
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 comp/cron Cron scheduler and job management P2 Medium — degraded but workaround exists sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants