Skip to content

fix: add postinstall chmod for npm binary permissions#43

Merged
NathanFlurry merged 3 commits intomainfrom
fix/npm-release-binary
Feb 2, 2026
Merged

fix: add postinstall chmod for npm binary permissions#43
NathanFlurry merged 3 commits intomainfrom
fix/npm-release-binary

Conversation

@NathanFlurry
Copy link
Member

Adds a postinstall script to make the binary executable after npm install.

This fixes the issue where the binary wasn't executable on Linux/macOS after installation.

Tested with:

docker run --rm node:22-slim sh -c "mkdir /test && cd /test && npm init -y && npm install @sandbox-agent/cli@0.1.4-rc.4 && ./node_modules/.bin/sandbox-agent --version"

Output: sandbox-agent 0.1.0

@railway-app railway-app bot temporarily deployed to sandbox-agent / sandbox-agent-pr-43 January 30, 2026 21:40 Destroyed
@railway-app
Copy link

railway-app bot commented Jan 30, 2026

🚅 Deployed to the sandbox-agent-pr-43 environment in sandbox-agent

Service Status Web Updated (UTC)
website 😴 Sleeping (View Logs) Web Jan 30, 2026 at 11:41 pm
inspector 😴 Sleeping (View Logs) Web Jan 30, 2026 at 11:40 pm

The --version flag now reports the version from package.json instead of the
version compiled into the Rust binary. This ensures the version matches what
was installed via npm, even when binaries are reused from previous releases.
@railway-app railway-app bot temporarily deployed to sandbox-agent / sandbox-agent-pr-43 January 30, 2026 22:58 Destroyed
@railway-app railway-app bot temporarily deployed to sandbox-agent / sandbox-agent-pr-43 January 30, 2026 22:59 Destroyed
@claude
Copy link

claude bot commented Jan 30, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

1 similar comment
@claude
Copy link

claude bot commented Jan 30, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@NathanFlurry NathanFlurry force-pushed the fix/npm-release-binary branch from 054dfc2 to 93445b3 Compare January 30, 2026 23:11
Instead of hacking around the version in the Node.js wrapper script,
properly pass the version at build time via SANDBOX_AGENT_VERSION env var.

Changes:
- build.rs: Generate version.rs with VERSION constant from env var
- main.rs: Use generated version constant for clap --version
- Dockerfiles: Accept SANDBOX_AGENT_VERSION as build arg
- build.sh: Pass version as second argument to Docker builds
- release.yaml: Pass version to build script during CI
- Remove version hack from sdks/cli/bin/sandbox-agent wrapper

The version is now baked into the binary during the release build,
ensuring --version reports the correct npm package version.
@railway-app railway-app bot temporarily deployed to sandbox-agent / sandbox-agent-pr-43 January 30, 2026 23:33 Destroyed
@NathanFlurry NathanFlurry merged commit 553f249 into main Feb 2, 2026
4 of 5 checks passed
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.

1 participant