Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

Fix OpenCode install on macOS (.zip asset) + detect failed download - #69

Merged
BarneyChambers merged 1 commit into
mainfrom
fix/opencode-install-zip
Jun 16, 2026
Merged

Fix OpenCode install on macOS (.zip asset) + detect failed download#69
BarneyChambers merged 1 commit into
mainfrom
fix/opencode-install-zip

Conversation

@BarneyChambers

Copy link
Copy Markdown
Collaborator

Summary

Reported live: opencode local on macOS printed curl: (56) ... 404, still said "OpenCode installed", then opencode: command not found at launch.

Two bugs:

  1. macOS asset renamed — sst/opencode now ships .zip on macOS (opencode-darwin-arm64.zip); Linux is still .tar.gz. The hardcoded …/opencode-$OS-$ARCH.tar.gz 404s on macOS. (Linux/DO still worked, which is why it wasn't caught.)
  2. Failed install reported success — the command ended with ;-separated PATH/export statements, so the overall exit code was 0 even when curl 404'd → agentsea proceeded to launch a missing binary.

Fix

  • Choose .zip + unzip on darwin, .tar.gz + tar on linux.
  • Chain every step with && and end with test -x "$HOME/.opencode/bin/opencode", so a failed download/extract fails the install step (runLocal throws) instead of silently "succeeding".

Verified on real macOS

  • opencode-darwin-arm64.zip downloads (40 MB), unzips to a Mach-O arm64 opencode binary at root → mv + test -x succeed.
  • npm run typecheck clean; agent-config contract tests pass.

sst/opencode now ships .zip assets on macOS (.tar.gz only on Linux), so the
hardcoded opencode-$OS-$ARCH.tar.gz 404'd on macOS — yet the install still
reported "OpenCode installed" and launched a missing binary ("opencode: command
not found"). The trailing ;-separated PATH/export statements masked the failed
curl's exit code.

- Pick .zip + unzip on darwin, .tar.gz + tar on linux.
- Chain every step with && and end with `test -x .../opencode` so a failed
  download/extract fails the install step (runLocal throws) instead of silently
  succeeding.

Verified on macOS: opencode-darwin-arm64.zip downloads, unzips to a Mach-O arm64
`opencode` binary at root (so mv + test -x succeed).
@BarneyChambers
BarneyChambers merged commit 7a6c957 into main Jun 16, 2026
1 of 2 checks passed
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
grid-spawn-ui Building Building Preview, Comment Jun 16, 2026 11:51am

Request Review

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant