Skip to content

Codex exec resume rejects --sandbox; follow-up turns die (exit 2) #795

Closed

Description

@currentbits

Problem

Codex follow-up turns fail immediately with:

error: unexpected argument '--sandbox' found
Usage: codex exec resume --json --skip-git-repo-check --model <MODEL> --config <key=value> <SESSION_ID> [PROMPT]

Seen on Codex CLI 0.152.0 after a first turn that itself failed with gpt-5.6-sol requiring a newer Codex.

Root cause

electron/providers.js buildArgs always appends --sandbox <mode> (issue #170). Live CLI:

  • codex exec accepts -s, --sandbox (read-only | workspace-write | danger-full-access)
  • codex exec resume does not list --sandbox (only --dangerously-bypass-approvals-and-sandbox)

A nightly from origin/main (dc15acba / v0.17.0) cannot fix this; the argv is unchanged.

Fix

Omit --sandbox on the resume path. Fresh exec still passes it. Session inherits the first-turn sandbox policy.

Test

getProvider("codex").buildArgs({ sessionId }) must not include --sandbox. Fresh exec still maps permissionMode as today.

Activity

  1. added
    plan:done
    and removed
    plan:doing
    on Sep 1, 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

    plan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions