WAL unlink race and state.db corruption fixes

NousResearch/hermes-agent · cluster 101064

Data as of

Nothing open on GitHub. Fix merged in #101221. Check it covers your case.

The short answer

0open issues
0open PRs
5items grouped
Known?
Yes. 5 related items grouped here, 1 issue already closed.
Fix event
A fix was merged to main in PR #101221. Check it covers your case. No release data is tracked.
Tracker
The maintainers' tracker marks this resolved, deciding PR #101221. That is separate from the fix event.
Still open
Nothing open on GitHub.

A bug report and several fix attempts address a race condition where a deleted WAL file coexists with a fresh zero-byte WAL, causing state.db corruption. The fixes focus on refusing writes on deleted WAL generations and restoring journal mode safely within repair guards.

Open issues0

No open issues.

Open PRs0

No open pull requests.

Fixes on record

Merged to main. A stamp counts the issues a fix is linked to.

  • #101221 fix(state): refuse SessionDB open and writes on a deleted WAL generation (salvage #101081)

    merged to main

    files: hermes_state.py, tests/hermes_state/test_deleted_wal_generation_guard.py

  • #101736 fix(state): restore journal mode inside the repair guard, never reopen after release (salvage #101085)

    merged to main

    files: hermes_state.py, tests/state/test_state_db_wal_unlink_race.py

2 PRs closed without merging

From the close comments: merged via another change 2

  • #101081 fix(state): refuse SessionDB open and writes on a deleted WAL generation · merged via another change → 7f7df1c, e9fa7bc, #101221, #101064, #94736
  • #101085 fix(state): avoid WAL unlink race during state.db repair · merged via another change → #101736, #98552, #100533
Closed issues · 1
  • Closed#101064[Bug] state.db WAL unlink race: writer holds deleted 4.3MB state.db-wal while a fresh 0-byte WAL appears on disk — corruption recurred after WAL-mode rebuild, stopped only by database.journal_mode: delete
How this cluster was grouped
  • Link evidence (structural links throughout): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
  • Pairwise link density 0.40: the share of item 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.

Pick up a Lab task

Check whether a fix covers the open issues here, with your own agent. Bring back evidence for maintainers.

Open the Lab

At a glance

Merged PRs
#101221, #101736
Closed issues
1
Attempts
2 PRs closed without merging
Fix link checked
3 Sep 2026

For your agent

The same facts, typed.