diff --git a/apps/ai-game-creator-shell/src-tauri/src/commands.rs b/apps/ai-game-creator-shell/src-tauri/src/commands.rs index 2f564e863..e7e86ac1a 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/commands.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/commands.rs @@ -2037,7 +2037,10 @@ fn persist_game_creator_app_config( let path = writable_game_creator_config_path()?; let content = serialize_game_creator_app_config_for_renderer_write(&config)?; write_game_creator_config_atomically(&path, &format!("{content}\n"))?; - game_creator_app_config_view(load_game_creator_app_config()?) + // `config` is already normalized and is exactly what was persisted. + // Avoid reloading it here: a reload repeats the Windows private-path and + // ACL checks and made saving the settings panel appear to hang. + game_creator_app_config_view(config) } #[tauri::command] diff --git a/apps/ai-game-creator-shell/src-tauri/src/config.rs b/apps/ai-game-creator-shell/src-tauri/src/config.rs index 8fbfff37b..973ef6b67 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/config.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/config.rs @@ -3272,9 +3272,10 @@ pub(crate) fn configure_game_creator_runtime_config_dir( Ok(()) } -/// Validates a persisted AGC config file without following links. Existing -/// regular files are tightened through the same Windows owner/DACL gate used -/// by credential files before any read is allowed. +/// Validates a persisted AGC config file without following links. +/// +/// Reading configuration must remain read-only. ACL hardening is performed +/// when the file is created or replaced, not on every settings-panel read. fn validate_game_creator_config_file_entry(path: &Path) -> Result { #[cfg(windows)] validate_game_creator_private_path_ancestors_with_auto_elevation(path, "客户端配置文件")?; @@ -3293,8 +3294,6 @@ fn validate_game_creator_config_file_entry(path: &Path) -> Result if metadata.file_type().is_symlink() || !metadata.is_file() { return Err("客户端配置文件必须是普通文件,不能是链接或其他对象".to_string()); } - #[cfg(windows)] - secure_windows_game_creator_path_for_current_user_with_auto_elevation(path, false, true)?; Ok(true) } diff --git a/apps/ai-game-creator-shell/src/features/runtime-config/RuntimeConfigDialog.tsx b/apps/ai-game-creator-shell/src/features/runtime-config/RuntimeConfigDialog.tsx index b88d59449..cb90f50db 100644 --- a/apps/ai-game-creator-shell/src/features/runtime-config/RuntimeConfigDialog.tsx +++ b/apps/ai-game-creator-shell/src/features/runtime-config/RuntimeConfigDialog.tsx @@ -470,6 +470,7 @@ export function RuntimeConfigDialog({ })); } + // 常用设置仅调整运行参数,读写时无需外部诊断,避免进程探测拖慢页面加载和保存反馈。 async function readRuntimeConfig() { if (runtimeConfigBusyRef.current) { return; @@ -494,15 +495,6 @@ export function RuntimeConfigDialog({ ); setRuntimeConfigDraft(config); setRuntimeConfigStatus(`已读取:${result.path}`); - try { - const status = await invoke( - 'check_game_creator_llm_config', - ); - setEffectiveLlmConfigStatus(status); - } catch { - // Older test fixtures and non-Tauri previews may not expose the - // diagnostic command; the config read itself remains usable. - } onLog?.('runtime_config.read'); } catch (error) { setRuntimeConfigStatus( @@ -551,15 +543,6 @@ export function RuntimeConfigDialog({ ); setRuntimeConfigDraft(savedConfig); setRuntimeConfigStatus(`已保存:${result.path}`); - try { - const status = await invoke( - 'check_game_creator_llm_config', - ); - setEffectiveLlmConfigStatus(status); - } catch { - // Keep the last safe status when the optional diagnostic refresh is - // unavailable in a preview or test fixture. - } setRuntimeConfigToast({ tone: 'success', message: '保存成功,新的运行时配置已生效',