hermes-agent/tests/cron
kshitij fb6446fc9e fix(cron): scope cron approval context per session
Replace the process-global HERMES_CRON_SESSION env var with a per-session
ContextVar so a cron tick in the gateway process cannot leak into unrelated
live gateway/API/TUI turns. The cron scheduler now sets the ContextVar
inside the job's try/finally scope and resets it on cleanup. Gateway, API
server, ACP adapter, and TUI gateway all pass cron_session='' to explicitly
mark their sessions as non-cron, masking any stale process env.

Co-authored-by: hinablue <hinablue@gmail.com>
Closes #37968
2026-08-03 00:25:20 +05:30
..
__init__.py
conftest.py fix(cron): scope cron approval context per session 2026-08-03 00:25:20 +05:30
test_blueprint_catalog.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_claim_job_for_fire.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_codex_execution_paths.py test(cron): accept target_model kwarg in codex-path resolver stub 2026-07-19 09:57:21 -07:00
test_compute_next_run_last_run_at.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_cron_context_from.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_cron_direct_api_call_62151.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_cron_inactivity_timeout.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_cron_no_agent.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_cron_profile_isolation.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_cron_prompt_injection_skill.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_cron_provider_pin.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_cron_script.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_cron_workdir.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_cronjob_schema.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_execution_ledger.py perf(cron): batch advance_next_run for the due-dispatch loop 2026-08-02 21:15:16 +05:30
test_file_permissions.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_jobs.py perf(cron): batch advance_next_run for the due-dispatch loop 2026-08-02 21:15:16 +05:30
test_jobs_changed_notify.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_jobs_crossprocess_lock.py
test_jobs_file_ownership.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_parallel_pool.py perf(cron): batch advance_next_run for the due-dispatch loop 2026-08-02 21:15:16 +05:30
test_reasoning_config_per_model.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_rewrite_skill_refs.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_run_one_job.py perf(cron): batch advance_next_run for the due-dispatch loop 2026-08-02 21:15:16 +05:30
test_scheduler.py perf(cron): batch advance_next_run for the due-dispatch loop 2026-08-02 21:15:16 +05:30
test_scheduler_cron_session_isolation.py fix(cron): scope cron approval context per session 2026-08-03 00:25:20 +05:30
test_scheduler_mcp_init.py
test_scheduler_provider.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_scheduler_shutdown_guard.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_script_claim_heartbeat.py fix: update heartbeat test stubs to accept workdir kwarg 2026-07-24 15:55:39 -07:00
test_sessiondb_init_hang.py perf(cron): batch advance_next_run for the due-dispatch loop 2026-08-02 21:15:16 +05:30
test_shutdown_interrupt.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_suggestions.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_terminal_cwd_lock.py
test_ticker_stall_60703.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00