# NousResearch/hermes-agent · Fix stale WAL checkpoint corrupting state.db at shutdown

## Open now

- Nothing open on GitHub.

A bug allowed handles that had lost their WAL generation to perform a checkpoint into state.db during graceful shutdown, potentially corrupting it. These issues and fixes add guards to skip or block that stale checkpoint when the WAL generation has been replaced or deleted.

## TL;DR

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

- #105670: WAL generation split-brain: DeletedWalGenerationError guarded writes, but the graceful-shutdown checkpoint then corrupted state.db (field report)

## Prior & competing PRs

- **#106315: fix(state): a handle that lost its WAL generation no longer checkpoints stale frames into state.db at shutdown (#105670; salvage #105692, dup #105686)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `hermes_state.py`, `hermes_state_schema.py`, `tests/hermes_state/test_deleted_wal_checkpoint_guard.py`
- **#105686: fix(sessions): skip stale WAL checkpoint at shutdown**. closed without merge
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#105692`, `#105670`
- **#105692: fix(state): guard close-time checkpoint for replaced/deleted-generation handles**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `f290946e4e`, `#106315`, `#105686`

## Fix status

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