# NousResearch/hermes-agent · state.db read connection pool leak and limits

## Open now

- Nothing open on GitHub.

These items address per-thread read connections to state.db that are never closed in long-lived gateway processes, and introduce bounding and reduction of the read connection pool to control file-descriptor usage.

## TL;DR

- 3 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 1 merged PR(s), 1 PR(s) closed without merging.
- A fix was merged to main in PR #98691. Verify it addresses your case.
- **Recommended:** read PR #98691 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `resolved` · deciding PR(s): `pr-98691`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_SPANNING`): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
- Pairwise link density `0.67`: the share of member 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.

## Closed / duplicate issues

- #98573: long-lived gateway holds ~20 state.db handles per process; per-thread read connections are never released

## Prior & competing PRs

- **#98691: fix(state): bound state.db read connections per file, not per SessionDB**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `gateway/run.py`, `hermes_state.py`, `tests/gateway/test_session_db_handle_sharing.py`, `tests/test_session_db_read_conn_pool.py`
- **#98585: fix(state): reduce _READ_POOL_MAX 8→4 to halve peak state.db file-descriptor budget**. closed without merge
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `#98573`

## Fix status

- Merged to main in PR #98691 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-08-31`.
- Subsystem: `agent`
