fix: remove duplicate metadata processing in meta service

Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-26 18:50:20 -03:00
parent 77089c181b
commit e3e9db145d

View File

@@ -165,23 +165,18 @@ impl MetaService {
response: crate::meta_plugin::MetaPluginResponse, response: crate::meta_plugin::MetaPluginResponse,
) { ) {
for meta_data in response.metadata { for meta_data in response.metadata {
if let Some(processed_meta) = crate::meta_plugin::process_metadata_outputs( // The metadata has already been processed by the plugin, so we can use it directly
&meta_data.name,
meta_data.value,
plugin.outputs()
) {
// Save to database // Save to database
let db_meta = crate::db::Meta { let db_meta = crate::db::Meta {
id: item_id, id: item_id,
name: processed_meta.name, name: meta_data.name,
value: processed_meta.value, value: meta_data.value,
}; };
if let Err(e) = crate::db::store_meta(conn, db_meta) { if let Err(e) = crate::db::store_meta(conn, db_meta) {
log::warn!("META_SERVICE: Failed to store metadata: {}", e); log::warn!("META_SERVICE: Failed to store metadata: {}", e);
} }
} }
} }
}
pub fn collect_initial_meta(&self) -> HashMap<String, String> { pub fn collect_initial_meta(&self) -> HashMap<String, String> {
let mut item_meta: HashMap<String, String> = crate::modes::common::get_meta_from_env(); let mut item_meta: HashMap<String, String> = crate::modes::common::get_meta_from_env();