feat: add default options to meta plugins status table

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 17:27:11 -03:00
parent b802c4f6f0
commit 19848fd379
2 changed files with 17 additions and 10 deletions

View File

@@ -48,6 +48,12 @@ impl TextMetaPlugin {
outputs,
);
// Set default text_detect_size option if not provided
if !base.options.contains_key("text_detect_size") {
base.options.insert("text_detect_size".to_string(),
serde_yaml::Value::Number(PIPESIZE.into()));
}
// Get text_detect_size (previously max_buffer_size)
let max_buffer_size = base.options.get("text_detect_size")
.or_else(|| base.options.get("max_buffer_size")) // Handle backward compatibility

View File

@@ -182,23 +182,24 @@ fn build_meta_plugins_configured_table(settings: &config::Settings) -> Option<Ta
Some(outputs_converted),
);
// Show the merged options including defaults set by the plugin
// Convert options to a YAML string, but handle formatting better
// Note: actual_plugin.options() is not used here, so we don't need to store it
// For plugins that set default options programmatically, we need to include them
// Let's get the default plugin to see what options it would have
let _default_plugin = get_meta_plugin(
// Get the default plugin to see its default options
let default_plugin = get_meta_plugin(
meta_plugin_type.clone(),
None,
None,
);
// Merge default options with the configured options
let mut all_options = default_plugin.options().clone();
for (key, value) in &effective_options {
all_options.insert(key.clone(), value.clone());
}
// Use the effective_options which already includes both defaults and configured options
let options_str = if effective_options.is_empty() {
// Convert options to a YAML string
let options_str = if all_options.is_empty() {
"{}".to_string()
} else {
serde_yaml::to_string(&effective_options)
serde_yaml::to_string(&all_options)
.unwrap_or_else(|_| "Unable to serialize options".to_string())
.trim()
.to_string()