From ffbd30aeb71a669045a70e5ff74ed4aa116f79af Mon Sep 17 00:00:00 2001 From: jif Date: Mon, 21 Sep 2026 09:03:19 +0000 Subject: [PATCH] Canonicalize the workspace trust key in the doctor config test (#46981) macOS temporary directories can use symlinked paths. Use `project_trust_key` in `doctor_reports_only_safe_config_error_metadata` so the fixture trusts the canonical workspace when testing project configuration errors. GitOrigin-RevId: 61b15e4cfc2eaa8d258b51a482decc0b9bd684e9 --- codex-rs/cli/tests/doctor_path_safety.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/codex-rs/cli/tests/doctor_path_safety.rs b/codex-rs/cli/tests/doctor_path_safety.rs index 0d8ac4bbb7..c4bb01b2b9 100644 --- a/codex-rs/cli/tests/doctor_path_safety.rs +++ b/codex-rs/cli/tests/doctor_path_safety.rs @@ -9,6 +9,7 @@ use anyhow::Context; use anyhow::Result; use app_test_support::TestAppServer; use codex_app_server_protocol::RequestId; +use codex_config::loader::project_trust_key; use pretty_assertions::assert_eq; use serde_json::Value; use serde_json::json; @@ -202,7 +203,8 @@ fn doctor_reports_only_safe_config_error_metadata() -> Result<()> { let fixture = Fixture::new()?; let user_config_file = fixture.home.join("config.toml"); let original = std::fs::read_to_string(&user_config_file)?; - let project_key = toml::Value::String(fixture.workspace.display().to_string()); + // macOS temp directories can use a symlinked path; trust the canonical workspace. + let project_key = toml::Value::String(project_trust_key(&fixture.workspace)); let original = format!("{original}\n[projects.{project_key}]\ntrust_level = \"trusted\"\n"); let project_config_dir = fixture.workspace.join(".codex"); std::fs::create_dir(&project_config_dir)?;