Summary
A ChatGPT Work/Codex Library upload using the bundled prepared-upload helper fails with FileNotFoundError for its own temporary state directory. The failure occurs after the upload workflow has started, leaving the final Library write status uncertain and preventing a safe retry because duplicate Library items may be created.
Reproduction
- Run the bundled
openai-library skill helper skills/library/scripts/library_upload.py with one JSON request containing two small local files from the active conversation workspace.
- Use
purpose: create_library_file for both files.
- Let the helper perform preparation, transfer, finalization, and metadata writeback.
The helper exits with status 1 and reports:
library upload failed: [Errno 2] No such file or directory: '/tmp/openai-library-upload-<random>'
The relevant workflow creates this directory with tempfile.TemporaryDirectory(prefix="openai-library-upload-", dir=Path("/tmp")). The exception is surfaced by the helper's top-level OSError handler. No ordered result payload is returned, and no Library identity xattrs were present on the original local files afterward.
Expected behavior
The helper should return a definitive ordered result for every file. Temporary-directory cleanup must not turn an otherwise completed or partially completed operation into an unknown outcome. If cleanup discovers the directory is already absent, it should either tolerate that condition or preserve the confirmed finalization result.
Actual behavior
The helper exits with FileNotFoundError for its own /tmp/openai-library-upload-* directory. Because the error occurs after the workflow starts, the caller cannot safely retry or switch to direct Library writes without risking duplicates.
Environment
- Surface: ChatGPT Work / Codex
- OS/runtime: managed Linux workspace
- Library skill package:
openai-library/0.1.41
- Files: two small YAML files (approximately 56 KB and 80 KB)
- Batch mode: prepared upload helper, both files in one request
Suggested fix
- Make temporary state cleanup robust to a missing state directory.
- Ensure the helper emits the definitive finalization result before non-critical cleanup.
- If finalization is uncertain, return a structured per-item unknown-state result or a recovery identifier so callers can verify without creating duplicates.
Summary
A ChatGPT Work/Codex Library upload using the bundled prepared-upload helper fails with
FileNotFoundErrorfor its own temporary state directory. The failure occurs after the upload workflow has started, leaving the final Library write status uncertain and preventing a safe retry because duplicate Library items may be created.Reproduction
openai-libraryskill helperskills/library/scripts/library_upload.pywith one JSON request containing two small local files from the active conversation workspace.purpose: create_library_filefor both files.The helper exits with status 1 and reports:
The relevant workflow creates this directory with
tempfile.TemporaryDirectory(prefix="openai-library-upload-", dir=Path("/tmp")). The exception is surfaced by the helper's top-levelOSErrorhandler. No ordered result payload is returned, and no Library identity xattrs were present on the original local files afterward.Expected behavior
The helper should return a definitive ordered result for every file. Temporary-directory cleanup must not turn an otherwise completed or partially completed operation into an unknown outcome. If cleanup discovers the directory is already absent, it should either tolerate that condition or preserve the confirmed finalization result.
Actual behavior
The helper exits with
FileNotFoundErrorfor its own/tmp/openai-library-upload-*directory. Because the error occurs after the workflow starts, the caller cannot safely retry or switch to direct Library writes without risking duplicates.Environment
openai-library/0.1.41Suggested fix