🪟

Windows+VSCodeのCodex IDE extensionで、無限にApproveを求められる問題への暫定対処(=>WSLを使う)

に公開

概要

CodexをAgentモードで動作させた場合、ワーキングディレクトリ以下のファイル読み書きは承認不要で実行される仕様です。

https://developers.openai.com/codex/ide
Approval modes
We’ve chosen a powerful default for how Codex works on your computer called Agent. In this approval mode, Codex can read files, make edits, and run commands in the working directory automatically. However, Codex will need your approval to work outside the working directory or access the internet network

しかしながら、Windows環境ではワーキングディレクトリ内の操作であっても都度承認を求められるようです。
また、「Approve this session」を選択したとしても、同様の承認を再度求められてしまいます。

暫定対処

Windows環境ではPowerShellでファイルの読み書きを行いますが、この場合の承認スコープ定義や取り回しが甘いように見えます。(推測)

VSCodeのデフォルトシェルをWSLに変更することで、CodexもBashベースの動作に切り替わり、仕様通りのスコープで自動承認が行われるようになります。

変更方法

WSL環境がセットアップされている前提で、Ctrl+Shift+P> Terminal: Select Default Profile より WSL を選択。


関連Issue

Discussion