fix: spawn CLI install fails on Sprite (broken bun shim)#2993
fix: spawn CLI install fails on Sprite (broken bun shim)#2993louisgv merged 1 commit intoOpenRouterTeam:mainfrom
Conversation
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: 15cfab4
Findings
No security issues found. Changes are safe:
- Shell command construction uses only hardcoded literals (no injection risk)
- Proper error handling with stderr redirection (
2>/dev/null) - Environment variable expansion uses safe fallback patterns
- curl commands properly use
-fsSLflags - No user input interpolated into bash commands
- Bun detection change improves reliability without security impact
Tests
- bash -n: PASS (syntax check on install.sh)
- bun test: PASS (1964 tests, 0 failures)
- curl|bash: OK (no relative paths, no $0 dependencies)
- macOS compat: OK (bash 3.x compatible constructs)
Summary
This PR fixes a legitimate installation bug on Sprite where a bun shim exists but doesn't work. The fix changes detection from command -v bun to bun --version which actually tests functionality. All security practices are properly followed.
-- security/pr-reviewer
Security Review Complete - Needs RebaseVerdict: APPROVED (pending rebase) Security Findings✅ No security issues found. All changes are safe. Test Results✅ bash -n: PASS Action RequiredThis PR cannot be merged due to conflicts with recent changes on main (commit b47d6bb). Please rebase on the latest main branch and push the updated changes. Once rebased, the PR can be merged immediately. Security approval stands - no re-review needed after rebase unless substantial changes are made to the security-relevant code paths. -- security/pr-reviewer |
15cfab4 to
dfbda7c
Compare
Sprite has a bun shim at /.sprite/bin/bun that delegates to $HOME/.bun/bin/bun, but that binary doesn't exist on fresh VMs. `command -v bun` returns true (finds the shim) so the install script skips bun installation, then bun fails when actually invoked. Fixed in two places: - installSpawnCli: source shell profiles, test `bun --version` (not just existence), and install bun fresh if it doesn't work - install.sh: replace `command -v bun` with `bun --version` to detect broken shims Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dfbda7c to
a20451d
Compare
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: a20451d
Findings
No security issues found. Changes are safe and improve reliability:
- Shell PATH construction uses only hardcoded values ($HOME, $BUN_INSTALL expansion)
- curl|bash patterns follow security best practices (HTTPS, -fsSL flags, no user input)
- Change from
command -v buntobun --versionis actually a security improvement (tests actual functionality vs existence) - No command injection vectors, credential leaks, or path traversal risks
- macOS bash 3.x compatible (&>/dev/null, safe parameter expansion)
Tests
- bash -n: PASS (sh/cli/install.sh syntax valid)
- bun test: PASS (1955 tests pass, 0 failures)
- curl|bash safety: OK (HTTPS URLs, -fsSL flags, no dynamic construction)
- macOS compat: OK (bash 3.x safe patterns throughout)
Summary
This PR fixes a real issue where Sprite's broken bun shim caused installation failures. The fix properly tests bun functionality rather than just existence, and all shell command construction is safe (hardcoded literals only). Ready to merge.
-- security/pr-reviewer
Summary
/.sprite/bin/bunthat tries to exec$HOME/.bun/bin/bun— which doesn't exist on fresh VMscommand -v bunreturns 0 (finds the shim) so the install script skips bun installation, then bun fails when actually invokedinstallSpawnCli: now sources shell profiles, testsbun --version(not just existence), and installs bun fresh if it doesn't workinstall.sh: replacedcommand -v bunwithbun --versionto detect broken shimsTest plan
spawn claude sprite --beta recursive→ spawn CLI installs successfully (bun installed first)spawn claude hetzner --beta recursive→ still works (bun already functional)🤖 Generated with Claude Code