Skip to content

Commit 7a8978c

Browse files
huntharoclaude
andcommitted
fix(ce-work-beta): add explicit stdin piping guidance for Codex delegation
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>
1 parent b5dc9b0 commit 7a8978c

2 files changed

Lines changed: 54 additions & 1 deletion

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: "fix: add explicit stdin piping guidance for Codex delegation"
3+
type: fix
4+
status: active
5+
date: 2026-03-24
6+
---
7+
8+
# fix: add explicit stdin piping guidance for Codex delegation
9+
10+
## Problem
11+
12+
When ce:work-beta delegates to Codex CLI, the skill says "piping the prompt file via stdin" but provides no concrete command example. The agent interprets this as a shell redirect:
13+
14+
```bash
15+
codex --dangerously-bypass-approvals-and-sandbox < /tmp/codex_task_20980.txt 2>&1
16+
```
17+
18+
This fails with:
19+
20+
```
21+
Error: Exit code 1
22+
Error: stdin is not a terminal
23+
```
24+
25+
Codex CLI checks whether stdin is a terminal (likely `isatty()`) and rejects shell redirects (`< file`). A pipe (`cat file | codex`) works because it presents data differently to the process.
26+
27+
## Approach
28+
29+
In step 5 ("Delegate") of the External Delegate Mode section in `ce-work-beta/SKILL.md`, add:
30+
31+
1. A concrete command example using `cat file | codex ...`
32+
2. An explicit warning that `< file` (shell redirect) does NOT work -- Codex rejects it with "stdin is not a terminal"
33+
3. Keep the existing note about avoiding argv expansion for large prompts
34+
35+
## Files
36+
37+
- `plugins/compound-engineering/skills/ce-work-beta/SKILL.md` -- step 5 of External Delegate Mode
38+
39+
## Acceptance Criteria
40+
41+
- [ ] Step 5 contains a concrete `cat ... | codex exec ...` command example with placeholder flags from step 2
42+
- [ ] Explicit warning: shell redirects (`< file`) fail with "stdin is not a terminal"
43+
- [ ] Existing guidance about avoiding argv expansion is preserved

plugins/compound-engineering/skills/ce-work-beta/SKILL.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,17 @@ When external delegation is active, follow this workflow for each tagged task. D
472472
473473
3. **Write prompt to file** — Save the assembled prompt to a unique temporary file to avoid shell quoting issues and cross-task races. Use a unique filename per task.
474474
475-
4. **Delegate** — Run the delegate CLI, piping the prompt file via stdin (not argv expansion, which hits `ARG_MAX` on large prompts). Omit the model flag to use the delegate's default model, which stays current without manual updates.
475+
4. **Delegate** — Run the delegate CLI, piping the prompt file via stdin. Omit the model flag to use the delegate's default model, which stays current without manual updates.
476+
477+
**Use `cat ... | codex`, not shell redirects.** Codex CLI rejects `< file` with "stdin is not a terminal". Always pipe:
478+
479+
```bash
480+
cat /tmp/codex-task-XXXXX.txt | codex exec --approval-mode full-auto --quiet 2>&1
481+
```
482+
483+
Do not use: `codex exec ... < /tmp/codex-task-XXXXX.txt` (fails immediately).
484+
485+
Piping also avoids `ARG_MAX` limits that would occur if passing the prompt as a CLI argument.
476486
477487
5. **Review diff** — After the delegate finishes, verify the diff is non-empty and in-scope. Run the project's test/lint commands. If the diff is empty or out-of-scope, fall back to standard mode for that task.
478488

0 commit comments

Comments
 (0)