Files
hermes-agent/tests/hermes_cli
Teknium c4d1ba0e2f fix(cron): run prompt recovery inside the cron writer lock
Post-update cron prompt recovery (#82990) read jobs.json, patched the
in-memory copy, and atomically replaced the whole file without joining
cron.jobs._jobs_lock. Atomic replace prevents torn bytes, not a lost
update: any cron edit committed between recovery's read and its publish
(a new job, a removal, a schedule edit, a legitimate prompt rewrite) was
silently erased or reverted. Inherited from hermes_cli/backup.py and
preserved by the extraction.

Recovery now uses the unlocked read only as a cheap gate (healthy path
stays side-effect free), then pins the store and lock to the target home
with use_cron_store(), takes the canonical _jobs_lock, re-reads via
load_jobs(), restores only prompts that are STILL degraded for snapshot
ids, and publishes through the locked, merge-aware save_jobs(). The
conservative predicate (blank or name-collapsed prompt, no_agent skipped,
blank snapshot prompt restores nothing, unknown ids untouched) is
unchanged. A real-file regression races create/remove/schedule-edit/
prompt-edit through the production cron writer between the read and the
publish; it fails on r7-base and passes now.

Review: https://github.com/NousResearch/hermes-agent/pull/106742#pullrequestreview-5464799967
(cherry picked from commit 4f903148be8a50ce2869c8e6f492b5be2d399ba1)
2026-10-09 02:10:47 -07:00
..
2026-10-08 21:35:58 +02:00
2026-10-08 21:35:58 +02:00
2026-10-08 21:29:48 +02:00
2026-10-08 21:29:48 +02:00
2026-10-08 21:29:48 +02:00
2026-10-08 21:29:48 +02:00