openai / openai/codex-security

Scan always fails at seal step: `scan-manifest.json: expected a regular file inside the scan directory` — reproducible on Windows AND Linux

Open
#73 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area:cost area:reports area:sandbox bug priority:p1
Dominant language
TypeScript
Stars
10.8k
Forks
801
Avg merge
1d 8h
Merged PRs (30d)
257

Description

Summary

codex-security scan fails deterministically at the seal step. The scan runs to completion (models are invoked, tokens billed), preflight reports zero issues, then the tool errors trying to save the manifest and leaves the scan output directory completely empty on disk. Failure is independent of repo size, platform, and path length. Reproduced on both Windows and Linux.

Repro

mkdir C:\tmp\repro\empty
cd C:\tmp\repro\empty
git init
"print('hi')" > hello.py
git add . ; git commit -m init
codex-security scan

Same failure occurs on real repos of any size.

Error output

codex-security: Could not save the Codex Security scan: scan-manifest.json: expected a regular file inside the scan directory.
codex-security: Partial output was kept at <scan-dir>.

Post-failure filesystem state

The "partial output" directory is completely empty — verified via dir /a /s on Windows and find -type f on Linux. No files, hidden or otherwise. The tool never persisted findings, coverage, or the manifest to disk.

Meanwhile the state DB (workbench.sqlite3) DOES record the scan:

  • scans.status = 'failed'
  • scans.phase = 'preflight' (never advanced per DB, even though 3–5 min of model work occurred and was billed)
  • scans.seal_manifest_digest = NULL
  • scan_artifacts, findings, finding_occurrences tables all have 0 rows

Environment

  • Windows: Server 2025 Datacenter 10.0.26100 on an AWS EC2 developer workstation (accessed via RDP), Node v24.18.0, LongPathsEnabled=1 (not a MAX_PATH issue)
  • Linux (Docker repro): Ubuntu 24.04.4 LTS, kernel 6.17.0-1017-aws, Node v22.23.1, running as root in a container with a bind-mounted repo + credentials dir
  • codex-security CLI: 0.1.1
  • codexSdkVersion: 0.144.6
  • bundledPluginVersion: 0.1.14
  • Model: gpt-5.6-sol at xhigh reasoning, multi_agent_v2 (9 concurrent threads)

Cross-platform confirmation

# Platform Node Repo size Cost Error
1 Windows Server 2025 24.18.0 656 files $2.96 same
2 Windows Server 2025 24.18.0 656 files (retry) $2.64 same
3 Windows Server 2025 24.18.0 77 files $0.86 same
4 Windows Server 2025 24.18.0 3 files $1.82 same
5 Windows Server 2025 24.18.0 3 files (--output-dir <short-path>) $2.42 same
6 Ubuntu 24.04 (Docker) 22.23.1 3 files $3.09 same

Total burned across 6 failed scans: $13.79. Zero findings persisted to disk. Every attempt calls the model and throws at the seal step regardless.

Likely root cause (guess)

The seal step calls fs.statSync('scan-manifest.json') in the scan output directory and rejects if !stat.isFile(). When the file was never written, the error gets rewrapped into "expected a regular file". Some prior write to that path silently failed, so the seal step tries to stat a file that was never created.

Impact

Blocks all usage (both Windows and Linux). Every retry burns real money against the user's OpenAI account. No way to recover any of the billed findings after failure — the scan runs to completion but nothing is persisted.

Requested fix

Version 0.1.1 is currently the only usable version on npm (0.1.0 was initial). Please cut a 0.1.2 that either:

  1. Fails fast at preflight before invoking models (no charge for known-broken save path), OR
  2. Actually fixes the seal step so findings persist

Contributor guide

Open the contributing guide

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

Reproduce the failure with codex-security scan in the minimal Git repository described, then trace the CLI's seal step and scan-manifest save path. Check how the state DB records the failed scan and empty artifact tables. Done means the tool either fails before model work or persists the manifest and scan findings successfully on both Windows and Linux.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
cli, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.