You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hermes update now probes the Python interpreter that Hermes will use after the update before printing a success banner. If that interpreter still links a SQLite build with the WAL-reset corruption bug, the update is reported as partial, gateway status and update receipts stay partial, and the user gets an explicit uv-managed Python recovery path instead of a false success.
Symptom
A user can run hermes update in a Git install whose active venv links vulnerable SQLite, receive a successful completion message, restart Hermes, and still see the same WAL-reset warning and SQLite version.
Impact
Operators can believe the runtime remediation succeeded while Hermes continues using the vulnerable SQLite build. The affected report experienced malformed FTS indexes and later write failures before rebuilding the venv on a uv-managed Python.
Bug Cause
Trigger:hermes_cli/update_cmd.py / _cmd_update_impl current-checkout completion and _print_update_summary
Causal chain:
A Git install runs under a venv outside the checkout and links a vulnerable SQLite build.
The managed-runtime repair targets checkout-local venv or .venv, while both the current-checkout path and the normal update summary print success without probing the interpreter that the next Hermes launch will use.
The command reports success even though the linked SQLite version is unchanged and the WAL-reset warning persists after restart.
Why it is wrong: Update completion was based on code, dependency, and Desktop outcomes, but it did not verify the specific runtime property that the remediation warning promised to repair.
Working sibling / contrast: Checkout-local managed venvs already have a transactional uv runtime replacement path that provisions and smoke-tests a SQLite-safe Python before cutover. The missing piece was outcome verification and truthful reporting when that path is not applicable or does not complete.
Ruled out: This is not caused by SQLite version parsing or the vulnerability predicate. Existing runtime tests correctly classify 3.46.1 as vulnerable and fixed/backported releases as safe; the missing check was at update completion.
Fix
Resolve the post-update interpreter from the checkout venv when present, otherwise use the running venv interpreter, and probe its linked SQLite in an isolated subprocess.
Gate both normal and already-current success banners on that probe.
Mark gateway update status and update receipts partial when runtime verification fails or still reports vulnerable SQLite.
Print an actionable recovery path that names a uv-managed Python and hermes doctor verification.
Runtime probe:hermes_cli/update_cmd.py:13-51 adds _post_update_sqlite_runtime_status() probing the post-update venv python (project_venv_dir → venv_python_path else sys.executable) via probe_sqlite_runtime, and _print_verified_update_completion() which withholds the ✓ banner and prints a ⚠ Update partially complete with version-specific WAL-reset guidance when vulnerable.
Summary integration:_print_update_summary:64-98 now includes sqlite_runtime_ok alongside node_failures/desktop_build_ok, aggregates parts, returns bool (desktop_build_ok and sqlite_runtime_ok). Call sites (_update_via_zip:107, _cmd_update_impl:201,764) propagate update_complete to gateway exit code and finalize_update_receipt("partial" | "success").
Current-checkout path:hermes_cli/update_cmd.py:153-193 tracks current_checkout_complete, uses verified completion for both venv-repair and node-repair branches, and sys.exit(1) with False exit code + partial receipt when verification fails. Tests tests/hermes_cli/test_update_sqlite_remediation.py and test_cmd_update.py:259-357 pin runtime probe, summary withholding, and durable failure for both python and node repair paths.
Non-blocking: probing runs twice (once in helper, once in summary) — cheap but could be memoized within the turn if perf matters.
Salvaged onto current origin/main (your branch was ~1000 commits behind and conflicted with the #97052 fork-completion and #91360 config-migration changes on the current-checkout path) as PR #99715 — all 3 of your commits cherry-picked with your authorship preserved, plus a contributors/emails/ mapping for attribution CI.
Evidence: tests/hermes_cli/test_update_sqlite_remediation.py + test_update_desktop_stale_warning.py → 12 passed; test_sqlite_runtime.py + test_update_receipt.py → 47 passed; the 6 test_cmd_update.py failures on the branch reproduce identically on a clean origin/main worktree (pre-existing, A/B verified).
This PR will be closed with credit once #99715 merges. Thanks — this was the closest and cleanest attempt at the #90906 "false success while SQLite stays 3.50.x" verification gap.
Merged via PR #99715 — all 3 of your commits were cherry-picked onto current origin/main with your authorship preserved in git log, plus a contributors/emails/ attribution mapping.
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
area/install-updateInstaller, updater, packaging, wheels, doctorcomp/cliCLI entry point, hermes_cli/, setup wizardP2Medium — degraded but workaround existssweeper:risk-compatibilitySweeper risk: may break existing users, config, migrations, defaults, or upgradestype/bugSomething isn't working
4 participants
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.
What does this PR do?
hermes updatenow probes the Python interpreter that Hermes will use after the update before printing a success banner. If that interpreter still links a SQLite build with the WAL-reset corruption bug, the update is reported as partial, gateway status and update receipts stay partial, and the user gets an explicit uv-managed Python recovery path instead of a false success.Symptom
A user can run
hermes updatein a Git install whose active venv links vulnerable SQLite, receive a successful completion message, restart Hermes, and still see the same WAL-reset warning and SQLite version.Impact
Operators can believe the runtime remediation succeeded while Hermes continues using the vulnerable SQLite build. The affected report experienced malformed FTS indexes and later write failures before rebuilding the venv on a uv-managed Python.
Bug Cause
Trigger:
hermes_cli/update_cmd.py/_cmd_update_implcurrent-checkout completion and_print_update_summaryCausal chain:
venvor.venv, while both the current-checkout path and the normal update summary print success without probing the interpreter that the next Hermes launch will use.Why it is wrong: Update completion was based on code, dependency, and Desktop outcomes, but it did not verify the specific runtime property that the remediation warning promised to repair.
Working sibling / contrast: Checkout-local managed venvs already have a transactional uv runtime replacement path that provisions and smoke-tests a SQLite-safe Python before cutover. The missing piece was outcome verification and truthful reporting when that path is not applicable or does not complete.
Ruled out: This is not caused by SQLite version parsing or the vulnerability predicate. Existing runtime tests correctly classify 3.46.1 as vulnerable and fixed/backported releases as safe; the missing check was at update completion.
Fix
hermes doctorverification.Related Issue
Fixes #95772
Type of Change
Changes Made
hermes_cli/update_cmd.py- verify post-update SQLite runtime health before reporting success and propagate partial status to gateway/receipt outcomes.tests/hermes_cli/test_update_sqlite_remediation.py- cover external venv selection, vulnerable-runtime reporting, and current-checkout completion.tests/hermes_cli/test_update_desktop_stale_warning.py- keep Desktop summary tests explicit about unrelated SQLite health.tests/hermes_cli/test_cmd_update.py- isolate existing update-flow tests from host SQLite variability.How to Test
scripts/run_tests.sh tests/hermes_cli/test_update_sqlite_remediation.py tests/hermes_cli/test_update_desktop_stale_warning.py tests/hermes_cli/test_sqlite_runtime.py tests/hermes_cli/test_update_receipt.py -q scripts/run_tests.sh tests/hermes_cli/test_cmd_update.py -k 'update_on_fork_checks_upstream_when_origin_up_to_date' -qChecklist
Code
fix(scope):,feat(scope):, etc.)Documentation & Housekeeping
cli-config.yaml.exampleupdate: N/A - no config keys changedCONTRIBUTING.mdorAGENTS.mdupdate: N/A - no workflow changed