fix: handle disabled digest outputs 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:00:24 -03:00
parent 285d04aa9a
commit aa2534c901
2 changed files with 17 additions and 14 deletions

View File

@@ -175,14 +175,10 @@ impl MetaPlugin for DigestMetaPlugin {
metadata.push(meta_data);
}
// Set unused outputs to None
let unused_outputs: Vec<&str> = match hasher {
Hasher::Md5(_) => vec!["digest_sha256", "digest_sha512"],
Hasher::Sha256(_) => vec!["digest_md5", "digest_sha512"],
Hasher::Sha512(_) => vec!["digest_md5", "digest_sha256"],
};
for output_name in unused_outputs {
// Set all other digest outputs to None
let all_outputs = vec!["digest_md5", "digest_sha256", "digest_sha512"];
for output_name in all_outputs {
if output_name != hasher.output_name() {
if let Some(meta_data) = crate::meta_plugin::process_metadata_outputs(
output_name,
serde_yaml::Value::Null,
@@ -192,6 +188,7 @@ impl MetaPlugin for DigestMetaPlugin {
}
}
}
}
self.is_finalized = true;
crate::meta_plugin::MetaPluginResponse {

View File

@@ -245,6 +245,12 @@ fn build_meta_plugins_configured_table(settings: &config::Settings) -> Option<Ta
_ => {}
}
}
// For digest plugin, check if the output is None (disabled)
else if plugin_config.name == "digest" {
if value.is_null() {
continue;
}
}
// Convert serde_yaml::Value to a string representation
let value_str = match value {