mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
codex: fix cwd AbsolutePathBuf callers
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user