[codex] Carry exec-server cwd as PathUri (#28032)

## Why

This is the second-to-last place in the exec-server protocol that needs
to migrate to URIs to support cross-OS operation.

## What

- Change `ExecParams.cwd` to `PathUri`.
- Keep the cwd URI-shaped through core and rmcp producers, converting it
to `AbsolutePathBuf` only in `LocalProcess::start_process`.
- Reject non-native cwd URIs before launch and update the affected
protocol documentation and call sites.
This commit is contained in:
Adam Perry @ OpenAI
2026-06-13 20:56:42 +00:00
committed by GitHub
parent 17586d80ee
commit 0fed4497f5
13 changed files with 84 additions and 85 deletions
+6 -3
View File
@@ -1,5 +1,4 @@
use std::collections::HashMap;
use std::path::PathBuf;
use crate::FileSystemSandboxContext;
use base64::engine::general_purpose::STANDARD as BASE64_STANDARD;
@@ -77,7 +76,8 @@ pub struct EnvironmentInfo {
pub struct ShellInfo {
/// Stable shell name, for example `zsh`, `bash`, `powershell`, `sh`, or `cmd`.
pub name: String,
/// Path the exec server would use for that shell.
/// Target-native shell executable path or command name. Fallbacks such as `cmd.exe` need not
/// be absolute, so this is not a [`PathUri`].
pub path: String,
}
@@ -88,7 +88,8 @@ pub struct ExecParams {
/// This is a protocol key, not an OS pid.
pub process_id: ProcessId,
pub argv: Vec<String>,
pub cwd: PathBuf,
/// Working directory URI, interpreted using the exec-server host's path rules at launch time.
pub cwd: PathUri,
#[serde(default)]
pub env_policy: Option<ExecEnvPolicy>,
pub env: HashMap<String, String>,
@@ -96,6 +97,8 @@ pub struct ExecParams {
/// Keep non-tty stdin writable through `process/write`.
#[serde(default)]
pub pipe_stdin: bool,
/// Optional process-visible argv0 override. Values such as `codex-linux-sandbox` are command
/// names rather than paths, so this is not a [`PathUri`].
pub arg0: Option<String>,
}