fix: warn and remove unsupported meta plugins in save mode

Co-authored-by: aider (openai/andrew.openrouter.qwen.qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-07-29 14:04:19 -03:00
parent a8717f4b94
commit 13a2747a8d

View File

@@ -64,16 +64,20 @@ pub fn mode_save(
// Initialize meta_plugins with MetaPlugin instances for each MetaPluginType // Initialize meta_plugins with MetaPlugin instances for each MetaPluginType
let mut meta_plugins: Vec<Box<dyn MetaPlugin>> = meta_plugin_types let mut meta_plugins: Vec<Box<dyn MetaPlugin>> = meta_plugin_types
.into_iter() .iter()
.map(|meta_plugin_type| get_meta_plugin(meta_plugin_type)) .map(|meta_plugin_type| get_meta_plugin(meta_plugin_type.clone()))
.collect(); .collect();
// Check for unsupported meta plugins and warn the user // Check for unsupported meta plugins, warn the user, and remove them from the list
for (meta_plugin, meta_plugin_type) in meta_plugins.iter().zip(&meta_plugin_types) { meta_plugins.retain(|meta_plugin| {
if !meta_plugin.is_supported() { // We need to get the type somehow, but we can't easily do that from the trait
eprintln!("Warning: Meta plugin '{}' is enabled but not supported on this system", meta_plugin_type); // 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 { let mut item = db::Item {
id: None, id: None,