fix(update): re-provision outdated managed Node on engine failure - #76558
Closed
teknium1 wants to merge 1 commit into
Closed
fix(update): re-provision outdated managed Node on engine failure#76558teknium1 wants to merge 1 commit into
teknium1 wants to merge 1 commit into
Conversation
The Node-26 floor bump (713a983) re-broke every install that had already self-healed onto a managed Node 22 tree — and every install the installers put on Node 22 historically: - The managed tree is HEALTHY (node/npm run fine), so heal never fires (it only repairs broken trees). - bootstrap_hermes_managed_node() reused any healthy tree, so the EBADENGINE recovery handed back the same Node 22 npm and the retry failed identically — an unbreakable loop. GUI installer/updater and hermes update all dead-end. - On the managed-npm path, a node-constraint failure was declared unfixable outright. Fix: teach the recovery that a managed tree can be outdated, not just broken. - hermes_constants: _probe_node_major() + managed_node_meets_target(); bootstrap_hermes_managed_node(force=...) now reuses a healthy tree only when its Node major >= _HERMES_NODE_TARGET_MAJOR, otherwise re-provisions in place at the current target. - npm_engine: when the failing npm IS the managed one and the managed Node is below target, force a re-provision (then the usual npm-range upgrade) instead of declaring the failure unfixable or looping on an npm-only upgrade. E2E (real downloads, temp HERMES_HOME): provisioned a v22.23.2 tree, replayed the GUI updater's node>=26 EBADENGINE against its npm -> tree re-provisioned to v26.5.1 + npm 12.0.2 in 3.2s, retry viable; current-major tree reused in 0.06s (no gratuitous re-downloads).
Contributor
૮ >ﻌ< ა ci reviewran on bc1d911 ℹ️ InfoDesktop E2E visual evidence · View test artifacts · View job3 visual diffs. inline evidence upload failed. Failed to upload diff-1508682a2ae8-boot-ready-diff.png with gh image (exit code 1): Error uploading /home/runner/work/_temp/e2e-evidence/diff-1508682a2ae8-boot-ready-diff.png: step 0 (get upload token): uploadToken not found on repo page — do you have write access to NousResearch/hermes-agent? (or, if NousResearch enforces SAML SSO, authorize at https://github.com/orgs/NousResearch/sso) |
Contributor
Author
|
Closing: #76562 returned the managed-Node target to 22, so no healthy managed tree is below target anymore and this re-provision path is dormant. If a Node-floor bump is re-attempted later, this can be revived — the outdated-tree gap it covers (heal only fires on broken trees) will exist again then. |
1 task
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
The EBADENGINE recovery now re-provisions a healthy-but-outdated managed Node tree, closing the loop the Node-26 floor bump opened: every install sitting on a managed Node 22 tree (all historical installs, plus everything #76464 healed onto 22 before the bump) was stuck in an unfixable retry loop that dead-ends the GUI installer/updater and
hermes update.Root cause: three deliberate behaviors composed into a trap after 713a983 raised
engines.nodeto>=26:heal_hermes_managed_node()only fires on broken trees — a runnable Node 22 tree is healthy, so heal never triggers.bootstrap_hermes_managed_node()reused any healthy tree, so the recovery handed back the same Node 22 npm and the retry failed identically.Changes
hermes_constants.py:_probe_node_major()+managed_node_meets_target();bootstrap_hermes_managed_node(force=...)reuses a healthy tree only when its Node major ≥_HERMES_NODE_TARGET_MAJOR, otherwise re-provisions in place at the current target.hermes_cli/npm_engine.py: when the failing npm IS the managed one and the managed Node is below target, force a re-provision (followed by the usual npm-range upgrade) instead of looping on an npm-only upgrade or giving up.tests/hermes_cli/test_npm_engine.py: new coverage for the outdated-tree re-provision (assertsforce=Trueso the healthy-tree shortcut can't sneak back) and the still-correct "current Node, node-only mismatch → decline" path.Validation
E2E with real downloads in a temp
HERMES_HOME: provisioned a v22.23.2 tree, replayed the GUI updater'snode>=26EBADENGINE against its npm → re-provisioned to v26.5.1 + npm 12.0.2 in 3.2s. Targeted tests: 92/92 acrosstest_npm_engine.py,test_hermes_constants.py,test_cmd_update.py; ruff clean.Infographic