From c88e3ac6304194f127363a35f172f071b5e94beb Mon Sep 17 00:00:00 2001 From: iven Date: Sat, 11 Apr 2026 14:26:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(kernel):=20UserProfile=20=E5=BA=8F=E5=88=97?= =?UTF-8?q?=E5=8C=96=E5=A4=B1=E8=B4=A5=E6=97=B6=E8=AE=B0=E5=BD=95=20warn?= =?UTF-8?q?=20=E8=80=8C=E9=9D=9E=E9=9D=99=E9=BB=98=E5=90=9E=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- desktop/src-tauri/src/kernel_commands/agent.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desktop/src-tauri/src/kernel_commands/agent.rs b/desktop/src-tauri/src/kernel_commands/agent.rs index 7cdc8a2..9faa4ac 100644 --- a/desktop/src-tauri/src/kernel_commands/agent.rs +++ b/desktop/src-tauri/src/kernel_commands/agent.rs @@ -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), + } } } }