Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Normalize Guardian review cwd reuse keys (#34824)

Adam Perry @ OpenAIbbfc3f0152cf
diff --git a/codex-rs/core/src/guardian/review_session.rs b/codex-rs/core/src/guardian/review_session.rs
index dfc5457143..61955ac084 100644
--- a/codex-rs/core/src/guardian/review_session.rs
+++ b/codex-rs/core/src/guardian/review_session.rs
@@ -50,7 +50,7 @@ use crate::session::turn_context::TurnContext;
use codex_config::types::McpServerConfig;
use codex_features::Feature;
use codex_model_provider_info::ModelProviderInfo;
-use codex_utils_absolute_path::AbsolutePathBuf;
+use codex_utils_path_uri::PathUri;
use super::GUARDIAN_REVIEWER_NAME;
use super::GuardianApprovalRequest;
@@ -168,7 +168,7 @@ struct GuardianReviewSessionReuseKey {
base_instructions: Option<String>,
user_instructions: Option<UserInstructions>,
compact_prompt: Option<String>,
- cwd: AbsolutePathBuf,
+ cwd: PathUri,
mcp_servers: Constrained<HashMap<String, McpServerConfig>>,
codex_linux_sandbox_exe: Option<PathBuf>,
main_execve_wrapper_exe: Option<PathBuf>,
@@ -196,7 +196,7 @@ impl GuardianReviewSessionReuseKey {
base_instructions: spawn_config.base_instructions.clone(),
user_instructions,
compact_prompt: spawn_config.compact_prompt.clone(),
- cwd: spawn_config.cwd.clone(),
+ cwd: PathUri::from_abs_path(&spawn_config.cwd),
mcp_servers: spawn_config.mcp_servers.clone(),
codex_linux_sandbox_exe: spawn_config.codex_linux_sandbox_exe.clone(),
main_execve_wrapper_exe: spawn_config.main_execve_wrapper_exe.clone(),
@@ -1286,6 +1286,10 @@ mod tests {
/*user_instructions*/ None,
);
+ assert_eq!(
+ cached_reuse_key.cwd,
+ PathUri::from_abs_path(&cached_spawn_config.cwd)
+ );
assert_ne!(cached_reuse_key, next_reuse_key);
assert_eq!(
cached_reuse_key,