mirror of
https://github.com/openai/codex.git
synced 2026-11-03 08:22:30 +00:00
Spread AbsolutePathBuf (#17792)
Mechanical change to promote absolute paths through code.
This commit is contained in:
1 parent
dae56994da
commit
dd1321d11b
166 files changed
+1638
-1214
No files matched your search
@@ -1061,8 +1061,9 @@ mod tests {
|
||||
use codex_protocol::protocol::SessionSource;
|
||||
use codex_protocol::protocol::TurnAbortReason;
|
||||
use codex_protocol::protocol::TurnAbortedEvent;
|
||||
use codex_utils_absolute_path::test_support::PathBufExt;
|
||||
use codex_utils_absolute_path::test_support::test_path_buf;
|
||||
use pretty_assertions::assert_eq;
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[test]
|
||||
fn bridges_completed_agent_messages_from_server_notifications() {
|
||||
@@ -1160,7 +1161,7 @@ mod tests {
|
||||
let item = ThreadItem::CommandExecution {
|
||||
id: "cmd-1".to_string(),
|
||||
command: "printf 'hello world\\n'".to_string(),
|
||||
cwd: PathBuf::from("/tmp"),
|
||||
cwd: test_path_buf("/tmp").abs(),
|
||||
process_id: None,
|
||||
source: CommandExecutionSource::UserShell,
|
||||
status: CommandExecutionStatus::InProgress,
|
||||
@@ -1191,7 +1192,7 @@ mod tests {
|
||||
begin.command,
|
||||
vec!["printf".to_string(), "hello world\\n".to_string()]
|
||||
);
|
||||
assert_eq!(begin.cwd, PathBuf::from("/tmp"));
|
||||
assert_eq!(begin.cwd.as_path(), test_path_buf("/tmp").as_path());
|
||||
assert_eq!(begin.source, ExecCommandSource::UserShell);
|
||||
|
||||
let (_, delta_events) =
|
||||
@@ -1216,7 +1217,7 @@ mod tests {
|
||||
let completed_item = ThreadItem::CommandExecution {
|
||||
id: "cmd-1".to_string(),
|
||||
command: "printf 'hello world\\n'".to_string(),
|
||||
cwd: PathBuf::from("/tmp"),
|
||||
cwd: test_path_buf("/tmp").abs(),
|
||||
process_id: None,
|
||||
source: CommandExecutionSource::UserShell,
|
||||
status: CommandExecutionStatus::Completed,
|
||||
@@ -1253,7 +1254,7 @@ mod tests {
|
||||
let item = ThreadItem::CommandExecution {
|
||||
id: "cmd-1".to_string(),
|
||||
command: r#"C:\Program Files\Git\bin\bash.exe -lc "echo hi""#.to_string(),
|
||||
cwd: PathBuf::from("C:\\repo"),
|
||||
cwd: test_path_buf("/tmp").abs(),
|
||||
process_id: None,
|
||||
source: CommandExecutionSource::UserShell,
|
||||
status: CommandExecutionStatus::InProgress,
|
||||
@@ -1289,7 +1290,7 @@ mod tests {
|
||||
updated_at: 1,
|
||||
status: ThreadStatus::Idle,
|
||||
path: None,
|
||||
cwd: PathBuf::from("/tmp"),
|
||||
cwd: test_path_buf("/tmp").abs(),
|
||||
cli_version: "test".to_string(),
|
||||
source: SessionSource::Cli.into(),
|
||||
agent_nickname: None,
|
||||
@@ -1301,7 +1302,7 @@ mod tests {
|
||||
items: vec![ThreadItem::CommandExecution {
|
||||
id: "cmd-1".to_string(),
|
||||
command: "printf 'hello world\\n'".to_string(),
|
||||
cwd: PathBuf::from("/tmp"),
|
||||
cwd: test_path_buf("/tmp").abs(),
|
||||
process_id: None,
|
||||
source: CommandExecutionSource::UserShell,
|
||||
status: CommandExecutionStatus::Completed,
|
||||
@@ -1465,7 +1466,7 @@ mod tests {
|
||||
updated_at: 0,
|
||||
status: ThreadStatus::Idle,
|
||||
path: None,
|
||||
cwd: PathBuf::from("/tmp/project"),
|
||||
cwd: test_path_buf("/tmp/project").abs(),
|
||||
cli_version: "test".to_string(),
|
||||
source: SessionSource::Cli.into(),
|
||||
agent_nickname: None,
|
||||
|
||||
@@ -105,8 +105,9 @@ mod tests {
|
||||
use codex_app_server_protocol::ThreadStatus;
|
||||
use codex_protocol::ThreadId;
|
||||
use codex_protocol::protocol::SubAgentSource;
|
||||
use codex_utils_absolute_path::test_support::PathBufExt;
|
||||
use codex_utils_absolute_path::test_support::test_path_buf;
|
||||
use pretty_assertions::assert_eq;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn test_thread(thread_id: ThreadId, source: SessionSource) -> Thread {
|
||||
Thread {
|
||||
@@ -119,7 +120,7 @@ mod tests {
|
||||
updated_at: 0,
|
||||
status: ThreadStatus::Idle,
|
||||
path: None,
|
||||
cwd: PathBuf::from("/tmp"),
|
||||
cwd: test_path_buf("/tmp").abs(),
|
||||
cli_version: "0.0.0".to_string(),
|
||||
source,
|
||||
agent_nickname: None,
|
||||
|
||||
@@ -592,10 +592,11 @@ mod tests {
|
||||
use codex_app_server_protocol::TurnStatus;
|
||||
use codex_protocol::protocol::Op;
|
||||
use codex_protocol::protocol::ReviewDecision;
|
||||
use codex_utils_absolute_path::test_support::PathBufExt;
|
||||
use codex_utils_absolute_path::test_support::test_path_buf;
|
||||
use pretty_assertions::assert_eq;
|
||||
use std::collections::BTreeMap;
|
||||
use std::collections::HashMap;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn request_user_input_request(call_id: &str, turn_id: &str) -> ServerRequest {
|
||||
ServerRequest::ToolRequestUserInput {
|
||||
@@ -624,7 +625,7 @@ mod tests {
|
||||
reason: None,
|
||||
network_approval_context: None,
|
||||
command: Some("echo hi".to_string()),
|
||||
cwd: Some(PathBuf::from("/tmp")),
|
||||
cwd: Some(test_path_buf("/tmp").abs()),
|
||||
command_actions: None,
|
||||
additional_permissions: None,
|
||||
proposed_execpolicy_amendment: None,
|
||||
|
||||
Reference in new issue
Block a user