feat: ARM tarball builds + arch-aware download#2248
Merged
louisgv merged 2 commits intoOpenRouterTeam:mainfrom Mar 6, 2026
Merged
feat: ARM tarball builds + arch-aware download#2248louisgv merged 2 commits intoOpenRouterTeam:mainfrom
louisgv merged 2 commits intoOpenRouterTeam:mainfrom
Conversation
- Add ARM64 matrix entries for native binary agents (zeroclaw, opencode, hermes, claude) in agent-tarballs.yml workflow - Update agent-tarball.ts to detect remote VM arch via uname -m and download the correct tarball (x86_64 or arm64) - Change release strategy to support multiple arch assets per tag - Document ARM build requirements in discovery.md for future agents - Bump CLI version to 0.15.2 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On AWS Lightsail, SSH connects as 'ubuntu' (not root), but tarballs extract to /root/. Without sudo, tar fails with "Permission denied". Conditionally use sudo when not running as root (id -u != 0). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
louisgv
approved these changes
Mar 6, 2026
Member
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: adc2658
Findings
[LOW] .github/workflows/agent-tarballs.yml:166-169 — Unquoted pipe to grep/while loop
- The
greppatternspawn-agent-${AGENT_NAME}-${ARCH}-is not anchored and could match unexpected filenames - The
while readloop processes untrusted release asset names from GitHub API - Mitigation: Asset names are already filtered by
gh release view --json assets --jq ".assets[].name", limiting exposure. The delete-asset command uses the exact name string without shell expansion. - Impact: Negligible — GitHub asset names are constrained by GitHub's API validation
[PASS] packages/cli/src/shared/agent-tarball.ts:74-77 — URL validation
- Strong regex validation prevents shell injection
- Both x86 and ARM URLs validated independently
- Blocks dangerous shell metacharacters
[PASS] packages/cli/src/shared/agent-tarball.ts:85-95 — Conditional sudo and arch detection
- Safe variable expansion and arch detection
- URLs properly single-quoted in conditional branches
- Double-quoted expansion only for validated variables
[PASS] .github/workflows/agent-tarballs.yml:42 — Dynamic runner selection
- Safe GitHub Actions matrix conditional
Tests
- bash -n: N/A (workflow YAML, TypeScript)
- bun test: PASS (679 pass, pre-existing failures unrelated)
- Lint: PASS (0 errors)
- curl|bash safety: OK — URL validation prevents injection
- macOS compat: N/A (TypeScript only)
Architecture Review
The PR safely implements ARM support for agent tarballs:
- Build matrix extension — Adds arm64 builds for native-binary agents while keeping npm-based agents x86_64-only
- Arch-aware download — Remote VM detects
uname -mand selects appropriate tarball URL - Rolling release strategy — Multiple arch builds upload to same release tag with per-arch cleanup
- Backward compatibility — Falls back to x86_64 if only one arch available
No critical or high-severity issues found. Code follows project security standards.
-- security/pr-reviewer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agent-tarball.tsto detect remote VM arch viauname -mand download the correct tarballdiscovery.mdfor future agentsTest plan
ubuntu-latest(x86_64) andubuntu-24.04-arm(arm64)agent-tarball.tsselects correct URL based on remote VMuname -mbunx @biomejs/biome check src/passesbun testpasses (1415 tests)🤖 Generated with Claude Code