From 7f9b5e3423b7af4ddd0faee5fa334c804fb7a3f4 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Wed, 27 Aug 2025 16:04:39 -0300 Subject: [PATCH] fix: handle serde_yaml::Value to_string conversion properly Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) --- src/modes/status.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/modes/status.rs b/src/modes/status.rs index 4e4442c..015488e 100644 --- a/src/modes/status.rs +++ b/src/modes/status.rs @@ -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 {