fix: Correctly serialize filter plugin options for status display
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -143,20 +143,20 @@ fn build_filter_plugin_table(filter_plugins: &Vec<crate::common::status::FilterP
|
||||
let options_str = if plugin_info.options.is_empty() {
|
||||
"{}".to_string()
|
||||
} else {
|
||||
// Convert options to a map for better display
|
||||
let mut options_map = std::collections::BTreeMap::new();
|
||||
// Convert options to a proper structure for display
|
||||
let mut options_list = Vec::new();
|
||||
for opt in &plugin_info.options {
|
||||
let mut opt_map = std::collections::BTreeMap::new();
|
||||
opt_map.insert("name".to_string(), serde_yaml::Value::String(opt.name.clone()));
|
||||
if let Some(default) = &opt.default {
|
||||
opt_map.insert("default".to_string(), serde_yaml::Value::String(format!("{:?}", default)));
|
||||
opt_map.insert("default".to_string(), default.clone());
|
||||
} else {
|
||||
opt_map.insert("default".to_string(), serde_yaml::Value::String("None".to_string()));
|
||||
opt_map.insert("default".to_string(), serde_yaml::Value::Null);
|
||||
}
|
||||
opt_map.insert("required".to_string(), serde_yaml::Value::String(opt.required.to_string()));
|
||||
options_map.insert(opt.name.clone(), serde_yaml::Value::String(format!("{:?}", opt_map)));
|
||||
opt_map.insert("required".to_string(), serde_yaml::Value::Bool(opt.required));
|
||||
options_list.push(serde_yaml::Value::Mapping(opt_map));
|
||||
}
|
||||
serde_yaml::to_string(&options_map)
|
||||
serde_yaml::to_string(&serde_yaml::Value::Sequence(options_list))
|
||||
.unwrap_or_else(|_| "Unable to serialize options".to_string())
|
||||
.trim()
|
||||
.to_string()
|
||||
|
||||
Reference in New Issue
Block a user