codex: fix cwd AbsolutePathBuf callers

This commit is contained in:
pakrym-oai
2026-04-06 22:41:14 -07:00
parent 9dc3e74051
commit 199d836011
11 changed files with 57 additions and 15 deletions
+4 -2
View File
@@ -19,6 +19,7 @@ use codex_protocol::permissions::NetworkSandboxPolicy;
use codex_sandboxing::landlock::create_linux_sandbox_command_args_for_policies;
#[cfg(target_os = "macos")]
use codex_sandboxing::seatbelt::create_seatbelt_command_args_for_policies;
use codex_utils_absolute_path::AbsolutePathBuf;
use codex_utils_cli::CliConfigOverrides;
use tokio::process::Child;
use tokio::process::Command as TokioCommand;
@@ -434,9 +435,10 @@ async fn build_debug_sandbox_config(
.cli_overrides(cli_overrides)
.harness_overrides(harness_overrides);
if let Some(codex_home) = codex_home {
let fallback_cwd = AbsolutePathBuf::relative_to_current_dir(&codex_home)?;
builder = builder
.codex_home(codex_home.clone())
.fallback_cwd(Some(codex_home));
.codex_home(codex_home)
.fallback_cwd(Some(fallback_cwd));
}
builder.build().await
}
+7 -1
View File
@@ -28,6 +28,7 @@ use codex_tui::AppExitInfo;
use codex_tui::Cli as TuiCli;
use codex_tui::ExitReason;
use codex_tui::update_action::UpdateAction;
use codex_utils_absolute_path::AbsolutePathBuf;
use codex_utils_cli::CliConfigOverrides;
use owo_colors::OwoColorize;
use std::io::IsTerminal;
@@ -1143,12 +1144,17 @@ async fn run_debug_prompt_input_command(
} else {
interactive.sandbox_mode.map(Into::into)
};
let cwd = interactive
.cwd
.as_deref()
.map(AbsolutePathBuf::relative_to_current_dir)
.transpose()?;
let overrides = ConfigOverrides {
model: interactive.model,
config_profile: interactive.config_profile,
approval_policy,
sandbox_mode,
cwd: interactive.cwd,
cwd,
codex_self_exe: arg0_paths.codex_self_exe,
codex_linux_sandbox_exe: arg0_paths.codex_linux_sandbox_exe,
main_execve_wrapper_exe: arg0_paths.main_execve_wrapper_exe,