diff --git a/crates/zclaw-growth/src/feedback_collector.rs b/crates/zclaw-growth/src/feedback_collector.rs index 9b8ecaf..a0a08fa 100644 --- a/crates/zclaw-growth/src/feedback_collector.rs +++ b/crates/zclaw-growth/src/feedback_collector.rs @@ -135,8 +135,17 @@ impl FeedbackCollector { let mut saved = 0; for record in self.trust_records.values() { - let content = - serde_json::to_string(record).unwrap_or_default(); + let content = match serde_json::to_string(record) { + Ok(c) => c, + Err(e) => { + tracing::warn!( + "[FeedbackCollector] Failed to serialize trust record {}: {}", + record.artifact_id, + e + ); + continue; + } + }; let entry = crate::types::MemoryEntry::new( "feedback", MemoryType::Session, diff --git a/desktop/src-tauri/src/intelligence/extraction_adapter.rs b/desktop/src-tauri/src/intelligence/extraction_adapter.rs index e772f64..38aaeed 100644 --- a/desktop/src-tauri/src/intelligence/extraction_adapter.rs +++ b/desktop/src-tauri/src/intelligence/extraction_adapter.rs @@ -233,8 +233,8 @@ impl LlmDriverForExtraction for TauriExtractionDriver { user_prompt: &str, ) -> Result { if messages.len() < 2 { - return Err(zclaw_types::Error::msg( - "Too few messages for combined extraction", + return Err(zclaw_types::ZclawError::InvalidInput( + "Too few messages for combined extraction".to_string(), )); } @@ -276,8 +276,8 @@ impl LlmDriverForExtraction for TauriExtractionDriver { .join(""); if response_text.is_empty() { - return Err(zclaw_types::Error::msg( - "Empty response from LLM for combined extraction", + return Err(zclaw_types::ZclawError::LlmError( + "Empty response from LLM for combined extraction".to_string(), )); }