mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
fix
This commit is contained in:
@@ -289,15 +289,16 @@ impl ExternalAgentConfigService {
|
||||
&config,
|
||||
&PluginsManager::new(self.codex_home.clone()),
|
||||
)?;
|
||||
self.detect_plugin_migration(
|
||||
if let Some(item) = self.detect_plugin_migration(
|
||||
source_settings.as_path(),
|
||||
repo_root.unwrap_or(self.external_agent_home.as_path()),
|
||||
cwd.clone(),
|
||||
Some(settings),
|
||||
settings,
|
||||
&configured_plugin_ids,
|
||||
&configured_marketplace_plugins,
|
||||
items,
|
||||
);
|
||||
) {
|
||||
items.push(item);
|
||||
}
|
||||
}
|
||||
Err(err) => {
|
||||
tracing::warn!(
|
||||
@@ -324,33 +325,28 @@ impl ExternalAgentConfigService {
|
||||
source_settings: &Path,
|
||||
source_root: &Path,
|
||||
cwd: Option<PathBuf>,
|
||||
settings: Option<&JsonValue>,
|
||||
settings: &JsonValue,
|
||||
configured_plugin_ids: &HashSet<String>,
|
||||
configured_marketplace_plugins: &BTreeMap<String, HashSet<String>>,
|
||||
items: &mut Vec<ExternalAgentConfigMigrationItem>,
|
||||
) {
|
||||
let Some(plugin_details) = settings.and_then(|settings| {
|
||||
extract_plugin_migration_details(
|
||||
settings,
|
||||
source_root,
|
||||
configured_plugin_ids,
|
||||
configured_marketplace_plugins,
|
||||
)
|
||||
}) else {
|
||||
return;
|
||||
};
|
||||
|
||||
items.push(ExternalAgentConfigMigrationItem {
|
||||
item_type: ExternalAgentConfigMigrationItemType::Plugins,
|
||||
description: format!("Import enabled plugins from {}", source_settings.display()),
|
||||
cwd,
|
||||
details: Some(plugin_details),
|
||||
});
|
||||
) -> Option<ExternalAgentConfigMigrationItem> {
|
||||
let plugin_details = extract_plugin_migration_details(
|
||||
settings,
|
||||
source_root,
|
||||
configured_plugin_ids,
|
||||
configured_marketplace_plugins,
|
||||
)?;
|
||||
emit_migration_metric(
|
||||
EXTERNAL_AGENT_CONFIG_DETECT_METRIC,
|
||||
ExternalAgentConfigMigrationItemType::Plugins,
|
||||
/*skills_count*/ None,
|
||||
);
|
||||
|
||||
Some(ExternalAgentConfigMigrationItem {
|
||||
item_type: ExternalAgentConfigMigrationItemType::Plugins,
|
||||
description: format!("Import enabled plugins from {}", source_settings.display()),
|
||||
cwd,
|
||||
details: Some(plugin_details),
|
||||
})
|
||||
}
|
||||
|
||||
async fn import_plugins(
|
||||
|
||||
@@ -1037,20 +1037,18 @@ async fn import_plugins_supports_external_agent_plugin_marketplace_layout() {
|
||||
|
||||
fs::write(
|
||||
external_agent_home.join("settings.json"),
|
||||
format!(
|
||||
r#"{{
|
||||
"enabledPlugins": {{
|
||||
serde_json::to_string_pretty(&serde_json::json!({
|
||||
"enabledPlugins": {
|
||||
"cloudflare@my-plugins": true
|
||||
}},
|
||||
"extraKnownMarketplaces": {{
|
||||
"my-plugins": {{
|
||||
"source": "local",
|
||||
"path": "{}"
|
||||
}}
|
||||
}}
|
||||
}}"#,
|
||||
marketplace_root.display()
|
||||
),
|
||||
},
|
||||
"extraKnownMarketplaces": {
|
||||
"my-plugins": {
|
||||
"source": "local",
|
||||
"path": marketplace_root
|
||||
}
|
||||
}
|
||||
}))
|
||||
.expect("serialize settings"),
|
||||
)
|
||||
.expect("write settings");
|
||||
fs::write(
|
||||
|
||||
Reference in New Issue
Block a user