Files
codex/codex-rs/external-agent-migration/src/service_tests/memory.rs
T
charlesgong-openai e7efc5b04b Move external agent migration into its crate (#33456)
## What changed

- Move migration detection, import orchestration, models, and reporting from
  `codex-app-server` into `codex-external-agent-migration`.
- Keep app-server protocol conversion in a dedicated boundary module.
- Organize source-specific configuration, sessions, hooks, plugins, commands,
  subagents, and memory handling behind shared migration adapters.
- Relocate and split the migration tests alongside the extracted service.

GitOrigin-RevId: 3378ec2064806a28136d6ac98664ca1d75414a4e
2026-07-16 00:34:36 +00:00

40 lines
1.4 KiB
Rust

use super::*;
use pretty_assertions::assert_eq;
#[tokio::test]
async fn detect_does_not_offer_memory_for_an_unsupported_source() {
let root = TempDir::new().expect("create tempdir");
let external_agent_home = root.path().join(".cursor");
let codex_home = root.path().join(".codex");
let project_root = external_agent_home.join("projects/project-a");
let project_memory = project_root.join("memory");
let project_cwd = root.path().join("project-a-cwd");
fs::create_dir_all(&project_memory).expect("create project memory");
fs::create_dir_all(&project_cwd).expect("create project cwd");
fs::write(project_memory.join("MEMORY.md"), "project memory").expect("write project memory");
fs::write(
project_root.join("session.jsonl"),
serde_json::json!({
"type": "user",
"cwd": project_cwd,
"timestamp": "2026-07-13T00:00:00Z",
"message": { "content": "remember this" },
})
.to_string(),
)
.expect("write project session");
let mut service = service_for_paths(external_agent_home, codex_home);
service.source = ExternalAgentSource::Cur;
let items = service
.detect(ExternalAgentConfigDetectOptions {
include_home: true,
include_memory: true,
cwds: None,
})
.await
.expect("detect");
assert_eq!(items, Vec::<ExternalAgentConfigMigrationItem>::new());
}