mirror of
https://github.com/openai/codex.git
synced 2026-11-17 22:10:37 +00:00
Preserve native sandbox executable paths and PTY dispatch names (#61910)
## Why Sandbox helpers with non-UTF-8 paths can lose their exact executable path when converted into command requests. PTY launches with a custom `argv[0]` can also try to execute the dispatch name instead of the configured program. ## What changed - Carry native executable paths through sandbox requests, local execution, shell snapshots, and sandbox integrity checks. - Use native Unix PTY spawning when `argv[0]` differs from the executable, preserving the dispatch name and controlling terminal setup. - Preserve PTY executable lookup through the child environment's `PATH` and fallback to its home directory when the requested working directory is missing. ## Testing Add regression coverage for non-UTF-8 sandbox helper paths, PTY dispatch names, child `HOME`/`PATH` lookup, controlling terminals, and exit-code preservation. GitOrigin-RevId: 6a2af0486220d98195f5d67fde2597e3c4515e11
This commit is contained in:
@@ -416,7 +416,7 @@ async fn daemon_startup(command: &str) -> Result<()> {
|
||||
codex.clone()
|
||||
};
|
||||
let spawned = codex_utils_pty::spawn_pty_process(
|
||||
&program.to_string_lossy(),
|
||||
program.as_os_str(),
|
||||
&args,
|
||||
&workspace_path,
|
||||
&env,
|
||||
|
||||
@@ -81,7 +81,7 @@ async fn rejected_start(
|
||||
expected: &str,
|
||||
) -> anyhow::Result<String> {
|
||||
let spawned = codex_utils_pty::spawn_pty_process(
|
||||
&program.to_string_lossy(),
|
||||
program.as_os_str(),
|
||||
args,
|
||||
cwd,
|
||||
env,
|
||||
@@ -443,7 +443,7 @@ trust_level = "trusted"
|
||||
assert!(!home.join("worktrees").exists());
|
||||
}
|
||||
let spawned = codex_utils_pty::spawn_pty_process(
|
||||
&program.to_string_lossy(),
|
||||
program.as_os_str(),
|
||||
&args,
|
||||
&launcher,
|
||||
&env,
|
||||
|
||||
Reference in New Issue
Block a user