Skip to content

macOS sandbox-exec fails to run opencode from /opt/homebrew (Apple Silicon) #152

@gustavobittencourt

Description

@gustavobittencourt

Summary

On macOS (Apple Silicon), ralph-tui run --sandbox --agent opencode fails immediately with “Unknown error.” The agent never produces RAW OUTPUT and tasks are skipped instantly. Running without sandbox works.

Environment

  • macOS (Apple Silicon)
  • ralph-tui: latest (installed via bun)
  • opencode: 1.1.25 installed via Homebrew at /opt/homebrew/bin/opencode

Repro Steps

  1. Ensure opencode is installed via Homebrew at /opt/homebrew/bin/opencode.
  2. Run:
    ralph-tui run --prd <file>.json --auto-next --sandbox --agent opencode --headless
  3. Observe failure: tasks are skipped with “Unknown error” and RAW OUTPUT is empty.

Expected

Opencode should run under sandbox-exec and produce normal task output.

Actual

  • Iterations fail immediately with “Unknown error”
  • RAW OUTPUT empty in .ralph-tui/iterations/*.log
  • Running without sandbox (--no-sandbox) works and the agent executes tasks

Notes / Investigation

  • ralph-tui generates a Seatbelt profile with (allow process-exec) and read-only access to system dirs; custom readOnlyPaths are added as file-read* subpaths only.
  • Adding /opt/homebrew to readOnlyPaths and opencode dirs to allowPaths did not resolve it.
  • Direct sandbox-exec attempts to run /opt/homebrew/bin/opencode with a permissive profile still abort with exit code 134 (no stderr).

If helpful I can provide full logs and the generated sandbox profile string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions