fix(ce-work-beta): document Codex exec pitfalls for delegation#365
fix(ce-work-beta): document Codex exec pitfalls for delegation#365huntharo wants to merge 3 commits intoEveryInc:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f3094bab38
ℹ️ 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".
| 4. **Delegate** — Run `codex exec` with the prompt piped via stdin. Use `exec` (not bare `codex`) for non-interactive delegation. Omit the model flag to use the delegate's default model, which stays current without manual updates. | ||
|
|
||
| ```bash | ||
| cat /tmp/codex-task-XXXXX.txt | codex exec --skip-git-repo-check - 2>&1 |
There was a problem hiding this comment.
Avoid shell pipes in delegation command example
This adds cat /tmp/codex-task-XXXXX.txt | codex exec --skip-git-repo-check - 2>&1, but plugins/compound-engineering/AGENTS.md explicitly requires shell examples in skills to avoid chaining, pipes, and redirects. Because plugin skills are copied across platforms, this shell-specific pipeline can fail in runners that execute commands as argv (without shell parsing), causing the delegation step to break instead of running Codex. Please switch to a single-command invocation pattern that is compatible with the repo’s cross-platform skill rules.
Useful? React with 👍 / 👎.
…ation Codex CLI rejects shell redirects (`< file`) with "stdin is not a terminal". The delegation step said "pipe via stdin" but gave no concrete example, so the agent used a redirect instead. Add a concrete `cat file | codex exec ...` example and an explicit warning against `< file`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ation `codex exec` does not accept `--approval-mode` flag. When piping a prompt via stdin, use `codex --approval-mode full-auto --quiet` directly (no `exec` subcommand). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…alls Replace incorrect `codex --approval-mode` example with the tested working invocation: `cat file | codex exec --skip-git-repo-check - `. Add a pitfalls table documenting all five failure modes discovered during testing: shell redirects, bare codex vs exec, wrong flags, missing git repo check skip, and missing trailing dash for stdin. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
f3094ba to
eaeaa0e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eaeaa0e4be
ℹ️ 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 redirect `< file` instead of pipe | "stdin is not a terminal" | Use `cat file \| codex exec ...` | | ||
| | Bare `codex` instead of `codex exec` | Enters interactive mode, hangs | Use `codex exec` for non-interactive delegation | | ||
| | `--approval-mode` flag on `exec` | "unexpected argument" | `exec` has its own flags; `--approval-mode` is for bare `codex` only | |
There was a problem hiding this comment.
Use supported approval flag in Codex exec guidance
The new pitfalls row says to avoid --approval-mode on codex exec and implies that flag belongs to bare codex, but the current Codex CLI reference documents --ask-for-approval (not --approval-mode) and states global options apply to subcommands like codex exec. In non-interactive delegation flows, this guidance can push users toward an invalid flag or back to interactive codex, causing command failures/hangs instead of setting approval behavior correctly.
Useful? React with 👍 / 👎.
Summary
cat file | codex exec --skip-git-repo-check -example to the delegation step< file) → "stdin is not a terminal"codexinstead ofcodex exec→ enters interactive mode, hangs--approval-modeflag onexec→ "unexpected argument"-→ prompt not read from stdinTest plan
/ce:work-betawith a plan taggedexternal-delegateand verify the agent uses the documentedcat ... | codex exec --skip-git-repo-check -pattern--approval-modeonexec🤖 Generated with Claude Code