From 13a2747a8d0555f48175d034c51aa5c1893efd17 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Tue, 29 Jul 2025 14:04:19 -0300 Subject: [PATCH] fix: warn and remove unsupported meta plugins in save mode Co-authored-by: aider (openai/andrew.openrouter.qwen.qwen3-coder) --- src/modes/save.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/modes/save.rs b/src/modes/save.rs index f7d5f2f..660e967 100644 --- a/src/modes/save.rs +++ b/src/modes/save.rs @@ -64,16 +64,20 @@ pub fn mode_save( // Initialize meta_plugins with MetaPlugin instances for each MetaPluginType let mut meta_plugins: Vec> = meta_plugin_types - .into_iter() - .map(|meta_plugin_type| get_meta_plugin(meta_plugin_type)) + .iter() + .map(|meta_plugin_type| get_meta_plugin(meta_plugin_type.clone())) .collect(); - // Check for unsupported meta plugins and warn the user - for (meta_plugin, meta_plugin_type) in meta_plugins.iter().zip(&meta_plugin_types) { - if !meta_plugin.is_supported() { - eprintln!("Warning: Meta plugin '{}' is enabled but not supported on this system", meta_plugin_type); + // Check for unsupported meta plugins, warn the user, and remove them from the list + meta_plugins.retain(|meta_plugin| { + // We need to get the type somehow, but we can't easily do that from the trait + // So we'll check support and warn if needed + let is_supported = meta_plugin.is_supported(); + if !is_supported { + eprintln!("Warning: Meta plugin '{}' is enabled but not supported on this system", meta_plugin.meta_name()); } - } + is_supported + }); let mut item = db::Item { id: None,