diff --git a/src-tauri/src/commands/service.rs b/src-tauri/src/commands/service.rs
index 4c90091..07012c0 100644
--- a/src-tauri/src/commands/service.rs
+++ b/src-tauri/src/commands/service.rs
@@ -633,6 +633,14 @@ async fn guardian_tick(app: &tauri::AppHandle) {
return;
}
+ if std::env::consts::OS == "windows" {
+ state.manual_hold = true;
+ state.auto_restart_count = 0;
+ state.last_restart_time = None;
+ guardian_log("检测到 Windows Gateway 终端窗口已关闭,按用户停机处理,不自动重启");
+ return;
+ }
+
if let Some(last) = state.last_restart_time {
if now.duration_since(last) < GUARDIAN_RESTART_COOLDOWN {
return;
@@ -1146,7 +1154,6 @@ mod platform {
use std::os::windows::process::CommandExt;
use std::path::{Path, PathBuf};
use std::process::Command as StdCommand;
- use std::process::Stdio;
use std::sync::Mutex;
use std::time::{Duration, Instant};
@@ -1154,6 +1161,7 @@ mod platform {
static CLI_CACHE: Mutex