hermes-agent/tests/cron
Teknium 3b5c645433 fix(cron): durable run-claim for one-shots instead of a fixed +60s advance
The +60s next_run_at advance only delayed a duplicate one-shot dispatch by
one tick — a job that outlives the 60s tick interval (the reported 2.5-min
research prompt) still re-fired on the next tick after the window expired,
so the concurrent gateway+desktop double-delivery persisted.

Replace it with a durable run_claim (at+by, mirroring fire_claim) stamped
on the one-shot under the same jobs lock get_due_jobs holds, and checked at
the top of the due-scan: a fresh claim held by an in-flight run makes every
other scheduler process skip the job for its ENTIRE run, not one tick.
mark_job_run() clears the claim on completion; a ONESHOT_RUN_CLAIM_TTL
(30 min) safety valve re-dispatches a claim left by a tick that died mid-run
so a one-shot is never wedged.

E2E: long-running one-shot no longer double-fires at +28/+61/+120/+179s;
completion clears the claim + disables the job; crash recovery re-arms past
the TTL. +3 regression tests.
2026-07-06 03:17:21 -07:00
..
__init__.py
…
conftest.py
…
test_blueprint_catalog.py
…
test_claim_job_for_fire.py
…
test_codex_execution_paths.py
…
test_compute_next_run_last_run_at.py
…
test_cron_context_from.py
…
test_cron_inactivity_timeout.py
…
test_cron_no_agent.py
…
test_cron_profile_isolation.py
…
test_cron_prompt_injection_skill.py
…
test_cron_provider_pin.py
…
test_cron_script.py fix: reject stale one-shot cron jobs 2026-07-06 12:11:41 +05:30
test_cron_workdir.py fix(cron): deliver before tearing down the agent's async clients (#58720) 2026-07-06 02:05:46 +05:30
test_cronjob_schema.py
…
test_file_permissions.py
…
test_jobs.py fix(cron): durable run-claim for one-shots instead of a fixed +60s advance 2026-07-06 03:17:21 -07:00
test_jobs_changed_notify.py
…
test_jobs_crossprocess_lock.py
…
test_parallel_pool.py fix(cron): deliver before tearing down the agent's async clients (#58720) 2026-07-06 02:05:46 +05:30
test_rewrite_skill_refs.py
…
test_run_one_job.py fix(cron): deliver before tearing down the agent's async clients (#58720) 2026-07-06 02:05:46 +05:30
test_scheduler.py fix(cron): deliver before tearing down the agent's async clients (#58720) 2026-07-06 02:05:46 +05:30
test_scheduler_mcp_init.py
…
test_scheduler_provider.py
…
test_scheduler_shutdown_guard.py test(cron): cover the interpreter-shutdown scheduling guard (#58720) 2026-07-06 02:05:46 +05:30
test_suggestions.py
…
test_terminal_cwd_lock.py
…