Windows: DEP0190 deprecation warning in stderr causes Stop hook to block every turn (codex@1.0.4)

Open 💬 0 comments Opened May 9, 2026 by YuiFutao

Summary

On Windows, the codex@openai-codex plugin's Stop hook (stop-review-gate-hook.mjs) causes a blocking error on every Claude Code turn due to Node.js DEP0190 warnings leaking into stderr.

Root Cause

scripts/lib/process.mjs line 12:

shell: process.platform === "win32" ? (process.env.SHELL || true) : false,

On Windows where SHELL is unset, this evaluates to shell: true. When combined with array arguments (e.g. ["codex", "app-server"]), Node.js emits a DEP0190 deprecation warning to stderr:

(node:56052) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.

The same pattern exists in scripts/lib/app-server.mjs lines 189–195.

Why This Breaks Stop Hook

stop-review-gate-hook.mjs lines 120–128 reads stderr and treats nonzero exit as a block reason:

if (result.status !== 0) {
  // DEP0190 warning → nonzero exit → block reason set to DEP0190 text
  ...
}

The DEP0190 warning in stderr causes the subprocess to exit nonzero, and the warning text is passed back to Claude Code as the block reason. Result: every Stop hook invocation is a blocking error, regardless of code quality.

Affected Files

  • scripts/lib/process.mjs:12shell: process.env.SHELL || true on Windows
  • scripts/lib/app-server.mjs:189-195 — same pattern

Proposed Fix

Option A (preferred): Use shell: false + pass a single command string, or use cmd /c wrapper:

// Before
shell: process.platform === "win32" ? (process.env.SHELL || true) : false,

// After
shell: false,
// and prepend ["cmd", "/c"] to the args array on Windows

Option B: Keep shell: true but join command and args into a single string (bypasses DEP0190 detection).

Environment

  • OS: Windows 11 Pro 10.0.26200
  • Node.js: ≥22 (where DEP0190 was introduced)
  • Plugin version: codex@openai-codex 1.0.4
  • Codex CLI: 0.129.0

Workaround

As a workaround, disable the stop gate (/codex:setup --disable-review-gate) and implement a custom Python Stop hook that calls codex exec directly via subprocess.Popen(["cmd", "/c", "codex", "exec", ...], shell=False).

🤖 Filed via Claude Code

View original on GitHub ↗