fix(cli): pick the first node >= 22 across all PATH entries#189
Open
arelchan wants to merge 1 commit into
Open
fix(cli): pick the first node >= 22 across all PATH entries#189arelchan wants to merge 1 commit into
arelchan wants to merge 1 commit into
Conversation
find_node returned the first node it could run without checking the minimum version, and probed PATH via shutil.which which yields only the first hit. So a stale < 22 node earlier on PATH (an old /usr/local/bin node or a version-manager shim) shadowed a newer node later on PATH (e.g. homebrew node 26): the caller received the old version and errored with 'node too low' even though a usable node was installed. raven agent worked (no node needed) while raven tui failed, which made it look like a tui/streaming issue. enumerate every node on PATH (not just the first) and return the first candidate that meets the >= 22 minimum, in priority order; keep the highest below-minimum candidate so the caller still reports the real version instead of a bare not-found. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
arelchan
force-pushed
the
fix/find_node_min_version_all_path
branch
from
July 22, 2026 14:59
e1bf1b7 to
042dd9d
Compare
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.
Change description
Fixes
raven tuifailing with a "Node version too low (found 20.20.1, need >= 22)" error on machines that do have a recent Node installed (e.g. Homebrew node 26), whileraven agentworks fine.Two bugs in
find_node()(raven/cli/tui_commands.py):--versionmerely parsed, regardless of_MIN_NODE_VERSION. The caller then rejected it if< 22without ever asking for the next candidate -- so a too-old node in an earlier priority tier shadowed a valid newer one.shutil.which("node"), which returns only the first hit. A stale< 22node earlier on PATH (an old/usr/local/bin/node, an nvm/asdf shim, etc.) hid a newer node later on PATH.Together: a user with node 26 on PATH but a 20.x earlier on PATH got "node too low".
raven agentwas unaffected (no Node needed), which made it look like a TUI/streaming problem.Fix
nodeon PATH (not just the first)._MIN_NODE_VERSION, in priority order (RAVEN_NODE -> venv -> PATH -> private runtime).found 20.20.1, need >= 22) instead of a bare "not found".Tests
Added to
tests/test_cli_tui_bootstrap.py:test_find_node_skips_below_min_and_scans_all_path-- a 20.20.1 earlier on PATH + a 26.5.0 later =>find_nodereturns 26.5.0.test_find_node_reports_below_min_when_nothing_qualifies-- only a 20.20.1 => returns it (so the caller can show the version).Type of change
Checklists
Development
ruff check/ruff format)Code review
Note (unrelated, pre-existing)
test_find_node_discovers_windows_private_runtimefails on non-Windows hosts onmainalready (its mock setssys.platform="win32"butfind_node's Priority-4 branch keys offos.name == "nt"). It is not run by CI'smake test-pythonsubset, so CI stays green. Left untouched here to keep this PR scoped; flagging it for a separate fix.