From 6669a3d497a151215c292697560662585bcfb7e4 Mon Sep 17 00:00:00 2001 From: kdletters Date: Sun, 13 Sep 2026 14:26:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9A=94=E7=A6=BB=E5=AD=90?= =?UTF-8?q?=20Agent=20=E7=9A=84=20Cocos=20=E6=8B=92=E7=BB=9D=E7=AD=96?= =?UTF-8?q?=E7=95=A5=E5=BF=AB=E7=85=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在平台未提供 Cocos executable catalog 时仍显式展示 denied 工具 保持 isolated child 的跨平台工具边界一致 --- .../src/agent/runtime_actions/tool_policy_snapshot.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/tool_policy_snapshot.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/tool_policy_snapshot.rs index 49e1a9da9..1c2fb8d7f 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/tool_policy_snapshot.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/runtime_actions/tool_policy_snapshot.rs @@ -179,6 +179,16 @@ pub(in crate::agent) fn agent_runtime_tool_policy_snapshot_at( auto_tools.push(tool.to_string()); } } + if isolated { + // Keep the isolated-child contract explicit even when a denied tool + // is unavailable on the current platform and therefore absent from + // the executable catalog (for example, the Windows-only Cocos bridge). + for tool in ISOLATED_AGENT_UNSCOPED_DENIED_TOOLS { + if !denied_tools.iter().any(|candidate| candidate == tool) { + denied_tools.push((*tool).to_string()); + } + } + } Ok(AgentRuntimeToolPolicySnapshot { run_profile: default_agent_runtime_run_profile(), run_profile_binding_fingerprint: String::new(),