fix(codex-rescue): append </dev/null to codex-companion task invocation#274
Open
hobaratio wants to merge 1 commit intoopenai:mainfrom
Open
fix(codex-rescue): append </dev/null to codex-companion task invocation#274hobaratio wants to merge 1 commit intoopenai:mainfrom
hobaratio wants to merge 1 commit intoopenai:mainfrom
Conversation
Without this redirect, the `node codex-companion.mjs task ...` Bash invocation can hang when stdin is left attached to the parent shell. This manifests in Claude Code as "Reading additional input from stdin..." errors that block long-running Codex dispatches at indeterminate points (post-fixture, post-commit, etc.) — the wrapper reports "completed" but the underlying node process never returns. Reproduced in two consecutive Codex dispatches (clod repo, 2026-04-27) where Codex correctly wrote all expected files + ran regression tests to PASS, then hung 30+ minutes before the would-be commit/push step. External `codex-companion.mjs status --json` confirmed the job was still listed as "running" with the node process attached. Killing the node process unblocked the hang; appending `</dev/null` to the invocation prevents it entirely. Patches both `agents/codex-rescue.md` (the agent template the rescue subagent follows) and `skills/codex-cli-runtime/SKILL.md` (the skill contract that documents the canonical helper invocation). Also adds a short rationale comment in each file so the redirect doesn't get removed in a future cleanup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Append
</dev/nullto thenode codex-companion.mjs task ...Bash invocation documented in:plugins/codex/agents/codex-rescue.mdplugins/codex/skills/codex-cli-runtime/SKILL.mdWithout this stdin redirect, the node process can hang when stdin is left attached to the parent shell. In Claude Code this surfaces as
Reading additional input from stdin...errors that block long-running Codex dispatches at indeterminate points (post-fixture, post-commit, etc.) — the wrapper reports "completed" but the underlying node process never returns to terminal state.Reproducer
Two consecutive Codex dispatches in a downstream repo (2026-04-27) where Codex:
codex-companion.mjs statusprogressPreview)git commit/git pushstepExternal
codex-companion.mjs status --jsonconfirmed the job was still listed as"status": "running"with the node process alive. Killing the process unblocked the hang and the partial work was visible on disk. Appending</dev/nullto the invocation in the local plugin cache prevented the hang on subsequent dispatches.Diff
Why this is safe
node codex-companion.mjs taskinvocation is a forwarder — it does not itself read from stdin meaningfully. The node child processes Codex spawns also do not depend on the parent's stdin being attached.</dev/nullredirect only affects the spawned process's stdin (any read returns EOF immediately). It does not affect arguments, env vars, output, or the parent shell.Test plan
--background) and foreground mode both unaffected by the redirectThe patch is minimal — two file edits, 5 lines added — and includes a short inline rationale so a future cleanup pass doesn't strip the redirect without context.