Repository navigation
fix(browser): name the missing libnode and probe a staged gateway-node - #23162
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the new Notes
[DESIGN-REVIEWED] aa173ac Description read[DESCRIPTION-READ] d5d05d9b43115a1260a9815d93e4c597c58cdf7d09d8163d401b69c79b7a8cc6 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. One wrapper has a single caller and could go. Notes
What this change shipsInventory (5 items) — 4 justifiedIntent: a Mac user whose only Node is Homebrew's gets a browser-install error that names the missing libnode and how to fix it. This is a FIX (#23129).
[FIRST-PRINCIPLES-REVIEWED] aa173ac Description read[DESCRIPTION-READ] 06f519198a474d53d6bbecaae3f3db287c0a2aa66433bfd5d206f535bd5591fe That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
52b8350 to
e4500a7
Compare
|
Rebased: main moved in src/kiro_crew/context_assembly/agent_spec.py (imported by this PR's code) since this head went green (2e648a7 -> 66b3698); CI re-running. The old head's Backend Tests shard 7 red was the known flake #22163 (TestDanglingDefaultAgentReset, unraisable warnings leaked from an earlier test). It is recorded there and is not from this diff. |
2e6d258 to
1952ea7
Compare
…ed gateway-node before install-browser
1952ea7 to
aa173ac
Compare
|
Rebased once onto main for the #23264 Windows fix. |
iamwhatever
left a comment
There was a problem hiding this comment.
Approve at aa173ac.
The fix addresses both paths in #23129. _probe_staged_node reports the loader's missing-library line, and staged_node_failure stops install_browser at a check-node step before the download when the staged gateway-node cannot start. Timeouts and interruptions keep their own return codes and get no Node remedy. The probe only runs for the managed gateway-node, and its output goes through redact_install_output.
All AI lanes pass on this head, and their notes are advisory: the missing Mac run is disclosed in the description, and the single-caller wrapper is style only. The CodeQL thread was answered and resolved. CI is green, with no pending checks and no change requests.
— crew-pr-reviewer (r123)
Problem / Motivation
Goal: A Mac whose only Node is Homebrew's gets a browser-install error that names the cause and the fix, both on a fresh install and when an older install left a broken
gateway-nodebehind.Homebrew's
nodeloads@rpath/libnode.<N>.dylibfrom its Cellar, so the copy the installer stages asgateway-nodecannot start. A fresh install stops atstage-nodewith "Install Node as a self-contained binary", and the probe reports dyld's last line (a "tried:" path), not the library it could not load. Agateway-nodestaged by 0.8.x, before that probe existed, is reused byinstall_browser()without being run, so the engine download dies in a dyld crash (Library not loaded: @rpath/libnode.147.dylib).Why it matters
Every Mac user whose Node comes from current Homebrew cannot install the browser tool, and the errors they see do not say what to do. Two users reported it; one fixed it by hand-staging a nodejs.org build.
Not a goal
gateway-nodefrominstall_browser. It reports the failure; a reinstall re-stages.What changed (motivation → approach → change)
The staged Node fails because it loads a shared library that is not in the managed leaf. The fix reports that cause, and the fix for it, at both places the copy is run.
stage-nodeininstall()(exit 134: Reason: tried: ...), then "Install Node as a self-contained binary."(exit 134: dyld[..]: Library not loaded: @rpath/libnode.147.dylib), then: install a self-contained Node 20+ such as the nodejs.org build, setKIROCREW_NODE_BIN_DIRto its bin directory, restart the gateway, install the browser CLI againinstall_browser()gateway-node, which crashes in dyldgateway-nodewith--versionfirst; a failure returns onecheck-nodestep with the same cause and remedy and the probe's own returncode, and no download starts_staged_node_runs(inbrowser_cli/install_launcher.py) now picks the loader's "missing library" line (dyld or ld.so) over the last line._unrunnable_node_remedywrites the remedy, andstaged_node_failureruns the probe only when the command's Node is the managedgateway-node. A fixed system Node is not probed, because reinstalling would not change it. A probe that timed out (124) or was interrupted (130) keeps that returncode, so the install job reports a timeout or an interruption rather than a broken Node. The restart is in the remedy becausenode_bin_dirs()is cached for the gateway's lifetime. Any other probe failure keeps the old wording.Backwards compatibility
Compatible: a runnable
gateway-nodepasses the new probe and the download runs as before; only an install that would have crashed now stops one step earlier with a named cause.Removes nothing: no step, key, function or accepted input is removed;
install_browsergains one failure step (check-node) before its existing download.Tests
In
test/test_browser_cli_install_gateway_command.py(TestPosixGatewayCommand), each probe is a real process: a shell script the test owns, printing dyld's split-libnode output.test_install_names_a_missing_shared_library_and_how_to_get_a_node_that_runs:_stage_managed_noderefuses with the libnode line,KIROCREW_NODE_BIN_DIRand nodejs.org, and leaves nogateway-node.test_install_browser_reports_a_staged_node_that_cannot_run_before_downloading:install_browserreturns onlycheck-node, and_download_browseris never called.test_a_probe_that_did_not_finish_keeps_its_returncode_and_no_node_remedy(124 and 130): thecheck-nodestep carries the probe's returncode and no Node remedy.test_install_browser_downloads_with_a_staged_node_that_runs: a runnablegateway-nodestill reaches the download with[gateway-node, playwright-cli.js].The first three fail on the parent commit (wrong detail line; the download is reached). Determinism: the Posix class (11 node ids) ran green 5 times in shuffled order (
shufover node ids,-n0).Manual verification
Not reproduced on a Mac with Homebrew Node: no macOS host was available. The dyld output in the tests matches the reported crash (
Library not loaded: @rpath/libnode.147.dylib, Homebrew node 26.11.1). Local gates run green on Linux: related backend tests, black, isort, flake8, mypy, semgrep, flake-pattern ratchet, and the repository check scripts.Related Issues
Closes #23129
Pattern harvest
Not generalizable: the defect is two specific call sites (a probe that kept the wrong output line, and one install path that skipped the probe), not a repeated code shape.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)