openai / openai/codex-plugin-cc

Windows: sandbox helper fails ("setup refresh had errors"), cancel command mangles /PID flag, and stale jobs never marked as failed

Open
#510 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
33.3k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

Environment: Windows 10/11, codex-plugin-cc (installed via Claude Code plugin
marketplace), invoked through the codex:codex-rescue subagent -> codex-companion.mjs

I ran into three related issues while delegating a task from Claude Code to Codex
on Windows:

1. Sandbox helper fails before running any command

Running a task that needed to execute a PowerShell command failed immediately
with:

windows sandbox: helper_unknown_error: setup refresh had errors

No command was ever executed -- Codex returned the intended commands as plain
text instead, which is a reasonable fallback, but the underlying sandbox
execution path appears broken on this Windows machine.

2. cancel command mangles the /PID flag on Windows

When a job hung and I tried to cancel it via the companion script's cancel
subcommand, the underlying taskkill invocation failed with:

taskkill /PID 11848 /T /F: exit=1: Error: Argumento u opcion no valido - "C:/Program Files/Git/PID".

This looks like a Git-Bash/MSYS path-translation issue: /PID is being
interpreted as a POSIX path fragment and rewritten to a Windows path
(C:/Program Files/Git/PID) before reaching taskkill. Workaround: killing
the process directly via Stop-Process -Id <pid> in PowerShell instead of the
companion's own cancel command.

3. Hung jobs never transition out of "running" status

A job whose underlying Codex thread was confirmed gone (log line: Codex turn interrupt failed: thread not found: <threadId>) still shows "status": "running" in status --all --json more than 24 hours later. There doesn't
seem to be a timeout or reconciliation step that marks orphaned jobs as
failed/dead, so status --all accumulates zombie entries indefinitely.

Suggested fixes

  • Investigate why the sandbox helper fails to initialize on Windows (possibly
    related to how the sandbox is set up per-platform).
  • Fix the cancel command to avoid POSIX-style /PID flags when the
    underlying shell is Git Bash/MSYS on Windows (e.g. use a stop-parsing
    token, or invoke via cmd.exe /c explicitly, or use PowerShell's
    Stop-Process instead of taskkill).
  • Add a reconciliation check that detects "thread not found" and marks the job
    as failed instead of leaving it "running" forever.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with codex-companion.mjs and trace the sandbox setup, cancel, and status --all --json paths on Windows. Reproduce the helper initialization error, Git-Bash taskkill argument rewriting, and orphaned running job behavior. Done means each path handles the reported Windows case and abandoned jobs no longer remain running indefinitely.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.