mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Import enabled plugins from known marketplaces (#31672)
## Summary - discover enabled-plugin marketplace sources from the user-level known marketplace registry - preserve scoped settings and supported Git/directory declarations, falling back to the matching registry `installLocation` for file, URL, npm-hosted, and inline marketplace sources - resolve relative registry materialization paths against the external-agent home - reuse the existing marketplace add and plugin install flow during import - emit `plugin_not_found` tracing and analytics with plugin and marketplace identity ## Why Enabled plugins can remain in settings after their marketplace source has moved into the user-level registry. Import detection previously skipped those plugins because it only consulted settings-defined marketplace sources. ## Impact `/import` can now restore those marketplaces and install their enabled plugins through the normal plugin installer, including npm, Git, and local plugin sources. Missing plugins remain visible in import results and the plugin-install failure analytics stream.
This commit is contained in:
1 parent
a6b99ee5c4
commit
8dc77faf51
13 files changed
+531
-83
No files matched your search
@@ -57,6 +57,7 @@ use crate::store::PluginStore;
|
||||
use crate::store::PluginStoreError;
|
||||
use crate::tool_suggest_metadata::ToolSuggestMetadataCache;
|
||||
use codex_analytics::AnalyticsEventsClient;
|
||||
use codex_analytics::PluginInstallSource;
|
||||
use codex_config::ConfigLayerStack;
|
||||
use codex_config::clear_user_plugin;
|
||||
use codex_config::set_user_plugin_enabled;
|
||||
@@ -370,6 +371,7 @@ pub struct PluginsManager {
|
||||
restriction_product: Option<Product>,
|
||||
auth_mode: RwLock<Option<AuthMode>>,
|
||||
analytics_events_client: RwLock<Option<AnalyticsEventsClient>>,
|
||||
plugin_install_source: PluginInstallSource,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
@@ -449,9 +451,15 @@ impl PluginsManager {
|
||||
restriction_product,
|
||||
auth_mode: RwLock::new(auth_mode),
|
||||
analytics_events_client: RwLock::new(None),
|
||||
plugin_install_source: PluginInstallSource::Manual,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn with_plugin_install_source(mut self, source: PluginInstallSource) -> Self {
|
||||
self.plugin_install_source = source;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn set_auth_mode(&self, auth_mode: Option<AuthMode>) -> bool {
|
||||
let mut stored_auth_mode = match self.auth_mode.write() {
|
||||
Ok(auth_mode_guard) => auth_mode_guard,
|
||||
@@ -1419,6 +1427,7 @@ impl PluginsManager {
|
||||
if let Some(analytics_events_client) = analytics_events_client {
|
||||
analytics_events_client.track_plugin_install_failed(
|
||||
self.telemetry_metadata_for_plugin_id(plugin_id),
|
||||
self.plugin_install_source,
|
||||
error_type.to_string(),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user