fix(kernel): UserProfile 序列化失败时记录 warn 而非静默吞掉
This commit is contained in:
@@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user