Skip to content

Keep remote exec commands native to the executor#29099

Merged
jif-oai merged 2 commits into
mainfrom
jif/remote-exec-native-argv
Jun 19, 2026
Merged

Keep remote exec commands native to the executor#29099
jif-oai merged 2 commits into
mainfrom
jif/remote-exec-native-argv

Conversation

@jif-oai

@jif-oai jif-oai commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remote unified-exec now sends the original command argv to exec-server instead of materializing the orchestrator's sandbox wrapper first.
  • Local unified-exec keeps the existing sandbox path unchanged.
  • Add a focused regression test for a macOS-selected sandbox producing plain remote argv.

Before:

macOS orchestrator -> /usr/bin/sandbox-exec ... -> Linux exec-server

After:

macOS orchestrator -> /bin/bash -lc pwd -> Linux exec-server

This is intentionally only the first cleanup step. Remote unified-exec commands are sent without a process sandbox until the targeted follow-ups below land. For the macOS-to-Linux path this is not a practical regression: the old sandboxed attempt failed before process launch because the Linux executor could not spawn macOS sandbox paths.

Targeted follow-ups

  1. Carry sandbox intent separately from argv.

    • Add an optional sandbox field to exec-server process params.
    • Reuse FileSystemSandboxContext rather than introducing a new sandbox model.
    • Carry managed-network enforcement as one explicit bit.
    • Keep argv plain.
  2. Apply that intent inside exec-server.

    • Add a small process-start adapter before LocalProcess::exec.
    • Reuse the existing codex-sandboxing SandboxManager and exec-server runtime paths.
    • Follow the same shape already used by exec-server filesystem sandboxing.
    • Do not duplicate or move the sandbox implementations.
  3. Report the sandbox actually used.

    • Return the executor-selected sandbox type from process/start.
    • Use that value in core for sandbox-denial detection and retry behavior.

End state

The orchestrator sends plain commands plus portable sandbox intent. The executor chooses and applies its own native sandbox: Linux executors use Linux sandboxing, macOS executors use Seatbelt, and Windows executors use Windows sandboxing. Concrete wrapper argv, helper paths, and sandbox env markers never cross the executor boundary.

@jif-oai
jif-oai requested a review from a team as a code owner June 19, 2026 14:22

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

Copy link
Copy Markdown
Contributor

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: 0b7660c330

ℹ️ 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 codex-rs/core/src/tools/sandboxing_tests.rs
Comment thread codex-rs/core/src/tools/runtimes/unified_exec.rs Outdated
@jif-oai
jif-oai enabled auto-merge (squash) June 19, 2026 14:57
@jif-oai

jif-oai commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

CI is unrelated and due to snapshot_rollback_past_compaction_replays_append_only_history

@jif-oai
jif-oai disabled auto-merge June 19, 2026 15:05
@jif-oai
jif-oai merged commit 04483f4 into main Jun 19, 2026
28 of 30 checks passed
@jif-oai
jif-oai deleted the jif/remote-exec-native-argv branch June 19, 2026 15:05
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 19, 2026
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.

2 participants