hermes-agent/cron
Teknium d1afa16053 fix(cron): retain completed one-shot jobs instead of deleting them on completion
mark_job_run popped a finite one-shot from jobs.json the moment its
repeat limit was reached and returned early — discarding the
last_status / last_error / last_delivery_error it had just written.
Every finished one-shot vanished from `cronjob action=list` with no
inspectable record, and a delivery failure (agent succeeded, platform
send failed) was silently thrown away with it.

Changes:
- mark_job_run now retires a limit-reached one-shot as a terminal
  record (state="completed", enabled=False, next_run_at=None) —
  mirroring the existing next_run_at-is-None terminal branch — so the
  final status and any delivery error persist and surface in the
  cronjob tool's list output (which already emits last_delivery_error
  and defaults to include_disabled=True).
- claim_dispatch's stale-job cleanup marks already-ran jobs completed
  instead of popping them; genuinely wedged claims (last_run_at never
  written) are still removed with the operator-visible diagnostic.
- Retention sweep in the due scan prunes completed one-shot records
  older than cron.completed_retention_days (default 7; non-positive
  disables) so jobs.json cannot grow unboundedly. Recurring jobs and
  non-terminal one-shots are never candidates.

Tests: completion retains record + delivery error, list surfaces it,
completed jobs never re-dispatch, sweep prunes old / keeps recent /
ignores recurring / honors the disable knob; recurring lifecycle
unchanged.
2026-08-02 23:12:00 -07:00
..
scripts
__init__.py
blueprint_catalog.py
executions.py fix(state): make journal mode canonical and behaviorally verified 2026-07-29 18:13:09 -07:00
jobs.py fix(cron): retain completed one-shot jobs instead of deleting them on completion 2026-08-02 23:12:00 -07:00
lifecycle_guard.py fix: check NUL bytes before size limit in _read_referenced_script 2026-08-03 10:11:39 +05:30
scheduler.py fix: Discord-specific guard + cron sibling + non-regression tests 2026-08-03 00:32:17 +05:30
scheduler_provider.py fix(cron): preserve jobs.json ownership on root rewrite + surface failing-tick reason 2026-07-24 15:52:13 -07:00
suggestion_catalog.py
suggestions.py fix(cron): make per-profile cron isolation intentional and tested (#4707) (#53570) 2026-06-27 03:55:01 -07:00