Skip to content

Comments

Fail fast on empty openai-api-key to prevent misleading server-info ENOENT#71

Open
topherbuckley wants to merge 1 commit intoopenai:mainfrom
topherbuckley:fix/issue-70-empty-api-key-preflight
Open

Fail fast on empty openai-api-key to prevent misleading server-info ENOENT#71
topherbuckley wants to merge 1 commit intoopenai:mainfrom
topherbuckley:fix/issue-70-empty-api-key-preflight

Conversation

@topherbuckley
Copy link

Summary

Fixes issue #70 by adding explicit preflight validation for openai-api-key and preventing downstream server-info
reads when proxy startup cannot occur.

Root cause

Read server info could run when prompt/prompt-file was set even if openai-api-key was empty. In that case, proxy
startup was skipped, no <run_id>.json was created, and the action later failed with a misleading ENOENT error.

Fix

  • Added a preflight step in action.yml (for prompt executions) that trims openai-api-key and fails fast when empty:
    • openai-api-key input is empty. Set OPENAI_API_KEY secret and pass it to this action.
  • Updated Read server info step condition to run only when openai-api-key is non-empty.

Before / After

  • Before: missing/blank key could fail later with Failed to read server info ... ENOENT.
  • After: missing/blank key fails immediately with a clear actionable message; downstream read-server-info does not
    run on invalid startup paths.
  • Valid key path: unchanged.

Scope

Minimal, focused change in action.yml only.

Root cause: the Read server info step was allowed to run when a prompt was provided even if openai-api-key was empty, which skipped proxy startup and later failed with a misleading ENOENT while reading <run_id>.json.

Fix: add an explicit preflight validation step (for prompt runs) that trims openai-api-key and fails fast with a clear actionable error when empty; and gate Read server info on openai-api-key presence so downstream read logic cannot run on invalid startup paths.

Behavior: valid-key flows remain unchanged; missing/blank key now fails early with a clear message instead of a missing server-info JSON error.
@github-actions
Copy link

github-actions bot commented Feb 18, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@topherbuckley
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant