mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-09 13:21:42 +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> |
||
|---|---|---|
| .. | ||
| scripts | ||
| __init__.py | ||
| blueprint_catalog.py | ||
| jobs.py | ||
| lifecycle_guard.py | ||
| scheduler.py | ||
| scheduler_provider.py | ||
| suggestion_catalog.py | ||
| suggestions.py | ||