Skip to content

hermes doctor stops sending users with a live gateway into --fix on a large WAL (#110054 item 3) - #113055

Merged
kshitijk4poor merged 3 commits into
NousResearch:mainfrom
kshitijk4poor:fix/doctor-large-wal-warning-live-writer
Sep 16, 2026
Merged

kshitijk4poor merged 3 commits into
NousResearch:mainfrom
kshitijk4poor:fix/doctor-large-wal-warning-live-writer

Conversation

@kshitijk4poor

Copy link
Copy Markdown

hermes doctor no longer tells a user with a live Desktop/gateway to run hermes doctor --fix on a large WAL — the nudge that made them the second writer the deleted-WAL guard then fires on.

Ours (2026-09-16); item 3 of the maintainer's proposed fix on #110054, which stays open for the rest.

Why. Without --fix, a >50 MB WAL printed Large WAL file — run 'hermes doctor --fix' to checkpoint with no holder check (the holder scan only ran inside --fix). A large WAL is normal for a running Desktop/gateway; the Discord threads in #110054 show users following that line into --fix while the gateway was live.

  • hermes_cli/doctor_state.py::_state_db_wal — the holder check (hermes_state_repair._live_writer_holds_db, the same wrapper _write_health_reason uses) now runs on the warn path too. Held or unprovable → "normal while Desktop or the gateway is running, or state.db cannot be inspected — checkpoint only with them stopped" plus the existing stop-first issue line; no holder → the checkpoint suggestion, ordered "stop the profile's gateway, then run --fix". --fix semantics unchanged.
  • 2 tests (both red on origin/main): held → no bare --fix, stop ordered before fix; not held → stop still ordered before fix. The 51 MB WAL setup is one helper shared with the existing exclusive-guard test.
Check Result
New tests on origin/main 2 failed
This branch 78 green across test_doctor_wal_checkpoint_guard.py, test_doctor_wal_holder_guard.py, test_doctor.py; test_observational_sessiondb_modes.py (same seam) green
Mutation production file reverted → both red; restored → green
Live probe (real import, 51 MB WAL, no --fix) held: warns "normal while Desktop or the gateway is running…", issue orders stop first; not held: "may indicate missed checkpoints", issue orders stop before --fix
Second-writer safety the BEGIN IMMEDIATE probe inside the holder check runs only when the scan found no foreign holder

Refs #110054, #110073.

…ever as "run --fix"

`hermes doctor` (without --fix) warned "WAL file is large — run 'hermes doctor
--fix' to checkpoint" without checking whether Desktop or the gateway held
the database; the holder scan only ran inside --fix. A large WAL is normal for
a live writer, and that nudge is how users in the NousResearch#110054 threads became the
second writer that the deleted-WAL guard then fired on.

The holder scan now runs on the warn path too: held (or unprovable) reports
the size as normal while Desktop/gateway run and orders "stop" before any
--fix; no holder keeps the checkpoint suggestion, also stop-first.

Refs NousResearch#110054 (item 3 of the proposed fix), NousResearch#110073.
…honest disjunction in the warning

_live_writer_holds_db in hermes_state_repair already binds the repair connector
(the sibling _write_health_reason uses it); the held-branch detail now says
'or state.db cannot be inspected' so the console line matches the comment above
it. Test setup for a 51 MB WAL is one helper shared by all three tests.
@kshitijk4poor
kshitijk4poor enabled auto-merge (rebase) September 16, 2026 17:22
@kshitijk4poor
kshitijk4poor merged commit acc7845 into NousResearch:main Sep 16, 2026
34 checks passed
kshitijk4poor added a commit that referenced this pull request Sep 16, 2026
MintFailure.as_payload() reported ceil(not_before - monotonic()). With
not_before = now + 60, the subtraction is 60.000000000000455 for some values
of now, and the ceil made it 61: users saw "retry in 61s" and CI failed
test_the_background_loop_retries_a_transient_failure_until_it_settles
(slept == [15, 61]) whenever the runner uptime landed on such a value —
twice in a row on #113055. remaining() now rounds to the millisecond before
the ceil. One test pins a concrete `now` that produced the dust.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant