diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/autonomous_policy.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/autonomous_policy.rs index 7727f2188..b85acad3f 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/autonomous_policy.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/autonomous_policy.rs @@ -708,6 +708,13 @@ pub(crate) fn validate_agent_runtime_autonomous_plan_liveness( if agent_id == GAME_CREATOR_PROJECT_SUPERVISOR_AGENT_ID && loop_index > AGENT_RUNTIME_AUTONOMOUS_PRE_MUTATION_LOOP_LIMIT && verification_gate.mutation_revision.is_none() + && verification_gate.failed_playtest_revision.is_none() + && verification_gate.verified_revision.is_none() + && !observations.iter().any(|observation| { + observation.tool == "preview.validate" + && observation.status == "failed" + && observation.summary == "浏览器验证未通过,请根据诊断修复后重试" + }) && !has_mutation && !has_code_asset_route && plan.response.trim().is_empty() diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_driver/main_loop_tests.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_driver/main_loop_tests.rs index df9c4e0a5..be937a926 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_driver/main_loop_tests.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_driver/main_loop_tests.rs @@ -814,8 +814,14 @@ async fn game_chat_art_receipt_wakes_the_same_code_prototype_run() { .expect("waiting main task exists"); let wake_started = wake_waiting_static_delegate_parent_run_at(&root, &waiting) .expect("wake same main run after art receipt"); - cancel_game_creator_agent_runtime_task_at(&root, "code-prototype", &main.run_id) - .expect("cancel resumed fixture run"); + if let Err(error) = + cancel_game_creator_agent_runtime_task_at(&root, "code-prototype", &main.run_id) + { + assert!( + error.contains("Agent Runtime 任务已结束,不能取消"), + "cancel resumed fixture run: {error}" + ); + } let release_deadline = std::time::Instant::now() + std::time::Duration::from_secs(5); loop { if game_creator_agent_runtime_task_lock_is_available(&root, "code-prototype")