Skip to content

Claude sandbox から Orca runtime の unix socket に接続できるようにする - #215

Merged
wwwyo merged 1 commit into
mainfrom
wwwyo/fix-orca-cli-eprem
Nov 22, 2026
Merged

wwwyo merged 1 commit into
mainfrom
wwwyo/fix-orca-cli-eprem

Conversation

@wwwyo

@wwwyo wwwyo commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

何を変えたか

home/dot_claude/settings.json の sandbox.network.allowUnixSockets に ~/Library/Application Support/orca を追加した。

背景

Claude Code の Bash sandbox 内で orca CLI(orca orchestration send・orca bot connectors など)を実行すると、Permission denied connecting to Orca (EPERM) で失敗する。そのため毎回 dangerouslyDisableSandbox で再実行していた。

方式と理由

Orca CLI は ~/Library/Application Support/orca/orca-runtime.json の transport から unix socket に接続する。今の endpoint は ~/Library/Application Support/orca/o-4701-eafd.sock。

  • socket のファイル名は o-${pid}-${id先頭4文字}.sock で、起動ごとに変わる。一方、置き場所のディレクトリは固定なので、ディレクトリ単位で許可した。既存の /tmp・/var/folders と同じく、エントリはサブパスとして扱われる(検証で確認済み)。

  • path が unix socket の長さ上限を超える場合、Orca は /tmp/.orca-daemon-<uid>/… に移す。ここは既存の /tmp で許可済み。

  • excludedCommands 案は採らなかった。理由は次の 2 点。

    1. sandbox の外で動く範囲が、Orca CLI のすべての操作(書き込み・ファイル系を含む)に広がる。
    2. 呼び出しのテキストで照合するため、bot が使う形("${ORCA_CLI_COMMAND:-orca}" …)では照合されない。docs によれば、変数から取ったコマンド名は exclude されない。今の環境では ORCA_CLI_COMMAND=/Applications/Orca.app/Contents/Resources/bin/orca で、フルパスとも一致しない。

    socket の許可は呼び出し方に関係なく効く。

  • トレードオフ: Orca の user data dir にある他の socket(Electron の SingletonSocket など)にも接続できるようになる。SingletonSocket の実体は /var/folders にあり、こちらは既に許可済み。

検証

claude -p --model claude-haiku-5-5 で新しいセッションを起動し、sandbox 内(dangerouslyDisableSandbox なし)で実行した。

設定 コマンド 結果
追加なし(control) orca worktree ps Permission denied connecting to Orca (EPERM)
この PR の settings.json(--settings で指定) orca bot connectors Run this from a bot's chat.(runtime からの応答。EPERM ではない)
同上 "${ORCA_CLI_COMMAND:-orca}" worktree ps worktree の一覧が返る

反映

~/.claude/settings.json は canonical checkout への symlink なので、merge して canonical で pull すると反映される。chezmoi apply は不要。

Summary by CodeRabbit

  • Configuration
    • Added ~/Library/Application Support/orca to the sandbox’s allowed Unix socket paths. /tmp remains allowed.

@orca-bots

orca-bots Bot commented Nov 22, 2026

Copy link
Copy Markdown

Auto Approve

Working…

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The sandbox’s network.allowUnixSockets list now includes ~/Library/Application Support/orca. The existing /tmp entry remains.

Changes: Sandbox socket access

Layer / File(s) Summary
Update Unix socket allowlist
home/dot_claude/settings.json
The allowlist adds ~/Library/Application Support/orca and retains /tmp.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: Minimal · up to 4c6a1

This adds Orca's data directory to the Claude sandbox's allowed Unix sockets so the Orca CLI can connect to its runtime. The change is a small config edit that is easy to revert. The only side effect is that other sockets in that directory also become reachable, and the PR describes this trade-off. No merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title is in Japanese and states the main change: it lets the Claude sandbox connect to the Orca runtime Unix socket. The changeset adds ~/Library/Application Support/orca to sandbox.network.allowU…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title is in Japanese and states the main change: it lets the Claude sandbox connect to the Orca runtime Unix socket. The changeset adds ~/Library/Application Support/orca to sandbox.network.allowUnixSockets in home/dot_claude/settings.json, which matches the title's intent. The title is specific and does not use vague terms.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 118d9b29-010e-4ebd-bba3-452e2b953cfc
Commits

Reviewing files that changed from the base of the PR and between bc61f34 and 4c6a17d.

Files selected for processing: 1

  • home/dot_claude/settings.json

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Approach: 妥当。socket のファイル名が起動ごとに変わるため、固定の置き場ディレクトリを allowUnixSockets で許可する方式は、excludedCommands より影響範囲が狭く、呼び出し形(${ORCA_CLI_COMMAND:-orca})にも依存しない。

Reviewed changes

この run では、差分 1 ファイル 1 行を確認した。

  • home/dot_claude/settings.json: sandbox.network.allowUnixSockets に ~/Library/Application Support/orca を追加した。

確認した観点: 通常レビューと可搬性。差分は 1 行の設定追加で、subagent は起動していない。

  • ~ 表記は同配列の ~/.rd/docker.sock と同じで、/Users/<name> の混入はない。
  • macOS 専用の Orca の置き場だが、Linux では該当 path が存在しないだけで無害。
  • PR 本文に control と変更後の検証結果があり、トレードオフ(他の socket にも届く点)も明記されている。

対象外: 文書・コメントの変更が無いため、ガバナンスの観点は適用していない。

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@wwwyo
wwwyo merged commit 13235fc into main Nov 22, 2026
9 checks passed
@wwwyo
wwwyo deleted the wwwyo/fix-orca-cli-eprem branch November 22, 2026 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant