fix: handle hostname false option 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 18:05:16 -03:00
parent 15e7c2b6e5
commit 75222eeb7f
2 changed files with 17 additions and 1 deletions

View File

@@ -23,6 +23,18 @@ impl HostnameMetaPlugin {
// Override with provided options // Override with provided options
if let Some(opts) = options { if let Some(opts) = options {
for (key, value) in opts { 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); final_options.insert(key, value);
} }
} }
@@ -195,6 +207,9 @@ impl MetaPlugin for HostnameMetaPlugin {
_ => true, _ => 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") let hostname_full_enabled = self.options.get("hostname_full")
.and_then(|v| v.as_bool()) .and_then(|v| v.as_bool())
.unwrap_or(true); .unwrap_or(true);

View File

@@ -196,7 +196,8 @@ fn build_meta_plugins_configured_table(settings: &config::Settings) -> Option<Ta
all_options.insert(key.clone(), value.clone()); all_options.insert(key.clone(), value.clone());
} }
// Convert options to a YAML string // Convert options to a YAML string, but first make sure to show the actual values used
// This includes any conversions we made (like "false" string to Bool(false))
let options_str = if all_options.is_empty() { let options_str = if all_options.is_empty() {
"{}".to_string() "{}".to_string()
} else { } else {