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:
@@ -175,14 +175,10 @@ 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"],
|
|
||||||
};
|
|
||||||
|
|
||||||
for output_name in unused_outputs {
|
|
||||||
if let Some(meta_data) = crate::meta_plugin::process_metadata_outputs(
|
if let Some(meta_data) = crate::meta_plugin::process_metadata_outputs(
|
||||||
output_name,
|
output_name,
|
||||||
serde_yaml::Value::Null,
|
serde_yaml::Value::Null,
|
||||||
@@ -192,6 +188,7 @@ impl MetaPlugin for DigestMetaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
self.is_finalized = true;
|
self.is_finalized = true;
|
||||||
crate::meta_plugin::MetaPluginResponse {
|
crate::meta_plugin::MetaPluginResponse {
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user