From 75222eeb7f13975525223ffb285621abdee52c22 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Wed, 27 Aug 2025 18:05:16 -0300 Subject: [PATCH] fix: handle hostname false option properly Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) --- src/meta_plugin/hostname.rs | 15 +++++++++++++++ src/modes/status.rs | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/meta_plugin/hostname.rs b/src/meta_plugin/hostname.rs index 290a562..bdd9a1a 100644 --- a/src/meta_plugin/hostname.rs +++ b/src/meta_plugin/hostname.rs @@ -23,6 +23,18 @@ impl HostnameMetaPlugin { // Override with provided options if let Some(opts) = options { for (key, value) in opts { + // Handle "false" string values by converting them to Bool(false) + if key == "hostname" || key == "hostname_full" || key == "hostname_short" { + if let serde_yaml::Value::String(s) = &value { + if s == "false" { + final_options.insert(key, serde_yaml::Value::Bool(false)); + continue; + } else if s == "true" { + final_options.insert(key, serde_yaml::Value::Bool(true)); + continue; + } + } + } final_options.insert(key, value); } } @@ -195,6 +207,9 @@ impl MetaPlugin for HostnameMetaPlugin { _ => true, }; + // Ensure that if hostname is explicitly set to false, it's disabled + // This handles cases where it might be set to "false" string which we converted above + let hostname_full_enabled = self.options.get("hostname_full") .and_then(|v| v.as_bool()) .unwrap_or(true); diff --git a/src/modes/status.rs b/src/modes/status.rs index c21e201..52ab4a2 100644 --- a/src/modes/status.rs +++ b/src/modes/status.rs @@ -196,7 +196,8 @@ fn build_meta_plugins_configured_table(settings: &config::Settings) -> Option