mirror of
https://github.com/openai/codex.git
synced 2026-05-04 21:32:21 +03:00
[bazel] Enable windows builds?
This commit is contained in:
@@ -58,23 +58,21 @@ async fn test_shell_command_approval_triggers_elicitation() {
|
||||
async fn shell_command_approval_triggers_elicitation() -> anyhow::Result<()> {
|
||||
// Use a simple, untrusted command that creates a file so we can
|
||||
// observe a side-effect.
|
||||
//
|
||||
// Cross‑platform approach: run a tiny Python snippet to touch the file
|
||||
// using `python3 -c ...` on all platforms.
|
||||
let workdir_for_shell_function_call = TempDir::new()?;
|
||||
let created_filename = "created_by_shell_tool.txt";
|
||||
let created_file = workdir_for_shell_function_call
|
||||
.path()
|
||||
.join(created_filename);
|
||||
|
||||
let shell_command = vec![
|
||||
"python3".to_string(),
|
||||
"-c".to_string(),
|
||||
format!("import pathlib; pathlib.Path('{created_filename}').touch()"),
|
||||
];
|
||||
let expected_shell_command = format_with_current_shell(&format!(
|
||||
"python3 -c \"import pathlib; pathlib.Path('{created_filename}').touch()\""
|
||||
));
|
||||
let (shell_command, expected_shell_command) = if cfg!(windows) {
|
||||
let command = format!("New-Item -ItemType File -Path {created_filename} -Force");
|
||||
(vec![command.clone()], format_with_current_shell(&command))
|
||||
} else {
|
||||
let command = format!("import pathlib; pathlib.Path('{created_filename}').touch()");
|
||||
(
|
||||
vec!["python3".to_string(), "-c".to_string(), command.clone()],
|
||||
format_with_current_shell(&format!("python3 -c \"{command}\"")),
|
||||
)
|
||||
};
|
||||
|
||||
let McpHandle {
|
||||
process: mut mcp_process,
|
||||
|
||||
Reference in New Issue
Block a user