mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
unified-exec: retain PathUri in command events (#28780)
## Why App-server must report command events containing foreign-platform paths without changing existing client or rollout path-string formats. ## What changed - retain `PathUri` through exec command begin/end events - convert cwd values to `LegacyAppPathString` at the app-server compatibility boundary - drop command actions with foreign paths and log them - serialize rollout-trace cwd values using their inferred native path representation - restore Wine coverage for retained Windows cwd values and successful completion
This commit is contained in:
1 parent
285eff6c3e
commit
3931bc2bde
56 files changed
+566
-125
No files matched your search
@@ -0,0 +1,41 @@
|
||||
use super::*;
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
#[test]
|
||||
fn foreign_read_is_omitted_without_dropping_other_command_actions() {
|
||||
#[cfg(windows)]
|
||||
let cwd = PathUri::parse("file:///usr/local/src").expect("valid foreign POSIX cwd");
|
||||
#[cfg(not(windows))]
|
||||
let cwd = PathUri::parse("file:///C:/src").expect("valid foreign Windows cwd");
|
||||
let parsed_cmd = vec![
|
||||
ParsedCommand::Read {
|
||||
cmd: "cat file.txt".to_string(),
|
||||
name: "file.txt".to_string(),
|
||||
path: PathBuf::from("file.txt"),
|
||||
},
|
||||
ParsedCommand::ListFiles {
|
||||
cmd: "ls".to_string(),
|
||||
path: Some("subdir".to_string()),
|
||||
},
|
||||
ParsedCommand::Search {
|
||||
cmd: "rg needle".to_string(),
|
||||
query: Some("needle".to_string()),
|
||||
path: Some("src".to_string()),
|
||||
},
|
||||
];
|
||||
|
||||
assert_eq!(
|
||||
command_actions_for_path_uri(&parsed_cmd, &cwd),
|
||||
vec![
|
||||
CommandAction::ListFiles {
|
||||
command: "ls".to_string(),
|
||||
path: Some("subdir".to_string()),
|
||||
},
|
||||
CommandAction::Search {
|
||||
command: "rg needle".to_string(),
|
||||
query: Some("needle".to_string()),
|
||||
path: Some("src".to_string()),
|
||||
},
|
||||
]
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user