codex icon indicating copy to clipboard operation
codex copied to clipboard

Codex CLI emits unescaped paths; zsh globbing breaks on `()`/`[]`

Open PaulRBerg opened this issue 2 months ago • 2 comments

What version of Codex is running?

0.72.0 (Homebrew)

What subscription do you have?

Which model were you using?

N/A (shell command generation issue, affects all models)

What platform is your computer?

macOS Tahoe v26.1

What issue are you seeing?

Codex emits unquoted paths containing glob metacharacters ((), [], *, ?). zsh interprets these as glob patterns and fails:

sed -n '1,220p' portal/app/(home)/_ui/ActivityList.tsx
# zsh:1: no matches found: portal/app/(home)/_ui/ActivityList.tsx

What steps can reproduce the bug?

  1. Have a file with parentheses in path (e.g., Next.js route group): app/(home)/page.tsx
  2. Let Codex try to read it
  3. zsh fails on the unquoted glob pattern

What is the expected behavior?

Paths should be quoted or escaped:

sed -n '1,220p' 'portal/app/(home)/_ui/ActivityList.tsx'

Additional information

Impact: Breaks Next.js App Router projects (route groups use (), dynamic routes use []).

Fix: Either shell-escape paths or avoid shell execution for file reads (use argv arrays instead).

Workarounds: Add AGENTS.md rule to quote paths, or change zsh config—neither acceptable as default UX.

PaulRBerg avatar Dec 13 '25 13:12 PaulRBerg

Please use the /feedback slash command to upload a session where you see this occurring and post the thread ID here. We'll need to determine whether this is the codex harness or model behavior.

etraut-openai avatar Dec 13 '25 17:12 etraut-openai

Thread ID 019b17d5-6eca-7b62-9abd-5e32016b9201

PaulRBerg avatar Dec 13 '25 17:12 PaulRBerg