refactor: remove initialize() call and use plugin outputs directly

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-27 18:09:17 -03:00
parent f056b16c65
commit 324b96d1e1
3 changed files with 25 additions and 60 deletions

View File

@@ -175,18 +175,12 @@ fn build_meta_plugins_configured_table(settings: &config::Settings) -> Option<Ta
.map(|(k, v)| (k.clone(), serde_yaml::Value::String(v.clone())))
.collect();
// Create the actual plugin with merged options
let mut actual_plugin = get_meta_plugin(
// Create the actual plugin with merged options - the constructor will handle setting up outputs
let actual_plugin = get_meta_plugin(
meta_plugin_type.clone(),
Some(effective_options.clone()),
Some(outputs_converted),
);
// Clone the plugin to avoid modifying the original when we initialize it
let mut plugin_for_display = actual_plugin.clone();
// Initialize the plugin to process the options and generate the actual outputs
// This will set disabled outputs to None
let _ = plugin_for_display.initialize();
// Get the default plugin to see its default options
let default_plugin = get_meta_plugin(
@@ -202,8 +196,7 @@ fn build_meta_plugins_configured_table(settings: &config::Settings) -> Option<Ta
all_options.insert(key.clone(), value.clone());
}
// Convert options to a YAML string, but first make sure to show the actual values used
// This includes any conversions we made (like "false" string to Bool(false))
// Convert options to a YAML string
let options_str = if all_options.is_empty() {
"{}".to_string()
} else {
@@ -213,10 +206,9 @@ fn build_meta_plugins_configured_table(settings: &config::Settings) -> Option<Ta
.to_string()
};
// Show only non-null outputs from the plugin after initialization
// This reflects which outputs would actually be generated
// Show only non-null outputs from the plugin
let mut enabled_output_pairs = Vec::new();
for (key, value) in plugin_for_display.outputs() {
for (key, value) in actual_plugin.outputs() {
// Skip null values (disabled outputs)
if value.is_null() {
continue;