mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
app-server: preserve legacy cwd strings in exec events
This commit is contained in:
@@ -194,7 +194,8 @@ async fn windows_exec_server_runs_with_native_shell_and_cwd() -> Result<()> {
|
||||
assert_eq!(&begin.command[1..], ["-NoProfile", "-Command", COMMAND]);
|
||||
|
||||
let end = end.context("exec_command should emit an end event")?;
|
||||
let expected_cwd = PathUri::parse("file:///C:/windows")?;
|
||||
let expected_cwd: LegacyAppPathString =
|
||||
PathUri::parse("file:///C:/windows")?.into();
|
||||
assert_eq!((&begin.cwd, &end.cwd), (&expected_cwd, &expected_cwd));
|
||||
assert_eq!((end.exit_code, end.status), (0, ExecCommandStatus::Completed));
|
||||
|
||||
|
||||
@@ -437,7 +437,10 @@ async fn unified_exec_emits_exec_command_begin_event() -> Result<()> {
|
||||
|
||||
assert_command(&begin_event.command, "-lc", "/bin/echo hello unified exec");
|
||||
|
||||
assert_eq!(begin_event.cwd, PathUri::from_host_native_path(&cwd)?);
|
||||
assert_eq!(
|
||||
begin_event.cwd,
|
||||
PathUri::from_host_native_path(&cwd)?.into()
|
||||
);
|
||||
|
||||
wait_for_event(&test.codex, |event| {
|
||||
matches!(event, EventMsg::TurnComplete(_))
|
||||
@@ -508,7 +511,7 @@ async fn unified_exec_resolves_relative_workdir() -> Result<()> {
|
||||
|
||||
assert_eq!(
|
||||
begin_event.cwd,
|
||||
PathUri::from_host_native_path(&workdir)?,
|
||||
PathUri::from_host_native_path(&workdir)?.into(),
|
||||
"exec_command cwd should resolve relative workdir against turn cwd",
|
||||
);
|
||||
|
||||
@@ -570,7 +573,7 @@ async fn unified_exec_respects_workdir_override() -> Result<()> {
|
||||
|
||||
assert_eq!(
|
||||
begin_event.cwd,
|
||||
PathUri::from_host_native_path(&workdir)?,
|
||||
PathUri::from_host_native_path(&workdir)?.into(),
|
||||
"exec_command cwd should reflect the requested workdir override"
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user