Stale server-info files can make later action invocations reuse a dead Responses proxy
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 170
- PR merge metrics
- No merged PRs in 30d
Description
Summary
Check Responses API proxy status currently treats any non-empty server-info file as proof that the Responses API proxy is still running.
The proxy's server-info format already includes both port and pid, but the action only checks -s "$SERVER_INFO_FILE". If the proxy exits unexpectedly while the JSON file remains, a later codex-action invocation in the same GitHub run skips proxy startup and reuses the stale port.
Reproduction
- Run
openai/codex-actionwith an API key so the proxy writes$CODEX_HOME/$GITHUB_RUN_ID.json. - Terminate the
codex-responses-api-proxyprocess without deleting its server-info file, or reproduce any proxy crash after startup. - Invoke
openai/codex-actionagain in the same run with the same Codex home.
Current status logic is:
if [ -s "$SERVER_INFO_FILE" ]; then
echo "Responses API proxy already appears to be running (found $SERVER_INFO_FILE)."
echo "server_info_file_exists=true" >> "$GITHUB_OUTPUT"
else
echo "server_info_file_exists=false" >> "$GITHUB_OUTPUT"
fi
The second invocation therefore skips Start Responses API proxy. Read server info can still read the stale JSON successfully, so Codex is configured with a loopback port where no proxy is listening.
Expected behavior
A server-info file should only be reused when the process identified by its recorded pid is still alive. A missing, malformed, or dead PID should make the file stale so the action can remove it and start a fresh proxy.
Suggested fix
Move the status logic into a small testable helper that:
- returns
server_info_file_exists=falsewhen the file is absent or empty; - parses the recorded
pidfrom the JSON; - on Unix, uses
kill -0to verify the process exists before reusing the file; - removes stale server-info files before reporting
false; - preserves the current file-only behaviour on Windows if there is no reliable equivalent check in the existing Bash environment.
Impact
This is a retry/reuse reliability issue. A proxy crash can poison the server-info path for subsequent action invocations and produce a misleading downstream connection failure instead of starting a fresh proxy.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Check Responses API proxy status step and trace how it interacts with Start Responses API proxy and Read server info; the payload does not name source or test files. Exercise the helper with absent, malformed, live, and dead-PID server-info files, and verify stale files are removed, fresh proxies start, and Windows retains file-only behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, github-actions
- Domain
- ci-cd
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100