fix(state): refuse WAL on SQLite builds with the WAL-reset bug - #69981
Closed
HexLab98 wants to merge 2 commits into
Closed
fix(state): refuse WAL on SQLite builds with the WAL-reset bug#69981HexLab98 wants to merge 2 commits into
HexLab98 wants to merge 2 commits into
Conversation
On vulnerable SQLite (e.g. 3.50.4), do not enable WAL for fresh/non-WAL shared databases — prefer DELETE instead. Leave existing on-disk WAL alone (no live downgrade under concurrent gateway/cron openers). Surface Python/SQLite version details as a doctor warning (NousResearch#69784).
Assert the version matrix, fresh-DB DELETE fallback, already-WAL left alone (no checkpoint/DELETE), fixed-SQLite WAL path, and warn-only doctor output for vulnerable builds (NousResearch#69784).
HexLab98
force-pushed
the
fix/69784-sqlite-wal-reset-gate
branch
from
July 23, 2026 08:48
e177d89 to
1adb18b
Compare
kshitijk4poor
pushed a commit
to kshitijk4poor/hermes-agent
that referenced
this pull request
Jul 23, 2026
Hoist the duplicated check_info(source_id) call out of both if/else branches into a single call after the branch. Remove trailing whitespace on the blank line after the except block. Follow-up cleanup for PR NousResearch#69981.
kshitijk4poor
pushed a commit
that referenced
this pull request
Jul 23, 2026
Consolidate the two near-identical warning strings in _log_wal_reset_bug_once into a single logger.warning call with an action variable. Remove overengineered defensive tuple-length handling in is_sqlite_wal_reset_vulnerable (sqlite3.sqlite_version_info always returns a 3-tuple). Remove extra blank line. Follow-up cleanup for PR #69981.
kshitijk4poor
pushed a commit
that referenced
this pull request
Jul 23, 2026
Hoist the duplicated check_info(source_id) call out of both if/else branches into a single call after the branch. Remove trailing whitespace on the blank line after the except block. Follow-up cleanup for PR #69981.
Collaborator
|
Merged via #70055 — your commits were cherry-picked onto fresh main with authorship preserved (rebase-merge). The fix and test commits are yours; two small follow-up cleanups were added on top (consolidated duplicate warning strings, simplified tuple handling, deduped check_info call). Thanks for the thorough bug report and clean fix! |
Rmup67350
pushed a commit
to Rmup67350/hermes-agent
that referenced
this pull request
Jul 24, 2026
Consolidate the two near-identical warning strings in _log_wal_reset_bug_once into a single logger.warning call with an action variable. Remove overengineered defensive tuple-length handling in is_sqlite_wal_reset_vulnerable (sqlite3.sqlite_version_info always returns a 3-tuple). Remove extra blank line. Follow-up cleanup for PR NousResearch#69981.
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
Consolidate the two near-identical warning strings in _log_wal_reset_bug_once into a single logger.warning call with an action variable. Remove overengineered defensive tuple-length handling in is_sqlite_wal_reset_vulnerable (sqlite3.sqlite_version_info always returns a 3-tuple). Remove extra blank line. Follow-up cleanup for PR NousResearch#69981.
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
Hoist the duplicated check_info(source_id) call out of both if/else branches into a single call after the branch. Remove trailing whitespace on the blank line after the except block. Follow-up cleanup for PR NousResearch#69981.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
journal_mode=DELETEinstead.TRUNCATE/mode flip under concurrent gateway/cron/worker openers (same safety rule as the NFS WAL path).apply_wal_with_fallbackso they cannot re-enable WAL on a vulnerable build.hermes doctorreports Python + SQLite version/source id as a warn-only note (not a blocking issues entry); packaging a fixed SQLite runtime remains a separate install decision.Test plan
upstream/main: vulnerable SQLite still got WAL viaapply_wal_with_fallback.delete; already-WAL → stayswal(no checkpoint/DELETE pragmas); fixed SQLite →wal.scripts/run_tests.sh tests/test_sqlite_wal_reset_gate.py tests/test_hermes_state_wal_fallback.pyscripts/run_tests.sh tests/test_hermes_state.py -k 'TestApplyWalProbe or test_wal_mode'hermes doctoron 3.50.4 shows SQLite warn + source id without listing it under blocking issues.Infographic