diff --git a/codex-rs/app-server/src/config/external_agent_config.rs b/codex-rs/app-server/src/config/external_agent_config.rs index 8f9a45d83c..e0fa2a3dfe 100644 --- a/codex-rs/app-server/src/config/external_agent_config.rs +++ b/codex-rs/app-server/src/config/external_agent_config.rs @@ -20,8 +20,8 @@ use codex_core_plugins::marketplace_add::is_local_marketplace_source; use codex_external_agent_migration::count_missing_subagents; use codex_external_agent_migration::missing_subagent_names; use codex_external_agent_sessions::ExternalAgentSessionMigration; -use codex_external_agent_sessions::detect_recent_cursor_sessions; -use codex_external_agent_sessions::detect_recent_sessions; +use codex_external_agent_sessions::detect_recent_cl_sessions; +use codex_external_agent_sessions::detect_recent_cu_sessions; use codex_plugin::PluginId; use codex_protocol::protocol::Product; use serde_json::Value as JsonValue; @@ -783,10 +783,10 @@ impl ExternalAgentConfigService { if repo_root.is_none() && self.source.supports(SourceFeature::Sessions) { let sessions = match self.source { ExternalAgentSource::Cl => { - detect_recent_sessions(&self.external_agent_home, &self.codex_home)? + detect_recent_cl_sessions(&self.external_agent_home, &self.codex_home)? } ExternalAgentSource::Cu => { - detect_recent_cursor_sessions(&self.external_agent_home, &self.codex_home)? + detect_recent_cu_sessions(&self.external_agent_home, &self.codex_home)? } }; if !sessions.is_empty() { diff --git a/codex-rs/external-agent-sessions/src/detect.rs b/codex-rs/external-agent-sessions/src/detect_cl.rs similarity index 91% rename from codex-rs/external-agent-sessions/src/detect.rs rename to codex-rs/external-agent-sessions/src/detect_cl.rs index f42c90766b..1bb1cf0df6 100644 --- a/codex-rs/external-agent-sessions/src/detect.rs +++ b/codex-rs/external-agent-sessions/src/detect_cl.rs @@ -13,7 +13,7 @@ use std::time::Duration; const SESSION_IMPORT_MAX_COUNT: usize = 50; const SESSION_IMPORT_MAX_AGE: Duration = Duration::from_secs(30 * 24 * 60 * 60); -pub fn detect_recent_sessions( +pub fn detect_recent_cl_sessions( external_agent_home: &Path, codex_home: &Path, ) -> io::Result> { @@ -135,7 +135,8 @@ mod tests { ], ); - let sessions = detect_recent_sessions(&external_agent_home, root.path()).expect("detect"); + let sessions = + detect_recent_cl_sessions(&external_agent_home, root.path()).expect("detect"); assert_eq!( sessions, @@ -163,7 +164,8 @@ mod tests { ], ); - let sessions = detect_recent_sessions(&external_agent_home, root.path()).expect("detect"); + let sessions = + detect_recent_cl_sessions(&external_agent_home, root.path()).expect("detect"); assert_eq!( sessions, @@ -190,7 +192,8 @@ mod tests { ], ); - let sessions = detect_recent_sessions(&external_agent_home, root.path()).expect("detect"); + let sessions = + detect_recent_cl_sessions(&external_agent_home, root.path()).expect("detect"); assert_eq!( sessions, @@ -218,7 +221,8 @@ mod tests { ], ); - let sessions = detect_recent_sessions(&external_agent_home, root.path()).expect("detect"); + let sessions = + detect_recent_cl_sessions(&external_agent_home, root.path()).expect("detect"); assert_eq!( sessions, @@ -247,7 +251,8 @@ mod tests { )], ); - let sessions = detect_recent_sessions(&external_agent_home, root.path()).expect("detect"); + let sessions = + detect_recent_cl_sessions(&external_agent_home, root.path()).expect("detect"); assert_eq!( sessions, @@ -276,7 +281,7 @@ mod tests { ); assert!( - detect_recent_sessions(&external_agent_home, root.path()) + detect_recent_cl_sessions(&external_agent_home, root.path()) .expect("detect") .is_empty() ); @@ -313,7 +318,8 @@ mod tests { let mut all_sessions = expected.clone(); all_sessions.push(oldest_session.clone()); - let sessions = detect_recent_sessions(&external_agent_home, root.path()).expect("detect"); + let sessions = + detect_recent_cl_sessions(&external_agent_home, root.path()).expect("detect"); assert_eq!(sessions, expected); for session in sessions { @@ -321,7 +327,8 @@ mod tests { .expect("record import"); } - let sessions = detect_recent_sessions(&external_agent_home, root.path()).expect("detect"); + let sessions = + detect_recent_cl_sessions(&external_agent_home, root.path()).expect("detect"); assert_eq!(sessions, vec![oldest_session.clone()]); for session in sessions { @@ -347,7 +354,8 @@ mod tests { ); } - let sessions = detect_recent_sessions(&external_agent_home, root.path()).expect("detect"); + let sessions = + detect_recent_cl_sessions(&external_agent_home, root.path()).expect("detect"); assert_eq!(sessions, expected); for session in sessions { @@ -355,7 +363,8 @@ mod tests { .expect("record import"); } - let sessions = detect_recent_sessions(&external_agent_home, root.path()).expect("detect"); + let sessions = + detect_recent_cl_sessions(&external_agent_home, root.path()).expect("detect"); assert_eq!(sessions, vec![oldest_session]); } @@ -376,7 +385,7 @@ mod tests { .expect("record import"); assert!( - detect_recent_sessions(&external_agent_home, root.path()) + detect_recent_cl_sessions(&external_agent_home, root.path()) .expect("detect") .is_empty() ); @@ -405,7 +414,8 @@ mod tests { ) .expect("update session"); - let sessions = detect_recent_sessions(&external_agent_home, root.path()).expect("detect"); + let sessions = + detect_recent_cl_sessions(&external_agent_home, root.path()).expect("detect"); assert_eq!( sessions, vec![ExternalAgentSessionMigration { diff --git a/codex-rs/external-agent-sessions/src/detect_cursor.rs b/codex-rs/external-agent-sessions/src/detect_cu.rs similarity index 98% rename from codex-rs/external-agent-sessions/src/detect_cursor.rs rename to codex-rs/external-agent-sessions/src/detect_cu.rs index 008f6ddf63..7fd3811c93 100644 --- a/codex-rs/external-agent-sessions/src/detect_cursor.rs +++ b/codex-rs/external-agent-sessions/src/detect_cu.rs @@ -14,7 +14,7 @@ use std::time::Duration; const SESSION_IMPORT_MAX_COUNT: usize = 50; const SESSION_IMPORT_MAX_AGE: Duration = Duration::from_secs(30 * 24 * 60 * 60); -pub fn detect_recent_cursor_sessions( +pub fn detect_recent_cu_sessions( external_agent_home: &Path, codex_home: &Path, ) -> io::Result> { @@ -178,5 +178,5 @@ fn decode_cursor_project_path_from(encoded: &str, base: &Path, depth: usize) -> } #[cfg(test)] -#[path = "detect_cursor_tests.rs"] +#[path = "detect_cu_tests.rs"] mod tests; diff --git a/codex-rs/external-agent-sessions/src/detect_cursor_tests.rs b/codex-rs/external-agent-sessions/src/detect_cu_tests.rs similarity index 94% rename from codex-rs/external-agent-sessions/src/detect_cursor_tests.rs rename to codex-rs/external-agent-sessions/src/detect_cu_tests.rs index a3da5c17db..de1beeab7a 100644 --- a/codex-rs/external-agent-sessions/src/detect_cursor_tests.rs +++ b/codex-rs/external-agent-sessions/src/detect_cu_tests.rs @@ -28,7 +28,7 @@ fn detects_cursor_transcript_with_project_cwd() { .expect("transcript"); let sessions = - detect_recent_cursor_sessions(&external_agent_home, root.path()).expect("detect sessions"); + detect_recent_cu_sessions(&external_agent_home, root.path()).expect("detect sessions"); assert_eq!( sessions, diff --git a/codex-rs/external-agent-sessions/src/lib.rs b/codex-rs/external-agent-sessions/src/lib.rs index 9b51aebfa6..e43d08a2d6 100644 --- a/codex-rs/external-agent-sessions/src/lib.rs +++ b/codex-rs/external-agent-sessions/src/lib.rs @@ -1,7 +1,7 @@ //! Parsing and export helpers for external-agent session histories. -mod detect; -mod detect_cursor; +mod detect_cl; +mod detect_cu; mod export; mod ledger; mod records; @@ -12,8 +12,8 @@ use std::io; use std::path::Path; use std::path::PathBuf; -pub use detect::detect_recent_sessions; -pub use detect_cursor::detect_recent_cursor_sessions; +pub use detect_cl::detect_recent_cl_sessions; +pub use detect_cu::detect_recent_cu_sessions; use export::load_session_for_import_with_content_sha256; pub use ledger::CompletedExternalAgentSessionImport; pub use ledger::has_current_session_been_imported;