Skip to content

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

Open

Description

@jbohnslav

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.

Activity

  1. burgulvedant commented on Oct 31, 2026

    @burgulvedant

    I'd like to take this. When the Responses API proxy was never started, read-server-info now fails immediately with a message naming the openai-api-key input, instead of polling the missing file for about 10 seconds. Other read errors keep the retry loop. Tests included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions