Skip to content

fix: detach Responses proxy stdio on container runners - #143

Open
sylvesterkaczmarek wants to merge 2 commits into
openai:mainfrom
sylvesterkaczmarek:fix/arc-proxy-stdio
Open

fix: detach Responses proxy stdio on container runners#143
sylvesterkaczmarek wants to merge 2 commits into
openai:mainfrom
sylvesterkaczmarek:fix/arc-proxy-stdio

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Summary

Detach the long-lived Responses API proxy from the GitHub Actions step stdout/stderr stream so container-based runners such as ARC do not keep the step transport open after Bash exits.

Fixes #108.

Problem

Start Responses API proxy currently backgrounds the proxy without redirecting its output:

(
  printenv PROXY_API_KEY | env -u PROXY_API_KEY "${args[@]}"
) &

On ordinary GitHub-hosted runners, that background process can outlive the shell without blocking the next step.

On container runners that execute steps through a persistent exec/WebSocket transport, the proxy inherits the step's stdout/stderr file descriptors. The shell exits, but the long-lived proxy keeps those descriptors open, so the runner can treat the step transport as still active and eventually time out before the next step starts.

Fix

Redirect the proxy's stdout and stderr to a per-run log under runner.temp before backgrounding it:

) >>"$PROXY_LOG_FILE" 2>&1 &

The log path is:

${{ runner.temp }}/codex-responses-api-proxy-${{ github.run_id }}.log

This removes the inherited step-stream descriptors while preserving diagnostics.

If the proxy never writes its server-info file, the existing wait step now prints the detached proxy log to stderr before failing, so startup errors remain visible.

Why no disown

The failure mode in #108 is the inherited stdout/stderr transport, not Bash job-table ownership. The action already backgrounds the process successfully on current runners. Redirecting those descriptors addresses the container-exec hang without adding shell job-control assumptions.

Regression coverage

Added a focused Node-stdlib manifest test that verifies:

  • the background proxy invocation redirects both stdout and stderr to the per-run log;
  • the log path is rooted in runner.temp and scoped by github.run_id;
  • proxy startup failure emits the detached log before exiting.

Validation

  • branch is based directly on current upstream main (c385816875cc2fc8e033ed9d1cba96f8c331210e);
  • branch is 0 commits behind upstream;
  • production diff is 7 additions / 1 deletion in action.yml;
  • no files under src/ change, so the checked-in dist/main.js bundle remains valid.

Risk

Low. Proxy lifetime, API-key handling, server-info format, port selection, and upstream endpoint behavior are unchanged. The only runtime change is where the background proxy writes stdout/stderr.

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.

Responses API proxy hangs when using ARC runners with k8s

1 participant