Codex Security Deep Scan fails twice on Windows: spawn EPERM, then missing threat_model.md after workaround
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- javascript, node.js, rust
- Domain
- devtools, operating-systems, security
Research direction
Start with the deep-scan-mcp/v1 workflow and the resolveCodexPath function shown in the report, then trace the worker artifact validation around threat_model.md. Reproduce the Windows scan with and without CODEX_CLI_PATH and inspect the retry and cancellation paths. Done means the executable is resolved reliably and a missing worker artifact produces actionable handling without discarding usable results.
Written by the indexing model from the issue text.
Description
Summary
Codex Security Deep Scan on Windows encounters two sequential terminal failures:
- With
CODEX_CLI_PATHunset, discovery workers fail withspawn EPERM. This matches #35872. - After applying the documented workaround—pointing
CODEX_CLI_PATHat the directly spawnable native npmcodex.exeand restarting Codex Desktop—a fresh scan gets past worker launch but fails later because the requiredthreat_model.mdartifact is missing.
Both scans terminated during discovery with zero accepted findings and no validation or final report. The second failure happened after multiple worker attempts, so the scan performed substantial work but returned no usable partial result.
Environment
- Windows 11 Home, x64, version
10.0.26200 - Codex Desktop
- Codex Security plugin
0.1.15 - Native npm Codex CLI binary, currently
codex-cli 0.146.0 - Private local Git repository scanned at a fixed immutable revision
- Deep Scan workflow:
deep-scan-mcp/v1, deterministic mode
Failure 1: bare codex cannot be spawned
Steps
- Leave
CODEX_CLI_PATHunset. - Start a fresh Codex Security Deep Scan.
- Complete setup and allow preflight to pass.
- Wait for discovery workers to launch.
Actual result
The selected worker exhausted four attempts with synchronous spawn EPERM. The remaining workers were canceled.
Sanitized result:
{
"status": "failed",
"discoveryCount": 0,
"failure": {
"phase": "discovery",
"message": "spawn EPERM",
"kind": "Error:EPERM"
}
}
Directly spawning the native npm codex.exe succeeds. The plugin runtime falls back to the bare command when the override is absent:
function resolveCodexPath(env = process.env) {
return env.CODEX_CLI_PATH?.trim() || "codex";
}
This first failure is already represented by #35872.
Workaround applied
- Set the user-level
CODEX_CLI_PATHto the direct native npmcodex.exe, not thecodex.cmdshim. - Verify that the file exists and
--versionexits successfully. - Restart Codex Desktop so the plugin MCP process inherits the variable.
- Start a completely new Deep Scan against the same immutable revision.
The previous spawn EPERM no longer occurred, confirming that the workaround fixed the first launcher failure.
Failure 2: required worker artifact is missing
The new scan completed deterministic setup and successfully launched discovery workers. Its effective configuration was:
{
"workers": 6,
"subagents": 3,
"stopAfterNoNew": 6,
"maxDiscoveryRuns": 60
}
One discovery worker reached attempt 4 and then failed with:
Codex worker file change failed. Deterministic artifact validation also reported:
ENOENT: no such file or directory, realpath
'<scan-root>\artifacts\deep_discovery\workers\discovery-0004\output\threat_model.md'
The other five workers were canceled. Sanitized terminal manifest:
{
"workflowVersion": "deep-scan-mcp/v1",
"status": "failed",
"dispatchedCount": 6,
"discoveryCount": 0,
"acceptedWorkerIds": [],
"mergedWorkerIds": [],
"workerThreatModelPaths": [],
"canonical": null,
"executions": [
{
"label": "discovery-0004",
"kind": "discovery",
"status": "failed",
"attempt": 4,
"error": "Codex worker file change failed. Deterministic artifact validation also reported: ENOENT: no such file or directory, realpath '<scan-root>\\artifacts\\deep_discovery\\workers\\discovery-0004\\output\\threat_model.md'"
}
],
"failure": {
"phase": "discovery",
"kind": "Error:file_change_failed"
}
}
No successful discovery manifest was produced, so centralized validation, attack-path analysis, canonical result sealing, and report.md generation never ran.
Expected behavior
- On Windows, Deep Scan should resolve a directly executable Codex binary without requiring a manual environment override.
- Once workers launch, the artifact-writing contract should reliably produce every required file.
- If one worker fails to produce
threat_model.md, successful worker output should be preserved or the scan should return a useful partial result instead of canceling every worker. - Retries should surface actionable diagnostics and avoid repeating expensive attempts that end in the same deterministic artifact-validation failure.
- A failed scan should make clear what usage was consumed and whether any completed work can be resumed.
Impact
Deep Scan is currently unusable in this environment even after applying the workaround for #35872. The second failure occurs only after workers have launched and retried, but the all-or-nothing terminal result contains no findings or report. This creates user-visible compute/quota consumption without a usable deliverable.
I searched the issue tracker for both "Codex worker file change failed" and "threat_model.md" ENOENT and did not find an existing report for the second failure.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
Contributor guide
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.
More from openai/codex
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
CLI config enhancement skills
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
A-linter
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oxc-project/oxc#26863 ·