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

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 // Convert serde_yaml::Value to a string representation
let value_str = match value { let value_str = match value {