Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

fix(recovery): align the recovery payload with the camelCase bridge

hairyf816386d6d96d
diff --git a/src-tauri/src/service/plugin/recovery/mod.rs b/src-tauri/src/service/plugin/recovery/mod.rs
index a054d5d4..95fbeae4 100644
--- a/src-tauri/src/service/plugin/recovery/mod.rs
+++ b/src-tauri/src/service/plugin/recovery/mod.rs
@@ -237,4 +237,24 @@ mod tests {
assert!(!is_actionable_plugin_ref("@deepseek-ai/dsh-base"));
assert!(!is_actionable_plugin_ref("@deepseek-ai/dsh-client-ui-chat"));
}
+
+ #[test]
+ fn recovery_info_serializes_camel_case_fields() {
+ let info = PluginRecoveryInfo {
+ plugins: vec!["dsh-tauri".to_string()],
+ reason: "load_failed".to_string(),
+ detail: String::new(),
+ raw_error: "failed to apply loader entry 644301cc (dsh-tauri)".to_string(),
+ };
+ let json = serde_json::to_value(&info).expect("serialize recovery info");
+
+ assert_eq!(
+ json["rawError"],
+ "failed to apply loader entry 644301cc (dsh-tauri)"
+ );
+ assert_eq!(json["plugins"][0], "dsh-tauri");
+ assert_eq!(json["reason"], "load_failed");
+ // 前端只认 camelCase:snake_case 字段一旦出现,修复界面的原始错误将被静默丢弃
+ assert!(json.get("raw_error").is_none());
+ }
}
diff --git a/src/layout/index.tsx b/src/layout/index.tsx
index bfcc6fb4..604f7d58 100644
--- a/src/layout/index.tsx
+++ b/src/layout/index.tsx
@@ -101,7 +101,7 @@ export function App() {
plugins: ['dsh-better-sidebar'],
reason: 'slot_conflict',
detail: 'sidebar',
- raw_error: 'Preview: dsh-better-sidebar reported a UI slot conflict.',
+ rawError: 'Preview: dsh-better-sidebar reported a UI slot conflict.',
})
}
else if (event.code === 'Digit2') {
@@ -111,7 +111,7 @@ export function App() {
plugins: ['dsh-better-sidebar'],
reason: 'duplicate_loader_entry',
detail: 'dshSidebarApi',
- raw_error: 'Preview: duplicate loader entry id: dshSidebarApi',
+ rawError: 'Preview: duplicate loader entry id: dshSidebarApi',
})
}
})
diff --git a/src/store/modules/recovery/types.ts b/src/store/modules/recovery/types.ts
index a01686e9..ba9de9da 100644
--- a/src/store/modules/recovery/types.ts
+++ b/src/store/modules/recovery/types.ts
@@ -7,7 +7,7 @@ export interface PluginRecoveryInfo {
/** 动态详情(冲突路由 / 槽位 / 服务组件 id),用于 I18n 插值 */
detail: string
/** 原始错误信息(技术详情查看) */
- raw_error: string
+ rawError: string
}
/** 插件异常修复界面状态 */
diff --git a/src/ui/plugin/recovery.tsx b/src/ui/plugin/recovery.tsx
index 23e5e39a..e21e88f1 100644
--- a/src/ui/plugin/recovery.tsx
+++ b/src/ui/plugin/recovery.tsx
@@ -131,7 +131,7 @@ export function Recovery({ fullScreen = false }: { fullScreen?: boolean }) {
{/* 错误信息默认展示(含原始错误,便于排查) */}
<div className="mb-4 max-h-48 overflow-auto rounded-md bg-black/5 p-3">
<pre className="m-0 whitespace-pre-wrap break-all font-mono text-[11px] text-muted">
- {info.raw_error || '—'}
+ {info.rawError || '—'}
</pre>
</div>
diff --git a/test/runtime-exit-store.test.ts b/test/runtime-exit-store.test.ts
index 793a37af..d5d09f11 100644
--- a/test/runtime-exit-store.test.ts
+++ b/test/runtime-exit-store.test.ts
@@ -50,7 +50,7 @@ describe('runtime exit store', () => {
if (command === 'read_service_logs')
return 'Error: runtime process exited\nlast useful line'
if (command === 'detect_plugin_recovery')
- return { plugins: [], reason: 'unknown', detail: '', raw_error: '' }
+ return { plugins: [], reason: 'unknown', detail: '', rawError: '' }
throw new Error(`unexpected invoke: ${command}`)
})
@@ -111,7 +111,7 @@ describe('runtime exit store', () => {
if (command === 'read_service_logs')
return 'Error: process exited during readiness commit'
if (command === 'detect_plugin_recovery')
- return { plugins: [], reason: 'unknown', detail: '', raw_error: '' }
+ return { plugins: [], reason: 'unknown', detail: '', rawError: '' }
throw new Error(`unexpected invoke: ${command}`)
})