hermes-agent/tests/cron
Teknium d345b9fbfe
refactor(cron): derive one-shot run-claim TTL from HERMES_CRON_TIMEOUT (#59567)
Follow-up to #59524. The one-shot running-claim stale-recovery window was a
fixed 30-min constant. Derive it from the cron inactivity timeout instead
(HERMES_CRON_TIMEOUT, the same limit the scheduler enforces per run) so the
safety valve tracks how long a run may actually go quiet:

- unset/invalid -> default 600s inactivity -> TTL 1800s (unchanged behaviour)
- positive N    -> max(N * 3 headroom, 1800s floor)
- 0 (unlimited) -> no finite bound -> fall back to the 1800s constant

The fixed constant is kept as the floor + unlimited-case fallback. Resolved
once per due-scan. HERMES_CRON_TIMEOUT is a pre-existing internal env var
(already read by cron/scheduler.py); no new config surface.

E2E: with HERMES_CRON_TIMEOUT=1200 the claim now survives to 60min where the
old fixed 1800s constant wrongly expired it at 30min mid-run. +1 derivation
test; 640/640 cron tests pass.
2026-07-06 04:57:09 -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 refactor(cron): derive one-shot run-claim TTL from HERMES_CRON_TIMEOUT (#59567) 2026-07-06 04:57:09 -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 fix(cron): release TERMINAL_CWD lock even when run_job body raises 2026-07-01 15:39:48 +05:30