{"repo":"NousResearch/hermes-agent","public_id":"18004","display_label":"Cron timeout and SessionDB close ordering around agent worker teardown","summary":"Most members concern cron jobs where an inactivity timeout or interrupt, or a run_job cleanup step, may close SessionDB while the agent worker thread is still running. The reported symptoms include lost session writes and append_message errors, and the PR titles propose waiting for agent teardown or bounding the worker wait before closing.","subsystem":"cron","kind":"bug","counts":{"members":8,"open_issues":2,"open_issues_distinct":2,"open_prs":1,"closed_issues":1,"merged_prs":1,"attempt_prs":4},"landed_fix":{"status":"merged_to_main","basis":"structural","pr":104456,"merged_at":"2026-09-06T17:26:52+00:00"},"resolution":{"state":"partially_resolved","by":"pr-104456"},"freshness":{"state":"verified","last_verified_at":"2026-09-06T17:26:52+00:00","is_stale":false},"grouping":{"backbone":"STRUCTURAL_PARTIAL","link_density":0.20428571428571426},"fix_edges":[{"issue_number":65208,"pr_number":104456,"tier":"verified","basis":"closing_ref","confidence":0.95,"recoverable_from_timeline":true,"pr_merged_at":"2026-09-06T17:26:52+00:00"},{"issue_number":102827,"pr_number":104456,"tier":"verified","basis":"closing_ref","confidence":0.95,"recoverable_from_timeline":true,"pr_merged_at":"2026-09-06T17:26:52+00:00"}],"members":[{"kind":"issue","number":18004,"title":"Cron inactivity timeout can mark a job failed while the agent thread keeps running","url":null,"state":"open"},{"kind":"issue","number":54755,"title":"cron run_job closes session DB before agent.close(), causing \"Session DB append_message failed: 'NoneType' object has no attribute 'execute'\"","url":null,"state":"open"},{"kind":"issue","number":65208,"title":"Cron inactivity timeout closes SessionDB while the agent worker thread is still running → intermittent silent session-write loss","url":null,"state":"closed"},{"kind":"pr","number":39782,"title":"fix(cron): contain timed-out cron workers (#18004)","url":null,"state":"closed","close_reason":{"category":"uncategorized","implication":"needs_llm"},"merged":false},{"kind":"pr","number":54788,"title":"fix(cron): keep SessionDB open until agent teardown completes","url":null,"state":"open","close_reason":{"refs":[{"kind":"commit","value":"ece36e1e57408524ce0c307480af932998dc7138","number":0}],"category":"implemented_elsewhere","implication":"superseded"},"merged":false},{"kind":"pr","number":65227,"title":"fix(cron): wait for agent cleanup after interrupt before closing SessionDB (#65208)","url":null,"state":"closed","close_reason":{"refs":[{"kind":"pr","value":"#104456","number":104456},{"kind":"pr","value":"#103118","number":103118}],"category":"superseded_by_pr","implication":"superseded"},"merged":false},{"kind":"pr","number":65285,"title":"fix(cron): bound worker wait before SessionDB close (#65208)","url":null,"state":"closed","close_reason":{"category":"implemented_elsewhere","implication":"superseded"},"merged":false},{"kind":"pr","number":104456,"title":"SessionDB teardown no longer overlaps a live handle for the same state.db: counted per-path barrier + cron workers own their teardown (#102827, salvage of #103118 by @JoaoMarcos44)","url":null,"state":"merged","close_reason":{"category":"merged"},"merged":true,"is_fix_pr":true,"fix_tier":"verified","files_changed":["agent/trace_upload.py","cron/scheduler.py","cron/scheduler_detached_worker.py","gateway/platforms/api_server.py","gateway/run.py","hermes_cli/web_server_lifecycle.py","hermes_cli/web_server_sessions.py","hermes_state_registry.py","tests/cron/test_cleanup_timeout.py","tests/cron/test_scheduler.py","tests/hermes_state/test_shared_session_db_registry.py"]}],"trust":{"default_tier":"verified","includes_suggested":false}}