From f6c5dd21cefc7d16dc4f89d847c1478746d7bced Mon Sep 17 00:00:00 2001 From: iven Date: Thu, 16 Apr 2026 00:03:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(heartbeat):=20Tauri=20invoke=20=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=90=8D=E4=BF=AE=E6=AD=A3=20snake=5Fcase=20=E2=86=92?= =?UTF-8?q?=20camelCase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tauri 2.x 默认将 Rust snake_case 参数重命名为 camelCase, 前端 invoke 必须使用 camelCase (agentId 而非 agent_id)。 修复 3 处 invoke 调用: - heartbeat_update_memory_stats (agentId, taskCount, totalEntries, storageSizeBytes) - heartbeat_record_correction (agentId, correctionType) - heartbeat_record_interaction (agentId) --- desktop/src/lib/intelligence-client.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/desktop/src/lib/intelligence-client.ts b/desktop/src/lib/intelligence-client.ts index f4f0f50..2c24873 100644 --- a/desktop/src/lib/intelligence-client.ts +++ b/desktop/src/lib/intelligence-client.ts @@ -1190,10 +1190,10 @@ export const intelligenceClient = { if (isTauriRuntime()) { await tauriInvoke('heartbeat.updateMemoryStats', () => invoke('heartbeat_update_memory_stats', { - agent_id: agentId, - task_count: taskCount, - total_entries: totalEntries, - storage_size_bytes: storageSizeBytes, + agentId: agentId, + taskCount: taskCount, + totalEntries: totalEntries, + storageSizeBytes: storageSizeBytes, }) ); } else { @@ -1212,8 +1212,8 @@ export const intelligenceClient = { if (isTauriRuntime()) { await tauriInvoke('heartbeat.recordCorrection', () => invoke('heartbeat_record_correction', { - agent_id: agentId, - correction_type: correctionType, + agentId: agentId, + correctionType: correctionType, }) ); } else { @@ -1230,7 +1230,7 @@ export const intelligenceClient = { if (isTauriRuntime()) { await tauriInvoke('heartbeat.recordInteraction', () => invoke('heartbeat_record_interaction', { - agent_id: agentId, + agentId: agentId, }) ); } else {