fix: handle serde_yaml::Value to_string conversion properly

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 16:04:39 -03:00
parent 45d3ee3bfb
commit 7f9b5e3423

View File

@@ -190,11 +190,21 @@ fn build_config_table(settings: &config::Settings) -> Table {
} else {
let mut output_pairs = Vec::new();
for (key, value) in actual_plugin.outputs() {
// Convert serde_yaml::Value to string for comparison
// Convert serde_yaml::Value to a string representation
let value_str = match value {
serde_yaml::Value::String(s) => s.clone(),
_ => value.to_string(),
serde_yaml::Value::Number(n) => n.to_string(),
serde_yaml::Value::Bool(b) => b.to_string(),
serde_yaml::Value::Null => "null".to_string(),
serde_yaml::Value::Sequence(_) => {
serde_yaml::to_string(value).unwrap_or_else(|_| "[]".to_string())
}
serde_yaml::Value::Mapping(_) => {
serde_yaml::to_string(value).unwrap_or_else(|_| "{}".to_string())
}
};
// Trim any extra whitespace from the serialized values
let value_str = value_str.trim().to_string();
if key == &value_str {
output_pairs.push(key.clone());
} else {