DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.
fix(core): report active version in diagnostics
hairyf5f48dfe39556
diff --git a/src-tauri/src/bridge/lifecycle.rs b/src-tauri/src/bridge/lifecycle.rsindex a1556ef8..863ebc00 100644--- a/src-tauri/src/bridge/lifecycle.rs+++ b/src-tauri/src/bridge/lifecycle.rs@@ -7,6 +7,7 @@ use std::sync::OnceLock;use crate::config;use crate::service::cli;+use crate::service::core;use crate::service::download::{self, Installable};use crate::service::workflow;use tauri::AppHandle;@@ -17,6 +18,11 @@ use tauri::AppHandle;/// TOCTOU 与安装失败后状态卡死导致后续请求被静默跳过。static INSTALL_LOCK: OnceLock<tokio::sync::Mutex<()>> = OnceLock::new();+/// 返回当前实际选中的核心版本,不能直接读取固定预打包目录。+fn active_dsh_version(app_handle: &AppHandle) -> Option<String> {+ core::active_version(app_handle).or_else(|| config::get_dsh_version(app_handle))+}+fn install_lock() -> &'static tokio::sync::Mutex<()> {INSTALL_LOCK.get_or_init(|| tokio::sync::Mutex::new(()))}@@ -133,7 +139,7 @@ pub async fn install_dependencies(app_handle: AppHandle) -> Result<bool, String>Ok(latest) if dsh_files_ok => {let record_commit = config::get_dsh_pkg_commit(&app_handle);let record_tag = config::get_dsh_pkg_tag(&app_handle);- let installed_version = config::get_dsh_version(&app_handle);+ let installed_version = active_dsh_version(&app_handle);// 老记录没有 tag,反查 pkg 仓库 tags 列表确认记录对应的发布版本;// 反查失败时由 resolve_update 回退到“以实际文件为准”的保守分支let legacy_tags = if record_tag.is_none() {@@ -239,9 +245,18 @@ pub async fn check_dsh_update(return Ok(None);}+ // 当前运行的是预览版时不提示稳定/RC 更新:预览版可能高于当前 release,+ // 但不能把用户主动选择的 alpha/beta 版本降级成较旧的 rc。+ if config::get_store_dat_setting(&app_handle).active_core.as_deref() == Some("app")+ && config::get_dsh_pkg_tag(&app_handle).as_deref().is_some_and(download::is_preview_tag)+ {+ log::info!("Suppressing dsh update because a preview core is active");+ return Ok(None);+ }+// 当前已运行版本高于推荐版本时也不提示更新;否则从高版本核心切换后,// latest release 仍可能被误判为更新并再次弹出通知。- if let Some(installed_version) = config::get_dsh_version(&app_handle) {+ if let Some(installed_version) = active_dsh_version(&app_handle) {if config::is_dsh_version_above_recommended(&app_handle, &installed_version) {log::info!("Suppressing dsh update because installed version is above recommended: {}",@@ -263,7 +278,7 @@ pub async fn check_dsh_update(}let record_commit = config::get_dsh_pkg_commit(&app_handle);let record_tag = config::get_dsh_pkg_tag(&app_handle);- let installed_version = config::get_dsh_version(&app_handle);+ let installed_version = active_dsh_version(&app_handle);// 老记录没有 tag,反查 pkg 仓库 tags 列表确认记录对应的发布版本;// 反查失败时由 resolve_update 回退到“以实际文件为准”的保守分支diff --git a/src-tauri/src/bridge/system_os.rs b/src-tauri/src/bridge/system_os.rsindex b06ca84c..c36861e8 100644--- a/src-tauri/src/bridge/system_os.rs+++ b/src-tauri/src/bridge/system_os.rs@@ -6,6 +6,7 @@use crate::config;use crate::logger;+use crate::service::core;use tauri::AppHandle;use tauri_plugin_clipboard_manager::ClipboardExt;use tauri_plugin_opener::OpenerExt;@@ -21,7 +22,9 @@ pub async fn proxy_health_check(app_handle: AppHandle) -> Result<String, String>#[tauri::command]pub async fn get_runtime_info(app_handle: AppHandle) -> Result<config::RuntimeInfo, String> {let port = config::get_store_dat_setting(&app_handle).port;- Ok(config::runtime_info(&app_handle, port))+ let mut info = config::runtime_info(&app_handle, port);+ info.dsh_version = core::active_version(&app_handle).or(info.dsh_version);+ Ok(info)}/// 在系统浏览器中打开 Harness 界面@@ -193,7 +196,8 @@ pub async fn read_run_logs(app_handle: AppHandle) -> Result<String, String> {};// 环境信息:桌面端应用版本、dsh 发行版本、Node 版本与系统平台/架构,便于报障时快速定位环境差异- let dsh_version = config::get_dsh_version(&app_handle)+ let dsh_version = core::active_version(&app_handle)+ .or_else(|| config::get_dsh_version(&app_handle)).map(|v| format!("dsh: {v}\n")).unwrap_or_default();let env_text = format!(diff --git a/src-tauri/src/config/runtime.rs b/src-tauri/src/config/runtime.rsindex 77f38df7..1a8d5f1e 100644--- a/src-tauri/src/config/runtime.rs+++ b/src-tauri/src/config/runtime.rs@@ -511,6 +511,15 @@ pub fn get_dsh_version<R: Runtime>(app_handle: &AppHandle<R>) -> Option<String>.trim_start_matches(['^', '~', '=', '>', '<']).to_string()})+ .or_else(|| {+ manifest+ .get("name")+ .and_then(|value| value.as_str())+ .filter(|name| *name == "@deepseek-ai/dsh")+ .and_then(|_| manifest.get("version"))+ .and_then(|value| value.as_str())+ .map(str::to_string)+ })}/// 侧边栏展示的运行时/版本/诊断信息diff --git a/src/components/config-debug.tsx b/src/components/config-debug.tsxindex 74939cb9..7983e99d 100644--- a/src/components/config-debug.tsx+++ b/src/components/config-debug.tsx@@ -2,7 +2,8 @@ import { ArrowRotateRight, ArrowUpRightFromSquare, ChevronRight, Copy, Folder, Pimport { Button, Chip, Description, Input, Link, ListBox, Select, Spinner, Surface, Switch } from '@heroui/react'import { useMutation, useQuery } from '@tanstack/react-query'import { invoke } from '@tauri-apps/api/core'-import { useState } from 'react'+import { listen } from '@tauri-apps/api/event'+import { useEffect, useState } from 'react'import { useTranslation } from 'react-i18next'import { If } from 'react-if-lite'import { useStore } from 'valtio-define'@@ -50,11 +51,28 @@ export function ConfigDebug() {// 读取 config 数据;用户一旦输入即以输入值为准。const [portInput, setPortInput] = useState<number>()- const { data: info } = useQuery({+ const { data: info, refetch: refreshInfo } = useQuery({queryKey: ['info'],queryFn: () => invoke<RuntimeInfo>('get_runtime_info'),})+ useEffect(() => {+ let disposed = false+ let unlisten: (() => void) | undefined+ listen('setting_updated', () => {+ void refreshInfo()+ }).then((fn) => {+ if (disposed)+ fn()+ else+ unlisten = fn+ }).catch(() => {})+ return () => {+ disposed = true+ unlisten?.()+ }+ }, [refreshInfo])+const { data: config, refetch: refreshConfig } = useQuery({queryKey: ['config'],queryFn: () => invoke<AppConfig>('get_app_config'),