Refactor plugin loading to async (#17747)

Simplifies skills migration.
This commit is contained in:
pakrym-oai
2026-04-13 21:52:56 -07:00
committed by GitHub
parent ff584c5a4b
commit 3b24a9a532
23 changed files with 308 additions and 209 deletions

View File

@@ -210,7 +210,7 @@ impl ConfigApi {
.write_value(params)
.await
.map_err(map_error)?;
self.emit_plugin_toggle_events(pending_changes);
self.emit_plugin_toggle_events(pending_changes).await;
Ok(response)
}
@@ -230,7 +230,7 @@ impl ConfigApi {
.batch_write(params)
.await
.map_err(map_error)?;
self.emit_plugin_toggle_events(pending_changes);
self.emit_plugin_toggle_events(pending_changes).await;
if reload_user_config {
self.user_config_reloader.reload_user_config().await;
}
@@ -299,13 +299,16 @@ impl ConfigApi {
Ok(ExperimentalFeatureEnablementSetResponse { enablement })
}
fn emit_plugin_toggle_events(&self, pending_changes: std::collections::BTreeMap<String, bool>) {
async fn emit_plugin_toggle_events(
&self,
pending_changes: std::collections::BTreeMap<String, bool>,
) {
for (plugin_id, enabled) in pending_changes {
let Ok(plugin_id) = PluginId::parse(&plugin_id) else {
continue;
};
let metadata =
installed_plugin_telemetry_metadata(self.codex_home.as_path(), &plugin_id);
installed_plugin_telemetry_metadata(self.codex_home.as_path(), &plugin_id).await;
if enabled {
self.analytics_events_client.track_plugin_enabled(metadata);
} else {