@oai/artifact-tool files renamed with "(1)" suffix on Windows, causing missing entry file error
@oai/artifact-tool files renamed with "(1)" suffix on Windows, causing missing entry file error
Description
On Windows, the Codex primary-runtime installer renames ALL files inside @oai/artifact-tool with a (1) suffix (e.g. package.json → package(1).json, artifact_tool.mjs → artifact_tool(1).mjs). This causes Node.js to fail resolving the package entry points declared in exports, producing a "missing entry file" error. Spreadsheet and presentation generation both fail.
Environment
- OS: Windows 10 22H2 (x64)
- Codex CLI version: 0.142.5
- Codex Desktop build: 26.707.71524
- Runtime: codex-primary-runtime, bundleVersion 26.709.11516
- artifact-tool version: 2.8.22 (from
runtime.json) - Node: v24.14.0
Reproduction
- Install or update Codex Desktop on Windows.
- Wait for primary-runtime to install/update.
- Attempt to generate a spreadsheet (.xlsx) or presentation (.pptx).
- Error:
@oai/artifact-toolmissing entry file / module not found.
Root Cause
The package directory exists at:
%USERPROFILE%\.cache\codex-runtimes\codex-primary-runtime\dependencies\node\node_modules\@oai\artifact-tool\
However, every file and directory inside it has (1) appended to its name. For example:
| Expected (per package.json exports) | Actual filename on disk |
|---|---|
| package.json | package(1).json |
| dist/artifact_tool.mjs | dist/artifact_tool(1).mjs |
| dist/presentation-jsx/index.mjs | dist/presentation-jsx/index(1).mjs |
| dist/presentation-jsx/jsx-runtime.mjs | dist/presentation-jsx/jsx-runtime(1).mjs |
| dist/presentation-jsx/jsx-dev-runtime.mjs | dist/presentation-jsx/jsx-dev-runtime(1).mjs |
| LICENSE.md | LICENSE(1).md |
| ...and 118+ more files | all with (1) suffix |
This pattern affects not just the top-level package files, but also all bundled dependencies under node_modules/ (agent-base, detect-libc, follow-redirects, https-proxy-agent, ms, parenthesis, skia-canvas, string-split-by, @oai/walnut, etc.).
The package(1).json declares:
{
"exports": {
".": "./dist/artifact_tool.mjs",
"./presentation-jsx": "./dist/presentation-jsx/index.mjs",
"./presentation-jsx/jsx-runtime": "./dist/presentation-jsx/jsx-runtime.mjs",
"./presentation-jsx/jsx-dev-runtime": "./dist/presentation-jsx/jsx-dev-runtime.mjs"
}
}
But Node.js cannot find ./dist/artifact_tool.mjs because the actual file is named artifact_tool(1).mjs.
This is likely caused by the Windows file download/extraction routine hitting a name collision and applying the standard Windows "(1)" dedup suffix to ALL files instead of only the conflicting ones.
Impact
- Spreadsheet (.xlsx) generation fails completely
- Presentation (.pptx) generation fails completely
- The error message ("missing entry file") is misleading — the files exist but with wrong names
- The issue recurs after each Codex runtime update, making it persistent
Workaround
Rename all files to remove the (1) suffix:
import os
base = r"C:\Users\<user>\.cache\codex-runtimes\codex-primary-runtime\dependencies\node\node_modules\@oai\artifact-tool"
for root, dirs, files in os.walk(base, topdown=False):
for f in files:
if "(1)" in f:
old = os.path.join(root, f)
new = os.path.join(root, f.replace("(1)", ""))
if not os.path.exists(new):
os.rename(old, new)
else:
os.remove(old) # duplicate, proper file already exists
for d in dirs:
if "(1)" in d:
old = os.path.join(root, d)
new = os.path.join(root, d.replace("(1)", ""))
if not os.path.exists(new):
os.rename(old, new)
After running this, all entry points resolve correctly and spreadsheet/presentation generation works — until the next runtime update re-pollutes the filenames.
Expected Fix
The runtime installer's file extraction logic on Windows should not apply the (1) suffix to all files. If there's a name collision during extraction, it should either overwrite the existing file or clean the target directory before extraction.
Related Issues
- #29119 — Same symptom (artifact-tool not found on Windows), but in that case the package directory is entirely absent. Here it exists but filenames are corrupted.
- #30711 — Primary Runtime installation fails to complete on Windows 10.