NousResearch/hermes-agent

Cron timeout and SessionDB close ordering around agent worker teardown

Cluster 18004 · cron · Bug. Data as of

3 open items. Fix merged in #104456 on 6 Sep 2026. Check it covers your case.

The short answer

2open issues
1open PR
8items grouped
Known?
Yes. 8 related items grouped here, 1 issue already closed.
Fix event
A fix was merged to main in PR #104456. Check it covers your case. No release data is tracked. Fix link checked: 6 Sep 2026.
Tracker
The maintainers' tracker marks this partially resolved, deciding PR #104456. That is separate from the fix event.

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.

Open issues2

  • Issue#18004Cron inactivity timeout can mark a job failed while the agent thread keeps running
  • Issue#54755cron run_job closes session DB before agent.close(), causing "Session DB append_message failed: 'NoneType' object has no attribute 'execute'"

Open PRs1

  • PR#54788fix(cron): keep SessionDB open until agent teardown completes

Fixes on record

Merged to main. A stamp counts the issues a fix is linked to.

  • #104456 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)

    merged to main

    files: 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

3 PRs closed without merging

From the close comments: done elsewhere 1 · superseded by another PR 1 · other 1

  • #39782 fix(cron): contain timed-out cron workers (#18004) · other
  • #65227 fix(cron): wait for agent cleanup after interrupt before closing SessionDB (#65208) · superseded by another PR → #104456, #103118
  • #65285 fix(cron): bound worker wait before SessionDB close (#65208) · done elsewhere
Closed issues · 1
  • Closed#65208Cron inactivity timeout closes SessionDB while the agent worker thread is still running → intermittent silent session-write loss
How this cluster was grouped
  • Link evidence (partly structural links): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text.
  • Members outside that structural core may belong to a different underlying problem.
  • Pairwise link density 0.20: the share of item pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. 1.00 means every pair is linked.

For your agent

The same facts, typed.