Skip to content

Codex review hangs indefinitely on Windows with Git Bash shell #138

@0xZOne

Description

@0xZOne

Environment

  • OS: Windows 11 Pro 10.0.22631
  • Claude Code shell: Git Bash (bash)
  • Plugin version: 1.0.1
  • Codex CLI: codex-cli 0.118.0
  • Node.js: v22.17.0

Problem

Codex review jobs hang indefinitely on Windows when Claude Code is configured to use Git Bash. Reviews run for 10h–87h+ without completing.

Symptoms

  1. Shell commands are repeatedly "declined" (exit -1), even trivial ones like Write-Output hi and git status -v
  2. Commands are routed through PowerShell (C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe) despite the user's shell being Git Bash
  3. Reviews that can't execute shell commands fall back to MCP/LSP tools but get stuck in "investigating" phase indefinitely
  4. Some review sessions can execute commands (exit 0) while others in the same session cannot — inconsistent behavior

Log Examples

Progress:
  Running command: powershell.exe -Command 'Write-Output hi'
  Command declined: powershell.exe -Command 'Write-Output hi' (exit -1)
  Running command: powershell.exe -Command 'git status -v'
  Command declined: powershell.exe -Command 'git status -v' (exit -1)
  Calling omx_code_intel/lsp_document_symbols.
  # ... stuck in investigating for 10+ hours

Root Cause Analysis

In lib/app-server.mjs (~L190) and process.mjs (~L7):

shell: process.platform === "win32"

On Windows, spawn() with shell: true uses cmd.exe by default. The Codex app-server then defaults to PowerShell for subprocess execution, which doesn't match the user's configured Git Bash environment. This causes a shell mismatch where commands are declined or fail silently.

Suggested Fix

Respect the user's configured shell environment instead of hard-coding Windows shell detection:

// Use SHELL env var if available (Git Bash sets this)
const shell = process.platform === "win32"
  ? (process.env.SHELL || true)
  : false;

Steps to Reproduce

  1. Install Claude Code on Windows 11
  2. Configure Claude Code to use Git Bash as the shell
  3. Install the Codex plugin (/plugin install codex@openai-codex)
  4. Run /codex:review
  5. Observe the review hanging in "running" or "investigating" phase with shell commands being declined

Workaround

None found. The review never completes on this configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions