app-server: preserve legacy cwd strings in exec events

This commit is contained in:
Adam Perry
2026-06-23 01:35:47 +00:00
parent 67009bc53f
commit 1544a003db
10 changed files with 90 additions and 31 deletions
@@ -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));
+6 -3
View File
@@ -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"
);