From ed5243c64e079c3365062a5dbd1ab3004b192a15 Mon Sep 17 00:00:00 2001 From: kdletters Date: Sun, 13 Sep 2026 13:54:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E8=87=AA=E4=B8=BB=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E6=97=B6=E6=A0=B9=20Run=20=E5=AE=89=E5=85=A8=E9=97=A8?= =?UTF-8?q?=E7=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 保留 relaxed lane 自由执行,同时校验持久 Run Profile 的当前根身份 确保 art-director Canvas-only 动作约束不被 relaxed lane 绕过 --- .../src/agent/runtime_actions/action_execution.rs | 10 ++++------ .../src/agent/runtime_actions/project_gates.rs | 10 +++++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/action_execution.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/action_execution.rs index 7320fc65c..620aec6df 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/action_execution.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/action_execution.rs @@ -66,12 +66,10 @@ pub(crate) async fn execute_game_creator_agent_runtime_tool_action_with_pending_ return blocker; } } - if !relaxed_autonomous { - if let Some(blocker) = - agent_runtime_autonomous_art_director_canvas_only_action_block(agent_id, task, tool) - { - return blocker; - } + if let Some(blocker) = + agent_runtime_autonomous_art_director_canvas_only_action_block(agent_id, task, tool) + { + return blocker; } let command_id = game_creator_agent_runtime_tool_command_id(tool); if let Some(command_id) = command_id { diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/project_gates.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/project_gates.rs index d4e7fde49..4d4727ac9 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/project_gates.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/project_gates.rs @@ -138,12 +138,16 @@ pub(crate) fn ensure_current_autonomous_ready_child_mutation_at_locked( if game_creator_agent_runtime_cancel_requested_for(root, &normalized_agent_id, run_id) { return Err("当前 Run 已收到取消请求,禁止继续修改项目".to_string()); } - if autonomous_relaxed_run_at(root, &normalized_agent_id, run_id)? { - return Ok(()); - } + let relaxed_autonomous = autonomous_relaxed_run_at(root, &normalized_agent_id, run_id)?; let binding = read_game_creator_agent_runtime_run_profile_binding(root, &normalized_agent_id, run_id)?; let Some(binding) = binding else { + if relaxed_autonomous { + // Keep the relaxed lane compatible with legacy runs that predate + // durable Run Profile sidecars; bound runs still receive the + // current-root and lineage checks below. + return Ok(()); + } let task = read_latest_game_creator_agent_runtime_task_by_run_id( root, &normalized_agent_id,