From 6df7f49190375186f9948ddf8ef969ae78013f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=B4=E5=A4=A9?= Date: Thu, 26 Mar 2026 05:26:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BE=AE=E4=BF=A1=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=A3=80=E6=B5=8B=E8=A7=A3=E6=9E=90=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=EF=BC=88=E5=8F=96=E6=95=B0=E5=AD=97=E5=BC=80=E5=A4=B4?= =?UTF-8?q?=E7=9A=84=E8=AF=8D=E8=80=8C=E9=9D=9E=E6=9C=80=E5=90=8E=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E8=AF=8D=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit openclaw --version 输出 "OpenClaw 2026.3.24 (hash)",之前用 last() 取到 "(hash)" 导致版本号解析为空,误判为旧版。改为 find() 取第一个数字开头的词。 --- src-tauri/src/commands/messaging.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/commands/messaging.rs b/src-tauri/src/commands/messaging.rs index bdaeb12..e429de2 100644 --- a/src-tauri/src/commands/messaging.rs +++ b/src-tauri/src/commands/messaging.rs @@ -1189,7 +1189,10 @@ pub async fn run_channel_action( .output() .ok()?; let raw = String::from_utf8_lossy(&out.stdout).trim().to_string(); - raw.split_whitespace().last().map(String::from) + // 输出格式: "OpenClaw 2026.3.24 (hash)" → 取第二个词(版本号) + raw.split_whitespace() + .find(|w| w.chars().next().map_or(false, |c| c.is_ascii_digit())) + .map(String::from) }) .unwrap_or_default(); let oc_nums: Vec = oc_ver