Skip to content

codex: docs and comments say codex exec exits 0 on a failed or interrupted turn; it exits 1 #9942

Done

Description

@dhshah13

The contributing guide and three code comments say codex exec exits 0 on a failed or interrupted turn. At the pinned 0.170.0 it exits 1 on both.

The image pins codex 0.170.0 (Containerfile:274). In codex-rs/exec/src/lib.rs at rust-v0.170.0, a primary turn that completes as Failed or Interrupted sets error_seen (L1429-L1439), and exec then exits 1 (L1484-L1486). rust-v0.172.0 is the same (L1538-L1548, L1600-L1602). The check came in openai/codex@45f6884, first released in rust-v0.117.0, before the first fullsend pin (0.152.1).

Lines that say otherwise, at cca0379:

No code depends on the claim. Run returns 1 for a stream that ends in an error whether codex exits 0 or 1 (codex_run.go:744-752). The stream verdict is still needed: exec exits 0 when its event stream closes before the turn completes and no error was reported (L1412-L1414, L1484-L1488). The claim already produced a wrong review finding on #8569 (comment). #8836 corrected the same claim in the Run comment and in docs/runtimes/codex.md; it did not change these four lines.

Fix: reword the four lines. Codex exits 1 on a failed or interrupted turn. It can exit 0 when its event stream closes before the turn completes, and the stream verdict covers that case. No code change.

Activity

  1. fullsend-ai-triage commented on Nov 30, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 2:26 PM UTC · Completed 2:28 PM UTC

    Commit: cca0379 · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.10

  2. added
    priority/low
    component/runner
    ready-to-code
    on Nov 30, 2026
  3. fullsend-ai-triage commented on Nov 30, 2026

    @fullsend-ai-triage

    Triage found this is a documentation/comment-only fix. The four cited locations are still present at the current HEAD with the stale wording, and the image still pins codex 0.170.0. No open PR or duplicate issue was found.

    Scope note: the upstream codex source references were taken from the report and not independently re-checked. The proposed wording (exit 1 on failed or interrupted turn; exit 0 possible when the stream closes early, covered by the stream verdict) is conservative either way.

    Proposed test case:

    No new test. Run `go test ./internal/runtime/...` to confirm the comment edits compile and
    existing tests pass, in particular TestCodexRun_StreamVerdictOverridesExitZero (fake exits 0,
    run must still be reported as failed). Then grep for the old phrasing to confirm none remains.
    

    Labels: Documentation-only correction of stale docs and code comments, with low impact since no runtime behavior depends on the claim.


    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
  4. fullsend-ai-coder commented on Nov 30, 2026

    @fullsend-ai-coder
    Contributor

    🤖 Finished Code · ✅ Success · Started 2:30 PM UTC · Completed 2:38 PM UTC

    Commit: cca0379 · View workflow run →

    Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $0.79

  5. added a commit that references this issue on Nov 30, 2026
  6. added 2 commits that reference this issue on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/runnerdocumentationpriority/lowready-to-code

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions