Skip to content

feat(cron): add executions prune/clear CLI commands (#59909) - #59921

Closed
webtecnica wants to merge 1 commit into
NousResearch:mainfrom
webtecnica:feat/59909-cron-prune
Closed

webtecnica wants to merge 1 commit into
NousResearch:mainfrom
webtecnica:feat/59909-cron-prune

Conversation

@webtecnica

Copy link
Copy Markdown
Contributor

Summary

Cron job execution history accumulates indefinitely under ~/.hermes/cron/output/<job_id>/, with no way to clean it. This adds CLI commands to manage it.

Changes

hermes cron executions prune --older-than 7d

Deletes execution output files older than N days/hours/minutes/seconds. Useful for automated cleanup (can be run as a cron job itself).

hermes cron executions clear --job-id <id> / hermes cron executions clear --all

Clears execution history for a specific job or all jobs.

Implementation

  • Parser: hermes_cli/subcommands/cron.py — new executions subcommand with prune and clear sub-parsers
  • Handler: hermes_cli/cron.py — _cron_executions() function reading from ~/.hermes/cron/output/
  • Gracefully handles missing output directory, invalid --older-than format, and non-existent job IDs

Files Changed

File Δ
hermes_cli/subcommands/cron.py +22 lines
hermes_cli/cron.py +66 lines

Closes #59909

Adds `hermes cron executions prune --older-than 7d` and
`hermes cron executions clear --job-id <id> | --all` for
managing cron job execution output files.

Closes NousResearch#59909
@webtecnica

Copy link
Copy Markdown
Contributor Author

@teknium1 Ready for review. New CLI commands hermes cron executions prune --older-than 7d and hermes cron executions clear --job-id <id> | --all for managing accumulated execution history. 88 lines total. 🙏

@alt-glitch alt-glitch added type/feature New feature or request comp/cli CLI entry point, hermes_cli/, setup wizard comp/cron Cron scheduler and job management P3 Low — cosmetic, nice to have labels Jul 7, 2026
@teknium1

Copy link
Copy Markdown
Collaborator

Thanks for the cleanup proposal. This is an automated hermes-sweeper review; current main already covers the reported retention and CLI cleanup needs.

  • cron/jobs.py:2192-2193 prunes per-job output on every save using cron.output_retention (default 50); this shipped in e4ff4948604d8da69f95ed1e555678d23de1ca18 and is contained in v2026.7.1.
  • The desktop's cron-history list is SessionDB-backed (hermes_cli/web_server.py:10514-10544), rather than derived from cron/output/ files.
  • The existing hermes sessions prune --source cron path deletes those cron sessions, with --older-than for age-bounded cleanup and a preview/confirmation flow (hermes_cli/main.py:14469-14563).

Because the current implementation already provides retention for output files and a CLI purge for the desktop-visible run history, this PR is redundant.

@teknium1 teknium1 closed this Jul 15, 2026
@teknium1 teknium1 added sweeper:implemented-on-main Sweeper: behavior already present on current main sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data 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-contained Sweeper blast radius: contained — one narrow path / opt-in / few users labels Jul 15, 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 P3 Low — cosmetic, nice to have sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users sweeper:implemented-on-main Sweeper: behavior already present on current main 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:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Feature Request: Add ability to delete/manage cron job execution history entries in desktop GUI

3 participants