# NousResearch/hermes-agent · SQLite concurrency, WAL locks, and session integrity

## Open now

- 1 issue, 0 PRs open on GitHub.
- #30816: apply_wal_with_fallback: DELETE fallback uncaught — crashes on APFS external SSDs

These issues and fixes center on SQLite write-lock contention, WAL mode failures (including APFS edge cases), and resulting problems with session indexing and state reliability when CLI and gateway processes access the database concurrently. Several members address error handling, retries, and fallback strategies to prevent silent failures and freezes.

## TL;DR

- 4 member(s): 1 open issue(s), 0 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 #108082. Verify it addresses your case.
- **Recommended:** read PR #108082 (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.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.

## Open related issues

- #30816: apply_wal_with_fallback: DELETE fallback uncaught — crashes on APFS external SSDs

## Prior & competing PRs

- **#108082: state.db no longer wedges on a healthy WAL: OpenZFS/close() false DeletedWalGenerationError, unconfirmed-WAL read pool, transient read IOERR, stale lock banner (#107401 #105567 #86515 #100871 #108031, salvage #107411 #105578 #105711 #106958)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `agent/turn_explainers.py`, `contributors/emails/[redacted:email]`, `contributors/emails/nikkoxgonzales@users.noreply.github.com`, `gateway/run_notifications.py`, `hermes_state.py`, `hermes_state_dbfile.py`, `hermes_state_errors.py`, `hermes_state_readpool.py`, `hermes_state_wal.py`, `tests/gateway/test_session_db_warning_recheck.py`, `tests/hermes_state/test_deleted_wal_generation_guard.py`, `tests/hermes_state/test_read_path_transient_ioerr.py`, `tests/hermes_state/test_wal_active_confirmed.py`, `tests/run_agent/test_turn_completion_explainer.py`, `tests/test_hermes_state_wal_fallback.py`
- **#30823: fix(state): wrap DELETE journal_mode fallback in try/except to survive APFS double-failure**. closed without merge
  - maintainer direction: category `stale_abandoned`; implication `active`
- **#106958: fix(db): survive DELETE fallback failure in WAL setup**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `d956e05e5e`, `#108082`

## Fix status

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