openai / openai/codex-action

Mutually exclusive inputs are rejected only after irreversible setup steps

Open
#139 0 comments 0 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

Several invalid input combinations are validated only inside the final run-codex-exec helper. By the time that helper runs, the composite action may already have installed packages, started the Responses proxy, changed Linux user-namespace settings, and run the irreversible drop-sudo safety step.

The most obvious examples are:

  • prompt together with prompt-file;
  • output-schema together with output-schema-file;
  • permission-profile together with sandbox;
  • permission-profile with safety-strategy: read-only.

Reproduction

For example:

- uses: openai/codex-action@v1
  with:
    openai-api-key: ${{ secrets.OPENAI_API_KEY }}
    prompt: Review this change
    prompt-file: .github/codex-prompt.md

The action does not reject the conflict at startup. It proceeds through setup and reaches the final helper, where src/main.ts eventually throws:

Only one of `prompt` or `prompt-file` may be specified.

With the default safety-strategy: drop-sudo, that validation occurs after the action has already revoked sudo for the rest of the job.

Expected behavior

Input combinations that are known to be invalid without any repository or network inspection should fail before proxy startup, host configuration changes, or privilege reduction.

Suggested fix

Add a small preflight immediately after Node setup that mirrors the helper's simple mutual-exclusion checks and exits with the same actionable errors before side-effecting steps run.

The final helper should retain its existing validation as defense in depth and for direct CLI-helper callers.

Impact

This is failure ordering and job reliability. A typo or duplicated input can currently mutate the runner irreversibly before the action reports that it could never run the requested Codex command.

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 with the composite action's setup steps and src/main.ts, tracing where Node setup, proxy startup, host changes, privilege reduction, and final validation occur. Add the preflight after Node setup while retaining the helper checks, then verify each listed invalid input combination fails before side effects with actionable errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.