# NousResearch/hermes-agent · SQLite WAL reader leak from finished threads

## Open now

- Nothing open on GitHub.

These issues and PRs address a bug where WAL read connections from finished worker threads accumulate without being reclaimed, potentially exhausting file descriptor limits. The work involves safely reaping, bounding, and reusing these connections at runtime rather than waiting until shutdown.

## TL;DR

- 5 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 1 merged PR(s), 3 PR(s) closed without merging.
- A fix was merged to main in PR #83406. Verify it addresses your case.
- **Recommended:** read PR #83406 (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: `unresolved`. 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.40`: 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

- #75269: \[Bug\]: SessionDB retains WAL readers from finished worker threads until shutdown, exhausting RLIMIT_NOFILE

## Prior & competing PRs

- **#83406: fix(state,desktop,runtime): EMFILE cascade — bounded WAL read pool, orphan serve reap, nofile floor**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `apps/desktop/electron/backend-child.ts`, `apps/desktop/electron/main.ts`, `apps/desktop/electron/windows-child-options.test.ts`, `cli-config.yaml.example`, `contributors/emails/[redacted:email]`, `contributors/emails/[redacted:email]`, `contributors/emails/[redacted:email]`, `gateway/run.py`, `hermes_cli/config_defaults.py`, `hermes_cli/dashboard_procs.py`, `hermes_cli/gateway.py`, `hermes_cli/main.py`, `hermes_cli/resource_limits.py`, `hermes_cli/web_server.py`, `hermes_state.py`, `tests/hermes_cli/test_dashboard_admin_endpoints.py`, `tests/hermes_cli/test_gateway_service.py`, `tests/hermes_cli/test_orphan_desktop_serve_reap.py`, `tests/test_resource_limits.py`, `tests/test_session_db_read_conn_pool.py` (+2 more)
- **#75322: fix(state): reap finished-thread WAL read connections at runtime (#75269)**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `#83406`, `#76700`
- **#75352: fix(state): safely reclaim finished-thread WAL readers**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `#83406`, `#76700`
- **#81082: fix(state): bound reusable SQLite WAL readers**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `87aedbe7b`

## Fix status

- Merged to main in PR #83406 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-08-11`.
