Skip to content

fix(agents): deny codex-companion calls the sandbox exclusion cannot match - #269

Merged
furedea merged 1 commit into
mainfrom
fix/codex-companion-single-command
Oct 21, 2026
Merged

furedea merged 1 commit into
mainfrom
fix/codex-companion-single-command

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

概要

codex-companion.mjs を単一の単純コマンド以外(cd X && node ...,;,パイプ,リダイレクト,代入prefix,env)で呼ぶと,sandbox 除外にマッチせず ~/.claude/plugins/data/... への書き込みで EPERM になる.forbidden ガードで事前に deny する.

変更内容

  • agents/hooks/guard_command.py: forbidden 種別で,いずれかのセグメントが codex-companion.mjs を実行し,かつコマンド全体が単一の単純コマンドでない(解析不能も含む)場合に deny.理由文で --cwd <dir> の利用と単一コマンド形式を案内する.
  • tests/agents/hooks/test_forbidden_command.py: deny / allow ケースを追加.

確認

  • uv run --frozen pytest tests/agents: 1818 passed
  • lefthook pre-commit: 全て成功

Closes #268

🤖 Generated with Claude Code

…match

The sandbox exclusion matches only commands that start with
node ".../codex-companion.mjs", so a cd prefix, list, pipe, redirect, or
assignment ran sandboxed and failed with EPERM. Deny those up front and
point to the single-command form with --cwd.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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.

Codex プラグインの呼び出しが複合コマンドだとサンドボックス除外から外れて EPERM で落ちる

1 participant