Skip to content

fix(hooks): deny codex-companion calls whose text holds a dollar sign or backtick - #290

Merged
furedea merged 1 commit into
mainfrom
fix/companion-dollar-guard
Oct 22, 2026
Merged

furedea merged 1 commit into
mainfrom
fix/companion-dollar-guard

Conversation

@furedea-agent

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

Copy link
Copy Markdown
Contributor

概要

codex-companion.mjs の呼び出しで,単一引用符の外に dollar sign または backtick があるものを forbidden として拒否する.

背景

Claude Code の sandbox 除外は,展開を含まない単一の simple command にしか一致しない.dollar sign を含む focus text を渡した単発呼び出しが sandbox 内で実行され,~/.claude/plugins/data/... への書き込みで EPERM になった (2026-10-22).

変更内容

  • companion_objection が shell_inspection.text_outside_single_quotes の結果に dollar sign / backtick があれば deny する
  • 理由文に,task / focus text に dollar sign や backtick を含めてはならないこと,sandbox 除外は展開を含むコマンドに一致しないことを明記
  • 日本語本文,単一引用符内の dollar sign を含む simple call は引き続き許可

テスト

  • deny: 二重引用符内の dollar sign,裸の dollar 変数,backtick,dollar-paren 置換
  • allow: 通常呼び出し,日本語本文,単一引用符内の dollar sign
  • uv run --frozen pytest tests/agents 2183 件成功,vulture,deptry,lefthook 成功

Closes #288

🤖 Generated with Claude Code

… or backtick

The sandbox exclusion matches only a command without expansions, so a
single simple call with a dollar sign or backtick outside single quotes
still ran sandboxed and failed with EPERM.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea
furedea merged commit 9cb75e0 into main Oct 22, 2026
11 checks passed
@furedea
furedea deleted the fix/companion-dollar-guard branch October 22, 2026 05:54
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 プラグインの呼び出しで,シングルクォートの外に $ を含む形もフックで止める

1 participant