Skip to content

fix(cron): config migration (23 to 24) may silently clear cron/jobs.json #34600

@lvandenbussche

Description

@lvandenbussche

Bug Description

After running hermes update (v2026.5.29, 118 commits), which migrated config version from 23 to 24, the file ~/.hermes/cron/jobs.json was found empty — all 17 scheduled cron jobs were lost silently.

Impact

  • All cron jobs stopped working
  • User only noticed hours later when expected reports didn't arrive
  • No automatic alert or restoration mechanism
  • The pre-update snapshot (state-snapshots/YYYYMMDD-HHMMSS-pre-update/cron/jobs.json) retained the data, but no auto-restore occurred

Steps to Reproduce

  1. Have ~17 cron jobs configured
  2. Run hermes update with config version migration (23 to 24)
  3. Observe that cron/jobs.json is empty after the update
  4. Cron ticker restarts with 0 jobs

Root Cause Analysis

The file ~/.hermes/cron/jobs.json exists after the update but is empty or truncated. The config migration code path may be rewriting the file without preserving existing jobs.

Previous related fix: commit 2a6cbf5 — but this scenario may not raise because the file is valid JSON, just empty.

Expected Behavior

  • Config migration should preserve existing cron jobs
  • OR: update should warn before discarding jobs
  • OR: auto-restore from pre-update snapshot

Environment

  • Hermes Agent v0.15.1 (2026.5.29)
  • Linux
  • Python 3.11.2
  • Cron storage: jobs.json

Workaround

Restore from ~/.hermes/state-snapshots/YYYYMMDD-HHMMSS-pre-update/cron/jobs.json.

Suggested Fix

  1. Migration handler preserving existing jobs
  2. Post-update integrity check comparing with snapshot
  3. Warning during update if jobs will be discarded

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundarea/configConfig system, migrations, profilescomp/cliCLI entry point, hermes_cli/, setup wizardcomp/cronCron scheduler and job managementtype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions