fix: preserve arg0 for PTY sandbox commands without relying on PATH
Unified exec PTY sessions under Seccomp were using arg0 as the program when spawning the PTY. For the codex-linux-sandbox case, this meant we were actually executing codex-linux-sandbox via PATH lookup instead of the configured codex_linux_sandbox_exe path.
Fix:
On Unix, creates a temporary directory, symlinks the real program to a filename derived from arg0 (i.e. codex-linux-sandbox), and uses that symlink as the command in CommandBuilder.
This preserves argv[0] for dispatch while always executing the configured program path, and falls back to the old behavior when program is not absolute or arg0 is unset.
@codex review
Codex Review: Didn't find any major issues. What shall we delve into next?
ℹ️ 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".