Codex engineer launch fails when prompt begins with dash-prefixed pre-flight text #1499

Closed
opened 2026-07-22 08:44:36 +00:00 by coilyco-ops · 2 comments
Member

Codex engineer runs are failing before the agent starts because Ward invokes codex exec <prompt> without a -- separator. The seeded prompt begins with ----- launch pre-flight -----, so the current Codex CLI parses it as an unexpected argument / option-shaped value and exits with usage error 2.

Observed on 2026-07-22 from read-only director surface director-codex-vy89 while dispatching #1497 and #1498:

  • engineer-codex-ward-1497 and engineer-codex-ward-1498 containers were created and exited after ~10s with Docker exit code 0.
  • The in-container harness exit was non-zero: agent exited non-zero (exit status 2); reaping anyway.
  • Codex CLI error excerpt:
ward-container: one-shot: codex exec <prompt> (prints to this log)
ward-container: launch start: stream=false oneshot=true work=/workspace/ward
error: unexpected argument '----- launch pre-flight ----- ...' found\n\n  tip: to pass '----- launch pre-flight ----- ...' as a value, use '-- ----- launch pre-flight ----- ...'\n\nUsage: codex exec [OPTIONS] [PROMPT]\n       codex exec [OPTIONS] <COMMAND> [ARGS]\n```\n\n- Docker state still reports container exit code 0 because the bootstrap/reaper path exits cleanly after the failed harness.\n- The issue thread only has the reservation comment, no `WARDED_WORKFLOW: failed` outcome.\n- `ward agent list --repo coilyco-flight-deck/ward` shows the records as `cleanup-needed`, while `ward agent dispatch-health --repo coilyco-flight-deck/ward` reports no cleanup-needed/failed-before-start state.\n- The reaper printed `WARD-REAP: nothing to reap (workflow pull-request-and-merge boundary reached: branch pushed, pull request open, and required CI checks are green)` even though no branch was pushed and no PR existed for the failed run.\n\nScope:\n\n- Fix the Codex launch argv so prompt-mode invocation uses `codex exec -- <prompt>` or equivalent, and add a regression test where the prompt starts with `-----`.\n- Ensure a pre-agent Codex CLI usage failure is surfaced as a failed launch/outcome, not as a successful container exit.\n- Ensure pull-request-and-merge reaper wording cannot claim branch/PR/green checks when none exists.\n- Make `ward agent list` and `ward agent dispatch-health` agree on failed-before-start / cleanup-needed records for this shape.\n- Leave #1497 and #1498 to be redispatched after this launch-path bug lands.\n\nRelated: #1497, #1498, #1470, #1469.
Codex engineer runs are failing before the agent starts because Ward invokes `codex exec <prompt>` without a `--` separator. The seeded prompt begins with `----- launch pre-flight -----`, so the current Codex CLI parses it as an unexpected argument / option-shaped value and exits with usage error 2. Observed on 2026-07-22 from read-only director surface `director-codex-vy89` while dispatching #1497 and #1498: - `engineer-codex-ward-1497` and `engineer-codex-ward-1498` containers were created and exited after ~10s with Docker exit code 0. - The in-container harness exit was non-zero: `agent exited non-zero (exit status 2); reaping anyway`. - Codex CLI error excerpt: ```text ward-container: one-shot: codex exec <prompt> (prints to this log) ward-container: launch start: stream=false oneshot=true work=/workspace/ward error: unexpected argument '----- launch pre-flight ----- ...' found\n\n tip: to pass '----- launch pre-flight ----- ...' as a value, use '-- ----- launch pre-flight ----- ...'\n\nUsage: codex exec [OPTIONS] [PROMPT]\n codex exec [OPTIONS] <COMMAND> [ARGS]\n```\n\n- Docker state still reports container exit code 0 because the bootstrap/reaper path exits cleanly after the failed harness.\n- The issue thread only has the reservation comment, no `WARDED_WORKFLOW: failed` outcome.\n- `ward agent list --repo coilyco-flight-deck/ward` shows the records as `cleanup-needed`, while `ward agent dispatch-health --repo coilyco-flight-deck/ward` reports no cleanup-needed/failed-before-start state.\n- The reaper printed `WARD-REAP: nothing to reap (workflow pull-request-and-merge boundary reached: branch pushed, pull request open, and required CI checks are green)` even though no branch was pushed and no PR existed for the failed run.\n\nScope:\n\n- Fix the Codex launch argv so prompt-mode invocation uses `codex exec -- <prompt>` or equivalent, and add a regression test where the prompt starts with `-----`.\n- Ensure a pre-agent Codex CLI usage failure is surfaced as a failed launch/outcome, not as a successful container exit.\n- Ensure pull-request-and-merge reaper wording cannot claim branch/PR/green checks when none exists.\n- Make `ward agent list` and `ward agent dispatch-health` agree on failed-before-start / cleanup-needed records for this shape.\n- Leave #1497 and #1498 to be redispatched after this launch-path bug lands.\n\nRelated: #1497, #1498, #1470, #1469.
Author
Member

Goose reproduces the same pre-agent launch failure, so this is broader than Codex. Dispatch command accepted for --harness goose, but the container logs show Ward invoking goose run --no-session -t <prompt>; Goose exits before agent startup with unexpected argument '----- launch pre-flight ----- ...' found and usage goose run --no-session. The container then exits through the same misleading WARD-REAP success wording even though no branch or PR exists. That points at the shared one-shot prompt argv/stdin construction, not a Codex-specific parser edge.

Goose reproduces the same pre-agent launch failure, so this is broader than Codex. Dispatch command accepted for `--harness goose`, but the container logs show Ward invoking `goose run --no-session -t <prompt>`; Goose exits before agent startup with `unexpected argument '----- launch pre-flight ----- ...' found` and usage `goose run --no-session`. The container then exits through the same misleading WARD-REAP success wording even though no branch or PR exists. That points at the shared one-shot prompt argv/stdin construction, not a Codex-specific parser edge.
Author
Member

WARD-WORKFLOW: reservation-released

release details

Run never started. ward container reap released container engineer-goose-ward-1499 (--harness goose): it exited without launching the agent (smoke-test death, ward#222/#264/#595), so it did no work and the launch intent it took is retracted. Nothing is running on this issue. It needs re-dispatch. A ward agent director re-queues it automatically. A manual ward agent retry no longer needs --override-reservation.

— Goose, via ward agent

<!-- ward-agent-reservation-released --> <!-- ward-needs-redispatch --> WARD-WORKFLOW: reservation-released <details><summary>release details</summary> Run never started. `ward container reap` released container `engineer-goose-ward-1499` (`--harness goose`): it exited without launching the agent (smoke-test death, ward#222/#264/#595), so it did no work and the launch intent it took is retracted. Nothing is running on this issue. It needs re-dispatch. A `ward agent director` re-queues it automatically. A manual `ward agent` retry no longer needs `--override-reservation`. </details> <!-- ward-agent-signature --> — Goose, via `ward agent`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-flight-deck/ward#1499
No description provided.