mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
Defense-in-depth alongside the interpreter-shutdown guard: run_job closed the cron agent's async resources (agent.close + cleanup_stale_async_clients) in its finally block BEFORE run_one_job called _deliver_result, so a live delivery could race a torn-down async client. run_job now accepts an optional defer_agent_teardown holder; when set it hands the live agent back instead of closing it, and run_one_job tears it down (via the extracted _teardown_cron_agent helper) only AFTER delivery — in a finally so a failed run never leaks. Default path (holder=None) is unchanged, so every existing caller keeps inline teardown. Reorder approach based on #58777 by @LavyaTandel; reworked to keep a single delivery site in run_one_job and add regression coverage. Co-authored-by: LavyaTandel <lavya@loom.local> |
||
|---|---|---|
| .. | ||
| __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 | ||
| test_cron_workdir.py | ||
| test_cronjob_schema.py | ||
| test_file_permissions.py | ||
| test_jobs.py | ||
| test_jobs_changed_notify.py | ||
| test_jobs_crossprocess_lock.py | ||
| test_parallel_pool.py | ||
| test_rewrite_skill_refs.py | ||
| test_run_one_job.py | ||
| test_scheduler.py | ||
| test_scheduler_mcp_init.py | ||
| test_scheduler_provider.py | ||
| test_scheduler_shutdown_guard.py | ||
| test_suggestions.py | ||
| test_terminal_cwd_lock.py | ||