mirror of
https://github.com/openai/codex.git
synced 2026-10-28 18:58:46 +00:00
## 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
34 lines
1.1 KiB
Rust
34 lines
1.1 KiB
Rust
use crate::discover_external_memory_files;
|
|
use crate::memory_import::projects_needing_import;
|
|
use crate::memory_import::resources_root;
|
|
use crate::model::ExternalAgentConfigMigrationItem;
|
|
use crate::model::ExternalAgentConfigMigrationItemType;
|
|
use crate::model::MigrationDetails;
|
|
use std::io;
|
|
use std::path::Path;
|
|
|
|
pub(super) fn detect(
|
|
codex_home: &Path,
|
|
external_agent_home: &Path,
|
|
) -> io::Result<Option<ExternalAgentConfigMigrationItem>> {
|
|
let memory_files = discover_external_memory_files(external_agent_home)?;
|
|
let memory = projects_needing_import(codex_home, &memory_files)?;
|
|
if memory.is_empty() {
|
|
return Ok(None);
|
|
}
|
|
|
|
Ok(Some(ExternalAgentConfigMigrationItem {
|
|
item_type: ExternalAgentConfigMigrationItemType::Memory,
|
|
description: format!(
|
|
"Import memory files from {} to {}",
|
|
external_agent_home.join("projects").display(),
|
|
resources_root(codex_home).display()
|
|
),
|
|
cwd: None,
|
|
details: Some(MigrationDetails {
|
|
memory: memory.into_iter().collect(),
|
|
..Default::default()
|
|
}),
|
|
}))
|
|
}
|