From 3d15de79b430f45a1d43c22b2ed8c20a126aa594 Mon Sep 17 00:00:00 2001 From: Adam Perry Date: Tue, 16 Jun 2026 18:41:31 +0000 Subject: [PATCH] chore: adapt instruction tests to current path api --- .../tests/suite/v2/thread_resume.rs | 11 ++----- codex-rs/core/src/agents_md_tests.rs | 33 +++++-------------- codex-rs/tui/src/app_server_session.rs | 6 ++-- 3 files changed, 15 insertions(+), 35 deletions(-) diff --git a/codex-rs/app-server/tests/suite/v2/thread_resume.rs b/codex-rs/app-server/tests/suite/v2/thread_resume.rs index a4a1e7a892..bfff35ec8b 100644 --- a/codex-rs/app-server/tests/suite/v2/thread_resume.rs +++ b/codex-rs/app-server/tests/suite/v2/thread_resume.rs @@ -80,6 +80,7 @@ use codex_rollout::append_rollout_item_to_path; use codex_rollout::read_session_meta_line; use codex_state::StateRuntime; use codex_utils_absolute_path::AbsolutePathBuf; +use codex_utils_path_uri::ApiPathString; use core_test_support::responses; use core_test_support::skip_if_no_network; use pretty_assertions::assert_eq; @@ -288,10 +289,7 @@ async fn thread_resume_running_thread_uses_cached_instruction_sources() -> Resul let project_agents = AbsolutePathBuf::try_from(project_agents)?; assert_eq!( instruction_sources, - vec![ApiPathString::from_abs_path( - &project_agents, - PathConvention::native(), - )?] + vec![ApiPathString::from_abs_path(&project_agents)] ); let turn_id = mcp @@ -336,10 +334,7 @@ async fn thread_resume_running_thread_uses_cached_instruction_sources() -> Resul assert_eq!( instruction_sources, - vec![ApiPathString::from_abs_path( - &project_agents, - PathConvention::native(), - )?] + vec![ApiPathString::from_abs_path(&project_agents)] ); Ok(()) diff --git a/codex-rs/core/src/agents_md_tests.rs b/codex-rs/core/src/agents_md_tests.rs index 12767a809b..7c5eb95aaa 100644 --- a/codex-rs/core/src/agents_md_tests.rs +++ b/codex-rs/core/src/agents_md_tests.rs @@ -549,14 +549,9 @@ async fn read_agents_md_propagates_metadata_errors() { }; let cwd = config.cwd.clone(); - let err = read_agents_md( - &config.config, - &fs, - "local", - &PathUri::from_abs_path(&cwd), - ) - .await - .expect_err("metadata error"); + let err = read_agents_md(&config.config, &fs, "local", &PathUri::from_abs_path(&cwd)) + .await + .expect_err("metadata error"); assert_eq!(err.kind(), io::ErrorKind::PermissionDenied); } @@ -572,14 +567,9 @@ async fn read_agents_md_propagates_read_errors() { }; let cwd = config.cwd.clone(); - let err = read_agents_md( - &config.config, - &fs, - "local", - &PathUri::from_abs_path(&cwd), - ) - .await - .expect_err("read error"); + let err = read_agents_md(&config.config, &fs, "local", &PathUri::from_abs_path(&cwd)) + .await + .expect_err("read error"); assert_eq!(err.kind(), io::ErrorKind::PermissionDenied); } @@ -595,14 +585,9 @@ async fn read_agents_md_ignores_files_removed_after_discovery() { }; let cwd = config.cwd.clone(); - let loaded = read_agents_md( - &config.config, - &fs, - "local", - &PathUri::from_abs_path(&cwd), - ) - .await - .expect("removed file is recoverable"); + let loaded = read_agents_md(&config.config, &fs, "local", &PathUri::from_abs_path(&cwd)) + .await + .expect("removed file is recoverable"); assert_eq!(loaded, None); } diff --git a/codex-rs/tui/src/app_server_session.rs b/codex-rs/tui/src/app_server_session.rs index 82c8586b1a..b37a9555b4 100644 --- a/codex-rs/tui/src/app_server_session.rs +++ b/codex-rs/tui/src/app_server_session.rs @@ -2450,9 +2450,9 @@ mod tests { test_path_buf("/tmp/project").abs(), test_path_buf("/tmp/project/extra").abs(), ], - instruction_sources: vec![ - ApiPathString::from_abs_path(&test_path_buf("/tmp/project/AGENTS.md").abs()), - ], + instruction_sources: vec![ApiPathString::from_abs_path( + &test_path_buf("/tmp/project/AGENTS.md").abs(), + )], approval_policy: codex_app_server_protocol::AskForApproval::Never, approvals_reviewer: codex_app_server_protocol::ApprovalsReviewer::User, sandbox: read_only_profile