Skip to content

fix(browser): name the missing libnode and probe a staged gateway-node - #23162

Merged
iamwhatever merged 1 commit into
mainfrom
fix/stage-node-split-libnode
Oct 24, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
fix/stage-node-split-libnode

Conversation

@JLargent42

Copy link
Copy Markdown
Contributor

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-node behind.

Homebrew's node loads @rpath/libnode.<N>.dylib from its Cellar, so the copy the installer stages as gateway-node cannot start. A fresh install stops at stage-node with "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. A gateway-node staged by 0.8.x, before that probe existed, is reused by install_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

  • Making the Homebrew split-libnode build itself work (copying libnode next to the staged binary, or not staging Node at all). That changes the sealed-leaf design.
  • Automatically re-staging a broken gateway-node from install_browser. It reports the failure; a reinstall re-stages.
  • Choosing a supported way to select the browser runtime, or a security-update policy for the staged Node.

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.

Where Before After
stage-node in install() (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, set KIROCREW_NODE_BIN_DIR to its bin directory, restart the gateway, install the browser CLI again
install_browser() downloads with the staged gateway-node, which crashes in dyld runs the staged gateway-node with --version first; a failure returns one check-node step with the same cause and remedy and the probe's own returncode, and no download starts

_staged_node_runs (in browser_cli/install_launcher.py) now picks the loader's "missing library" line (dyld or ld.so) over the last line. _unrunnable_node_remedy writes the remedy, and staged_node_failure runs the probe only when the command's Node is the managed gateway-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 because node_bin_dirs() is cached for the gateway's lifetime. Any other probe failure keeps the old wording.

Backwards compatibility

Compatible: a runnable gateway-node passes 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_browser gains 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_node refuses with the libnode line, KIROCREW_NODE_BIN_DIR and nodejs.org, and leaves no gateway-node.
  • test_install_browser_reports_a_staged_node_that_cannot_run_before_downloading: install_browser returns only check-node, and _download_browser is never called.
  • test_a_probe_that_did_not_finish_keeps_its_returncode_and_no_node_remedy (124 and 130): the check-node step carries the probe's returncode and no Node remedy.
  • test_install_browser_downloads_with_a_staged_node_that_runs: a runnable gateway-node still 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 (shuf over 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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@JLargent42
JLargent42 requested review from a team and KiroCrewCaptain as code owners October 22, 2026 18:23
@JLargent42 JLargent42 self-assigned this Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision aa173aca1c61b4a15bfe1eef5a9929597296590b touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of aa173aca1c61b4a15bfe1eef5a9929597296590b — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the new install_browser check reuses the probe stage-node already runs on macOS. If the dyld parsing is wrong, the only cost is a less specific message.

Notes

  • No Mac run backs this fix. A one-off check on a Homebrew-Node Mac, confirming the check-node text, would cover the claim that the dyld line matches the reported crash.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of aa173aca1c61b4a15bfe1eef5a9929597296590b — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. One wrapper has a single caller and could go.

Notes

  • Item 5 — one consumer, generalized: _staged_node_runs is now a wrapper ("_probe_staged_node without the exit code") with exactly 1 caller (_stage_managed_node, grep _staged_node_runs( in src). Subtraction: delete _staged_node_runs and have _stage_managed_node call _probe_staged_node and take [1].

What this change ships

Inventory (5 items) — 4 justified

Intent: 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).

  1. The stage-node error now shows the loader's "Library not loaded" line instead of dyld's last "tried:" line — justified
  2. The stage-node remedy now names a self-contained Node from nodejs.org, KIROCREW_NODE_BIN_DIR and a gateway restart — justified
  3. install_browser runs an already-staged gateway-node before downloading; if it fails, the install stops at a new check-node step — justified
  4. A probe that timed out or was interrupted keeps its own exit code and gets no Node remedy — justified
  5. _staged_node_runs was split into _probe_staged_node plus a thin wrapper — one consumer, generalized

[FIRST-PRINCIPLES-REVIEWED] aa173ac

Description read

[DESCRIPTION-READ] 06f519198a474d53d6bbecaae3f3db287c0a2aa66433bfd5d206f535bd5591fe

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed aa173aca1c61b4a15bfe1eef5a9929597296590b — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] aa173ac

Verdict parsed from the review's SHA-scoped output markers for commit aa173aca1c61b4a15bfe1eef5a9929597296590b.

False positive or not applicable? A repository writer can comment:
/ai-review override fable aa173aca1c61b4a15bfe1eef5a9929597296590b: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of aa173aca1c61b4a15bfe1eef5a9929597296590b and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] aa173ac

False positive or not applicable? A repository writer can comment:
/ai-review override gpt aa173aca1c61b4a15bfe1eef5a9929597296590b: <one-sentence reason>

@JLargent42
JLargent42 force-pushed the fix/stage-node-split-libnode branch from 52b8350 to e4500a7 Compare October 22, 2026 18:42
@JLargent42

Copy link
Copy Markdown
Contributor Author

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.

@JLargent42
JLargent42 force-pushed the fix/stage-node-split-libnode branch 2 times, most recently from 2e6d258 to 1952ea7 Compare October 22, 2026 23:05
@JLargent42

Copy link
Copy Markdown
Contributor Author

Rebased once to pick up #23201 (main-red #23200); no code change.

@JLargent42
JLargent42 force-pushed the fix/stage-node-split-libnode branch from 1952ea7 to aa173ac Compare October 23, 2026 06:25
@JLargent42

Copy link
Copy Markdown
Contributor Author

Rebased once onto main for the #23264 Windows fix.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 23, 2026

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@iamwhatever
iamwhatever merged commit 5a4e2ff into main Oct 24, 2026
104 checks passed
@iamwhatever
iamwhatever deleted the fix/stage-node-split-libnode branch October 24, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

browser: Playwright CLI install fails with Homebrew Node's split libnode, and install-browser reuses a broken staged gateway-node

3 participants