fix: suppress workflow commands in Codex output - #176
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed777b2bca
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| shell: bash | ||
| run: | | ||
| exec env -u NODE_OPTIONS NODE_OPTIONS=--disable-sigusr1 node --disable-sigusr1 "$ACTION_PATH/dist/main.js" run-codex-exec \ | ||
| workflow_command_token="codex-action-$(uuidgen)" |
There was a problem hiding this comment.
Avoid requiring uuidgen on every runner
On self-hosted or minimal runners where uuidgen is not installed, this substitution returns 127 and the GitHub bash shell exits before Codex is launched because it runs scripts with -e (documented shell command). The repository neither installs nor checks for uuidgen; for example, a minimal Ubuntu 24.04 environment needs the separate uuid-runtime package. Generate the token using an already guaranteed runtime such as Node, or provide a dependency-free fallback.
Useful? React with 👍 / 👎.
|
We are also hitting this issue in a real GitHub Actions workflow using openai/codex-action. Codex completes successfully and produces its final structured result, but the action step is marked failed before downstream patch collection can run. This currently blocks our automated development pipeline. Happy to provide workflow/run details if useful. |
Summary\n\nWrap the Codex execution step in GitHub Actions command suppression with a unique per-run token, then restore processing after the child exits. The action retains Codex's original exit code.\n\nThis prevents Codex tool and model output such as
##[add-matcher]or::warning::from being executed by the GitHub runner as workflow commands.\n\nFixes #175.\n\n## Validation\n\n-corepack pnpm run check\n-corepack pnpm run build\n-node --test --test-name-pattern='Codex output cannot be interpreted' test/actionHardening.test.mjs\n-git diff --check\n\nThe complete test suite was started but its existing Linux process-isolation test does not complete in this sandbox.