fix(kernel): UserProfile 序列化失败时记录 warn 而非静默吞掉

This commit is contained in:
iven
2026-04-11 14:26:52 +08:00
parent dc94a5323a
commit c88e3ac630

View File

@@ -187,7 +187,10 @@ pub async fn agent_get(
if let Ok(storage) = crate::viking_commands::get_storage().await {
let profile_store = zclaw_memory::UserProfileStore::new(storage.pool().clone());
if let Ok(Some(profile)) = profile_store.get(&agent_id).await {
agent_info.user_profile = Some(serde_json::to_value(profile).unwrap_or_default());
match serde_json::to_value(&profile) {
Ok(val) => agent_info.user_profile = Some(val),
Err(e) => tracing::warn!("[agent_get] Failed to serialize UserProfile: {}", e),
}
}
}
}