Build remote exec env from exec-server policy#17216
Merged
Merged
Conversation
Add an exec-server env policy contract and send only the env overlay needed for runtime/sandbox transforms when Core starts remote unified-exec processes. Keep local process startup on the existing exact-env path, and share the shell-environment-policy builder from codex-config so the executor can apply the same inherit/filter/set/include rules against its own process environment. Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
…nto codex/remote-exec-env-overlay
Co-authored-by: Codex <noreply@openai.com>
starr-openai
approved these changes
Apr 10, 2026
This reverts commit 05f23ae.
Restore remote exec env CI fixes after the merge. Co-authored-by: Codex <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
envPolicyfield; when present, the server starts from its own process env and applies the shell environment policy thereenvas the exact environment for local/embedded starts, but make it an overlay for remote unified-exec startscodex-configso Core and exec-server share the inherit/filter/set/include behaviorWhy
Remote unified exec was materializing the shell env inside Core and forwarding the whole map to exec-server, so remote processes could inherit the orchestrator machine's
HOME,PATH, etc. This keeps the base env on the executor while preserving Core-owned runtime additions likeCODEX_THREAD_ID, unified-exec defaults, network proxy env, and sandbox marker env.Validation
just fmtgit diff --checkcargo test -p codex-exec-server --libcargo test -p codex-core --lib unified_exec::process_manager::testscargo test -p codex-core --lib exec_env::testscargo test -p codex-core --lib exec_env_tests(compile-only; filter matched 0 tests)cargo test -p codex-config --lib shell_environment(compile-only; filter matched 0 tests)just bazel-lock-updateKnown local validation issue
just bazel-lock-checkis not runnable in this checkout: it invokes./scripts/check-module-bazel-lock.sh, which is missing.