openai / openai/codex-action

Improve missing API key error: avoid ENOENT on missing server info JSON

Open
#70 0 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.2k
Forks
170
PR merge metrics
No merged PRs in 30d

Description

Summary

When openai/codex-action@v1 runs without an openai-api-key value, it fails with a low-signal ENOENT error about a missing server info JSON file.

Actual behavior

The action fails at read-server-info with:

Error reading server info: Error: ENOENT: no such file or directory, open '/home/runner/.codex/<run_id>.json'
Error: Failed to read server info from /home/runner/.codex/<run_id>.json

In this case, the root problem was that secrets.OPENAI_API_KEY was not set in the repo.

Expected behavior

A clear failure message like:

  • openai-api-key input is empty (did you forget to set OPENAI_API_KEY secret?)

instead of a downstream file-not-found error.

Why this is confusing

ENOENT on an internal .codex/<run_id>.json file reads like a runtime crash, not a missing input. It makes debugging much harder than necessary.

Suggested fix

Either:

  1. Add an explicit preflight validation for missing openai-api-key when required, or
  2. Guard read-server-info so it cannot run unless proxy startup/server-info creation was attempted.

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 by tracing the action's handling of the openai-api-key input and the read-server-info step, then inspect how proxy startup and server-info creation are sequenced. Reproduce the action without the input and verify that it reports the missing key clearly instead of the downstream ENOENT error.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd, devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.