Skip to content

v16-runner not found when installed via pnpm (resolver paths missing project-root level) #24

@gaspardip

Description

@gaspardip

Summary

@testmuai/kane-cli@0.2.11 fails to locate the platform-specific v16-runner binary (@testmuai/kane-cli-darwin-arm64, etc.) when installed via pnpm, because the resolver in dist/index.js only searches up to 3 levels above the dist/ directory and the project-root node_modules/ is 4 levels up.

Run output (with KANE_DEV_MODE=1):

[exit-manager] shutdown(2): CLI error: v16-runner not found. Build the binary with `cd v16-runner && python build.py` or ensure Python is available.

Without KANE_DEV_MODE, the CLI exits silently with status 2 and produces no stdout/stderr after SCREENSHOT_SAS_OK in the session log — making this very hard to diagnose.

Repro

pnpm add -D @testmuai/kane-cli
pnpm exec kane-cli login --oauth          # works
pnpm exec kane-cli run "Open https://example.com" --agent --headless --max-steps 3 --timeout 60 </dev/null
# exit 2, empty output

Environment: macOS 25.2 arm64, Node 25.9.0, pnpm 10.32.0, kane-cli 0.2.11.

Root cause

In dist/index.js, function po() resolves v16-runner as:

let c = [
  Ve(vt, "..",                "node_modules", l, "bin", e),
  Ve(vt, "..", "..",          "node_modules", l, "bin", e),
  Ve(vt, "..", "..", "..",    "node_modules", l, "bin", e),
];

Where vt = path.dirname(import.meta.url) = node_modules/@testmuai/kane-cli/dist/ and l = "@testmuai/kane-cli-darwin-arm64".

Expanded:

  • node_modules/@testmuai/kane-cli/node_modules/@testmuai/kane-cli-darwin-arm64/bin/v16-runner
  • node_modules/@testmuai/node_modules/@testmuai/kane-cli-darwin-arm64/bin/v16-runner
  • node_modules/node_modules/@testmuai/kane-cli-darwin-arm64/bin/v16-runner

None of these match the actual pnpm layout, where the optional dep ends up at:

node_modules/@testmuai/kane-cli-darwin-arm64/bin/v16-runner

That path is reachable from vt via four .. (not three): vt/../../../../node_modules/@testmuai/kane-cli-darwin-arm64/bin/v16-runner.

Workaround

Symlink the runner into one of the locations the resolver checks:

mkdir -p node_modules/@testmuai/kane-cli/node_modules/@testmuai
ln -sf ../../../kane-cli-darwin-arm64 \
  node_modules/@testmuai/kane-cli/node_modules/@testmuai/kane-cli-darwin-arm64

After this, the run completes normally (run_end status:"passed").

Suggested fix

Add a fourth candidate at one more level up, or resolve the package via require.resolve(\${l}/package.json`, { paths: [vt] })` and dirname from there — that handles npm, pnpm, yarn-pnp/classic uniformly.

Also

When v16-runner is missing, surfacing the error only behind KANE_DEV_MODE makes diagnosis painful — please log it to stderr unconditionally (or at least print a hint with exit code 2).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions