Skip to content

Preserve saved sandbox permissions when resuming codex exec - #62194

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/ed2cf3132f9ce34570661f801c9534a55696e3a5
Nov 18, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/ed2cf3132f9ce34570661f801c9534a55696e3a5

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Preserve saved sandbox permissions when resuming codex exec

Why

codex exec resume sends the current process's sandbox defaults as
overrides. A session started with :read-only can therefore resume with
workspace write access when the configured default is :workspace.

What changed

  • Restore the saved permission selection, working directory, and workspace
    roots by default. Honor explicit overrides and append directories requested
    with --add-dir to the resumed workspace roots.
  • Recover built-in read-only permissions from older history without widening
    current read access. Require an explicit permission selection when a saved
    named profile cannot be loaded or saved read-only access cannot be restored.
  • Report sandbox permissions and writable roots from the running thread.

Testing

Add regression coverage for a denied write on the first resumed shell call,
legacy read-only history, explicit permission overrides, and workspace root
preservation with and without --add-dir.

## Why

`codex exec resume` sends the current process's sandbox defaults as
overrides. A session started with `:read-only` can therefore resume with
workspace write access when the configured default is `:workspace`.

## What changed

- Restore the saved permission selection, working directory, and workspace
  roots by default. Honor explicit overrides and append directories requested
  with `--add-dir` to the resumed workspace roots.
- Recover built-in read-only permissions from older history without widening
  current read access. Require an explicit permission selection when a saved
  named profile cannot be loaded or saved read-only access cannot be restored.
- Report sandbox permissions and writable roots from the running thread.

## Testing

Add regression coverage for a denied write on the first resumed shell call,
legacy read-only history, explicit permission overrides, and workspace root
preservation with and without `--add-dir`.

GitOrigin-RevId: ed2cf3132f9ce34570661f801c9534a55696e3a5
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/ed2cf3132f9ce34570661f801c9534a55696e3a5 branch from 36bb49f to 89feadf Compare November 18, 2026 05:14
@copyberry
copyberry Bot merged commit 89feadf into main Nov 18, 2026
11 of 23 checks passed
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor
Codex Review Summary: 🔄 Running

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-18T05:14:24.048398Z 36bb49f PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/ed2cf3132f9ce34570661f801c9534a55696e3a5 branch November 18, 2026 05:14
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 18, 2026

This branch was previously deployed

1 inactive deployment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants