Skip to content

skill() tool fails: ripgrep archive did not contain executable (macOS arm64, v1.14.18) #23426

Closed as not planned

Description

@hoangnguyen291

Bug

The skill() tool always fails with:

ripgrep archive did not contain executable: /Users/<user>/.cache/opencode/bin/ripgrep-3sYiC0/ripgrep-14.1.1-aarch64-apple-darwin/rg

Every skill(name: "...") invocation triggers this error. The skill content is never loaded.

Environment

  • OpenCode version: 1.14.18 (latest)
  • OS: macOS (darwin arm64, Apple Silicon)
  • Shell: zsh

Steps to Reproduce

  1. Start an OpenCode session
  2. Call any skill: skill(name: "health"), skill(name: "review"), etc.
  3. Error occurs immediately

What I Tried

  • Clearing cache: rm -rf ~/.cache/opencode/bin/ripgrep-3sYiC0/ — OpenCode attempts re-download but fails the same way (directory is never recreated)
  • Manually placing a valid arm64 rg binary at the expected path — still fails with the same error
  • System ripgrep installed via Homebrew (rg v15.1.0 at /opt/homebrew/bin/rg) — OpenCode doesn't use it, uses its own bundled version

Analysis

The error suggests OpenCode downloads a ripgrep archive but either:

  1. The archive extraction fails silently (the target directory is never created), or
  2. There's a hash/manifest check that rejects the binary even when manually placed

The skill() tool depends on ripgrep internally (likely for searching skill file contents), so this completely blocks all skill loading on macOS arm64.

Impact

All gstack skills (/health, /review, /qa, /ship, /browse, etc.) are unusable. This blocks any workflow that relies on skill-based quality gates.

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 19, 2026
  2. github-actions commented on Apr 19, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  3. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  4. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  5. marcinciarka commented on Jul 20, 2026

    @marcinciarka

    Just had the same issue and managed to fix it.

    opencode looks for ripgrep at ~/.cache/opencode/bin/rg, and if that file already exists it uses it and skips the download entirely. The failure happens in the download-and-extract step - the tarball comes down fine, but unpacking it doesn't produce the rg binary at the expected path, so opencode falls back to plain grep and search quietly gets worse.

    The fix is just to create that file yourself. Opencode probably already downloaded the tarball (it's sitting at ~/.cache/opencode/bin/ripgrep-*.tar.gz), it just failed to unpack it - so you can extract rg straight from what's already there, no extra install needed:

    BIN="${XDG_CACHE_HOME:-$HOME/.cache}/opencode/bin"
    TMP="$(mktemp -d)"
    tar -xzf "$BIN"/ripgrep-*.tar.gz -C "$TMP"
    cp -f "$(find "$TMP" -name rg -type f | head -1)" "$BIN/rg"
    chmod +x "$BIN/rg"
    rm -rf "$TMP"
    "$BIN/rg" --version   # sanity check
    

    After that, explore/search work correctly again. If you'd rather use a ripgrep you already have installed, cp "$(command -v rg)" ~/.cache/opencode/bin/rg && chmod +x ~/.cache/opencode/bin/rg does the same thing.

    I also wrote a slightly longer version with comments and a system-ripgrep fallback in case anyone wants something more robust to drop in a setup script:

    #!/usr/bin/env bash
    # Fix for opencode's "ripgrep archive did not contain executable" error.
    #
    # opencode looks for ripgrep at ~/.cache/opencode/bin/rg and, if that file
    # already exists, uses it and skips its own download. The bug is that its
    # download+extract step fails on some machines, so that file never gets created
    # and search silently falls back to plain grep. This script just creates it.
    
    set -eu
    
    # Where opencode expects the ripgrep binary (XDG-aware, works on Linux + macOS).
    BIN="${XDG_CACHE_HOME:-$HOME/.cache}/opencode/bin"
    mkdir -p "$BIN"
    
    # Option 1: reuse the tarball opencode already downloaded but failed to unpack.
    # It's version-matched and needs no extra install.
    TARBALL="$(ls "$BIN"/ripgrep-*.tar.gz 2>/dev/null | head -1)"
    if [ -n "$TARBALL" ]; then
      echo "Found opencode's downloaded tarball, extracting rg from it..."
      TMP="$(mktemp -d)"
      tar -xzf "$TARBALL" -C "$TMP"
      RG="$(find "$TMP" -name rg -type f -perm -u+x 2>/dev/null | head -1)"
      if [ -n "$RG" ]; then
        cp -f "$RG" "$BIN/rg"
        chmod +x "$BIN/rg"
      fi
      rm -rf "$TMP"
    fi
    
    # Option 2: no usable tarball? fall back to a ripgrep already installed on PATH.
    # The [ -f ] check ensures we copy a real binary, not a shell alias/function.
    if [ ! -x "$BIN/rg" ]; then
      SYSTEM_RG="$(command -v rg 2>/dev/null || true)"
      if [ -n "$SYSTEM_RG" ] && [ -f "$SYSTEM_RG" ]; then
        echo "Copying your system ripgrep from $SYSTEM_RG ..."
        cp -f "$SYSTEM_RG" "$BIN/rg"
        chmod +x "$BIN/rg"
      fi
    fi
    
    # Report the result.
    if [ -x "$BIN/rg" ]; then
      echo "Done: $BIN/rg -> $("$BIN/rg" --version | head -1)"
    else
      echo "Couldn't fix it automatically: no opencode tarball found and no ripgrep on PATH."
      echo "Install ripgrep first (macOS: brew install ripgrep, Debian/Ubuntu: sudo apt install ripgrep), then re-run."
    fi
    
    

    (Root cause still seems worth fixing in opencode's extract logic — this is just an unblock in the meantime.)

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions