mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Expose connector candidates from imported sessions (#33414)
## What changed - Correlate MCP server attribution in imported session records with connector metadata, and persist normalized connector names in the session import ledger. - Extend `externalAgentConfig/import/readHistories` with connector candidates, including each connector's display name, imported-session count, and detection source. ## Testing - Cover connector detection through the session import and history-read flow. - Verify candidate aggregation uses the latest import for each source session. GitOrigin-RevId: 7f1f7f596925b2e6efcd17afd4490148e1ac9ff1
This commit is contained in:
1 parent
8530440b91
commit
58e4ed17a0
21 files changed
+587
-38
No files matched your search
@@ -22,6 +22,8 @@ use codex_app_server_protocol::ExternalAgentConfigImportResponse;
|
||||
use codex_app_server_protocol::ExternalAgentConfigImportTypeResult as ProtocolImportTypeResult;
|
||||
use codex_app_server_protocol::ExternalAgentConfigMigrationItem;
|
||||
use codex_app_server_protocol::ExternalAgentConfigMigrationItemType;
|
||||
use codex_app_server_protocol::ExternalAgentImportedConnectorCandidate;
|
||||
use codex_app_server_protocol::ExternalAgentImportedConnectorSource;
|
||||
use codex_app_server_protocol::HookMigration;
|
||||
use codex_app_server_protocol::JSONRPCErrorError;
|
||||
use codex_app_server_protocol::McpServerMigration;
|
||||
@@ -32,6 +34,7 @@ use codex_app_server_protocol::SkillMigration;
|
||||
use codex_arg0::Arg0DispatchPaths;
|
||||
use codex_core::ThreadManager;
|
||||
use codex_external_agent_migration::sessions::ExternalAgentSessionMigration as CoreSessionMigration;
|
||||
use codex_external_agent_migration::sessions::read_imported_connector_candidates;
|
||||
use codex_rollout::StateDbHandle;
|
||||
use codex_state::ExternalAgentConfigImportFailureRecord;
|
||||
use codex_state::ExternalAgentConfigImportSuccessRecord;
|
||||
@@ -89,15 +92,16 @@ impl ExternalAgentConfigRequestProcessor {
|
||||
arg0_paths,
|
||||
codex_home,
|
||||
} = args;
|
||||
let migration_service =
|
||||
ExternalAgentConfigService::new(codex_home.clone(), analytics_events_client.clone());
|
||||
let session_importer = ExternalAgentSessionImporter::new(
|
||||
codex_home.clone(),
|
||||
codex_home,
|
||||
migration_service.connector_metadata_roots.clone(),
|
||||
Arc::clone(&thread_manager),
|
||||
thread_store,
|
||||
config_manager,
|
||||
arg0_paths,
|
||||
);
|
||||
let migration_service =
|
||||
ExternalAgentConfigService::new(codex_home, analytics_events_client.clone());
|
||||
Self {
|
||||
outgoing,
|
||||
migration_service,
|
||||
@@ -369,8 +373,21 @@ impl ExternalAgentConfigRequestProcessor {
|
||||
.into_iter()
|
||||
.map(protocol_import_history)
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
let connectors = read_imported_connector_candidates(&self.migration_service.codex_home)
|
||||
.map_err(|err| {
|
||||
internal_error(format!(
|
||||
"failed to read imported connector candidates: {err}"
|
||||
))
|
||||
})?
|
||||
.into_iter()
|
||||
.map(|candidate| ExternalAgentImportedConnectorCandidate {
|
||||
name: candidate.name,
|
||||
session_count: candidate.session_count,
|
||||
source: ExternalAgentImportedConnectorSource::RemoteMcpServersConfig,
|
||||
})
|
||||
.collect();
|
||||
|
||||
Ok(ExternalAgentConfigImportHistoriesReadResponse { data })
|
||||
Ok(ExternalAgentConfigImportHistoriesReadResponse { data, connectors })
|
||||
}
|
||||
|
||||
fn validate_pending_session_imports(
|
||||
|
||||
Reference in new issue
Block a user