# NousResearch/hermes-agent · SessionDB corruption quarantine and shutdown safety

## Open now

- Nothing open on GitHub.

These items address a bug where a structurally corrupt state.db could have WAL checkpoint data written to wrong page numbers, and introduce quarantining of the corrupt SessionDB handle to prevent further damage, along with quiescing the thread pool before closing state.db at shutdown.

## TL;DR

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

- #101093: \[Bug\]: close-time WAL checkpoint on a structurally corrupt state.db wrote 15 pages to wrong page numbers (page 1 <- FTS trigram leaf)

## Prior & competing PRs

- **#101118: fix(gateway): quiesce the thread pool before closing state.db at shutdown**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `gateway/run.py`, `tests/gateway/test_shutdown_executor_quiesce.py`
- **#101224: fix(state): quarantine SessionDB handle after structural corruption (salvage of #101095)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `contributors/emails/[redacted:email]`, `docs/state-db-recovery.md`, `gateway/session.py`, `hermes_state.py`, `run_agent.py`, `tests/gateway/test_session_db_corrupt_fallback.py`, `tests/hermes_state/test_state_db_corrupt_quarantine.py`, `tests/run_agent/test_flush_diverts_on_corrupt_state_db.py`, `tests/run_agent/test_turn_completion_explainer.py`, `tests/state/test_fts_runtime_rebuild.py`, `tests/test_state_db_notadb_fail_closed.py`
- **#101095: fix(state): quarantine SessionDB handle after structural corruption (no retry, no close-time checkpoint)**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `#101224`, `#101093`

## Fix status

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