Import external agent sessions in background (#20284)

Summary:
- Return from external agent import before session history import
finishes
- Run session import work in the background and emit the existing
completion notification when it is done
- Serialize session imports so duplicate requests do not create
duplicate imported threads

Verification:
- cargo test -p codex-app-server external_agent_config_
- cargo test -p codex-external-agent-sessions
- just fix -p codex-app-server
- just fix -p codex-external-agent-sessions
- git diff --check
This commit is contained in:
stefanstokic-oai
2026-04-29 17:00:41 -07:00
committed by GitHub
parent 7bcd4626c4
commit c8abcbf925
8 changed files with 465 additions and 57 deletions

View File

@@ -518,6 +518,7 @@ impl Drop for ActiveLogin {
}
/// Handles JSON-RPC messages for Codex threads (and legacy conversation APIs).
#[derive(Clone)]
pub(crate) struct CodexMessageProcessor {
auth_manager: Arc<AuthManager>,
thread_manager: Arc<ThreadManager>,