openai / openai/codex-plugin-cc
spawnSync with shell:true fails on Windows network drives (UNC paths)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 33.3k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
Bug
collectReviewContext() in lib/git.mjs calls getRepoRoot() → git rev-parse --show-toplevel, which on Windows network/NAS drives returns a UNC path (e.g. \192.168.8.4\NAS\AIProjects\MyRepo). This UNC path is then passed as cwd to spawnSync({ shell: true }) in lib/process.mjs, which invokes cmd.exe — and cmd.exe rejects UNC working directories:
git merge-base HEAD main: exit=128: '\192.168.8.4\NAS\AIProjects\MyRepo'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
fatal: not a git repository (or any of the parent directories): .git
Root cause
In lib/process.mjs:
shell: process.platform === "win32"
When shell: true, Node.js uses cmd.exe on Windows. cmd.exe cannot use UNC paths as working directories.
The initial git commands succeed because process.cwd() returns the mapped drive letter (e.g. N:\AIProjects\MyRepo). But getRepoRoot() in lib/git.mjs:30 runs git rev-parse --show-toplevel, which resolves to the underlying UNC path. That UNC path is then used as cwd for all subsequent git calls in collectBranchContext() and collectWorkingTreeContext(), which fail.
Reproduction
- Have a git repo on a Windows SMB/NAS share (either mapped drive like
N:or direct UNC path) - Run any
/codex:reviewor/codex:adversarial-reviewcommand from that repo
Suggested fixes (either would work)
- Use
shell: falseinspawnSync— git doesn't need a shell to execute, and this sidesteps thecmd.exeUNC limitation entirely - Fall back to
process.cwd()whengit rev-parse --show-toplevelreturns a UNC path on Windows (i.e. starts with\or//)
Workarounds attempted (none worked)
GIT_WORK_TREE/GIT_DIRenvironment variables — git still resolves to UNCgit config --local core.worktree "N:/..."—--show-toplevelignores itsubstvirtual drive — git resolves through to the real UNC path- Overriding
ComSpecto bash — not picked up correctly by Node.js - PowerShell as launcher — same result, Node still spawns cmd.exe internally
Environment
- Windows 11 Pro
- Node.js (via Claude Code plugin runtime)
- Git for Windows
- SMB network share (Synology NAS)
- codex-plugin-cc v1.0.1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/process.mjs to inspect the Windows spawnSync options, then trace the repository-root handling in lib/git.mjs and the calls from collectReviewContext(), collectBranchContext(), and collectWorkingTreeContext(). Reproduce the review command from a Windows repository on a mapped or UNC network drive, and consider the issue's proposed approaches; done means subsequent git commands succeed with the repository root as their working directory.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, javascript, node.js
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100