Skip to content

fix(codex): omit --sandbox on exec resume - #797

Merged
currentbits merged 1 commit into
mainfrom
coder/codex-resume-no-sandbox
Sep 1, 2026
Merged

currentbits merged 1 commit into
mainfrom
coder/codex-resume-no-sandbox

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Summary

Test plan

  • node --test electron/test/providers.test.js — resume argv has no --sandbox; fresh exec still has workspace-write
  • node --test electron/test/codex.test.js — runner resume path omits --sandbox
  • After merge: recut nightly so the installed app picks up the argv fix
  • Retry a Codex follow-up turn (and codex update if gpt-5.6-sol still asks for a newer CLI)

Made with Cursor

Codex 0.152.0 accepts --sandbox on fresh exec but rejects it on resume, so every follow-up turn died with exit 2.

Co-authored-by: Cursor <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a0e106b34

ℹ️ 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".

Comment thread electron/providers.js
Comment on lines +386 to +387
if (!sessionId) {
args.push("--sandbox", codexSandboxFor(permissionMode));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Invalidate Codex sessions when the sandbox mode changes

When an existing Codex thread changes permission mode, Composer.pickMode and services.setPermissionMode update permissionMode without clearing sessionId; this branch then resumes the session while, as the preceding comment states, retaining its first-turn sandbox. A thread started with bypassPermissions therefore remains danger-full-access after the user selects Plan, even though the UI reports the read-only mode, and the inverse transition also remains unexpectedly restricted. Clear/restart the Codex session when the selected mode maps to a different sandbox, or otherwise ensure the resumed turn receives the newly selected policy.

Useful? React with 👍 / 👎.

@currentbits
currentbits merged commit d77e608 into main Sep 1, 2026
3 of 6 checks passed
@currentbits
currentbits deleted the coder/codex-resume-no-sandbox branch October 3, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant