mirror of
https://github.com/openai/codex.git
synced 2026-11-13 06:45:07 +00:00
Propagate executor home directories into sandbox contexts (#41204)
## What changed - Report the executor's user home in environment metadata. - Cache the reported home on selected turn environments and include it in filesystem sandbox contexts, including `apply_patch` requests. - Preserve compatibility with executors that do not report a home directory. ## Testing - Cover local, remote, inherited, serialized, and `apply_patch` sandbox contexts. GitOrigin-RevId: ea65e68e33a80bc9bcfc7c53b1486ab944699470
This commit is contained in:
1 parent
5bf0ba3dd6
commit
d4d2b293b4
11 files changed
+73
-12
No files matched your search
@@ -9297,6 +9297,7 @@ async fn capability_discovery_uses_environment_permission_profile() {
|
||||
permissions: environment.permission_profile().clone().into(),
|
||||
cwd: Some(environment.cwd().clone()),
|
||||
workspace_roots: environment.workspace_roots().to_vec(),
|
||||
user_home_dir: environment.user_home_dir.clone(),
|
||||
temporary_directories: environment.temporary_directories.clone(),
|
||||
windows_sandbox_level: WindowsSandboxLevel::Elevated,
|
||||
windows_sandbox_private_desktop: false,
|
||||
|
||||
@@ -48,6 +48,8 @@ pub(crate) struct TurnEnvironment {
|
||||
pub(crate) selection: TurnEnvironmentSelection,
|
||||
pub(crate) config_origin: EnvironmentConfigOrigin,
|
||||
pub(crate) environment: Arc<Environment>,
|
||||
/// Cached from the selected executor; `None` means it did not report one.
|
||||
pub(crate) user_home_dir: Option<PathUri>,
|
||||
/// Cached from the selected executor; `None` means it did not report them.
|
||||
pub(crate) temporary_directories: Option<Vec<PathUri>>,
|
||||
pub(crate) shell: Option<shell::Shell>,
|
||||
@@ -67,6 +69,7 @@ impl TurnEnvironment {
|
||||
selection,
|
||||
config_origin,
|
||||
environment,
|
||||
user_home_dir: None,
|
||||
temporary_directories: None,
|
||||
shell,
|
||||
shell_snapshot: futures::future::ready(None).boxed().shared(),
|
||||
@@ -131,6 +134,7 @@ impl TurnEnvironment {
|
||||
permissions: permissions.into(),
|
||||
cwd: Some(self.cwd().clone()),
|
||||
workspace_roots: self.workspace_roots().to_vec(),
|
||||
user_home_dir: self.user_home_dir.clone(),
|
||||
temporary_directories: self.temporary_directories.clone(),
|
||||
windows_sandbox_level: executor_windows_sandbox_level(
|
||||
config.windows_sandbox_level,
|
||||
@@ -165,6 +169,7 @@ impl std::fmt::Debug for TurnEnvironment {
|
||||
.field("environment", &self.environment)
|
||||
.field("cwd", &self.selection.cwd)
|
||||
.field("workspace_roots", &self.config().workspace_roots)
|
||||
.field("user_home_dir", &self.user_home_dir)
|
||||
.field("temporary_directories", &self.temporary_directories)
|
||||
.field("shell", &self.shell)
|
||||
.field("config", self.config())
|
||||
|
||||
Reference in new issue
Block a user