Skip to content

fix: resolve platform sub-package bin/ in runtime seeder (PILOT-209)#4

Merged
TeoSlayer merged 1 commit into
mainfrom
openclaw/pilot-209-20260528-110051
May 28, 2026
Merged

fix: resolve platform sub-package bin/ in runtime seeder (PILOT-209)#4
TeoSlayer merged 1 commit into
mainfrom
openclaw/pilot-209-20260528-110051

Conversation

@matthew-pilot
Copy link
Copy Markdown
Collaborator

What

pkgBinDir() in src/runtime.ts previously only looked in the main package's bin/<platform>/ directory for native Go binaries. Because bin/ is .gitignore'd and excluded from the files array, published packages never contain it.

The optional platform sub-packages (e.g. pilotprotocol-darwin-arm64@0.1.1) are designed to ship these binaries in their own bin/ directories, but the runtime never checked there — causing the "Binary not found — may be for a different platform" error on all platforms.

Change

Add a sub-package fallback in pkgBinDir(): when the main package bin/<platform>/ is absent, resolve node_modules/pilotprotocol-<platform>/bin/ from the optional dependency installed by npm.

The fallback only resolves when pilotctl (the first binary in BIN_NAMES) actually exists at that path — so a missing or empty sub-package still falls through to the existing error message.

Testing

  • npm run build (TypeScript): ✅ clean
  • npx vitest run (173 tests): ✅ all pass
  • Runtime: 1 file, +10 −1 lines

Related

  • PILOT-209: Jira ticket tracking the npm sub-package binary gap
  • PILOT-203: Durable fix (per-platform publish CI) — this PR is the runtime-side counterpart that makes published binaries actually discoverable
  • PILOT-208: Sibling issue (PyPI wheel wrong-arch binary)

🤖 auto-generated by matthew-pilot

pkgBinDir() previously only looked in the main package's bin/<platform>/
directory for native binaries. Because bin/ is .gitignored and excluded
from the files array, published packages never contain it. The optional
platform sub-packages (e.g. pilotprotocol-darwin-arm64) ship binaries in
their own bin/ directories, but the runtime never checked there.

Add a fallback: when the main package bin/<platform>/ is absent, resolve
node_modules/pilotprotocol-<platform>/bin/ from the optional dependency.

Also tightened the existence check: the sub-package fallback only
resolves when pilotctl (BIN_NAMES[0]) actually exists there.
@matthew-pilot
Copy link
Copy Markdown
Collaborator Author

🦾 Matthew PR Check — #4 PILOT-209

Status

  • State: OPEN · MERGEABLE ✅
  • CI: 2/2 green (test ✅, security/snyk ✅)
  • Reviews: 0 reviews (awaiting operator)
  • Jira: PILOT-209

Summary

sdk-node runtime seeder (pkgBinDir()) only searched the main package bin/<platform>/ for native Go binaries. Because bin/ is .gitignore-d and excluded from npm publish, shipped packages are missing the binaries. Optional platform sub-packages (pilotprotocol-<platform>) are designed to carry them, but the runtime never checked there — causing "Binary not found" on all platforms.

This PR adds a sub-package fallback: when the main-package bin/<platform>/ is absent, resolve node_modules/pilotprotocol-<platform>/bin/ from the optional dependency. Fallback only activates when pilotctl actually exists at that path, so a missing sub-package still falls through to the existing error message.

What's next

  • Operator review — please sanity-check the sub-package resolution path
  • Merge when ready — CI is green, branch is mergeable, no conflicts

🤖 auto-generated by matthew-pilot

@TeoSlayer TeoSlayer merged commit fffdf1e into main May 28, 2026
2 checks passed
@TeoSlayer TeoSlayer deleted the openclaw/pilot-209-20260528-110051 branch May 28, 2026 16:52
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.

2 participants