From f938ac6bf4c48210132432fd17d04171bc983963 Mon Sep 17 00:00:00 2001 From: kdletters <61648117+kdletters@users.noreply.github.com> Date: Mon, 5 Oct 2026 23:23:46 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E6=94=B6=E6=95=9B=20MCP=20?= =?UTF-8?q?=E4=B8=8E=E4=BA=A4=E4=BB=98=E5=A4=8D=E6=A0=B8=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=AD=A3=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 保留 Direct Tools MCP 启动、Skill 资源和运行失败正文 保留交付封口复核底层原因并同步验证记录 --- .../src/agent/codex_app_server/execution.rs | 5 +-- .../src-tauri/src/agent/direct_tools_mcp.rs | 34 +++++++++++++------ ...€�里程碑】AGC错误具体文本展示-2026-10-04.md | 1 + 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/codex_app_server/execution.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/codex_app_server/execution.rs index 76c309ad8..e203810b6 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/codex_app_server/execution.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/codex_app_server/execution.rs @@ -1152,8 +1152,9 @@ impl ExecutionAdapter { self.interrupt("收尾仍有未结算操作,交付尚未完成。").await; HostOutcome::Report(self.report()) } - Err(_) => { - self.interrupt("交付复核失败,已停止本轮并保留证据。").await; + Err(error) => { + let message = format!("交付复核失败:{error};已停止本轮并保留证据。"); + self.interrupt(&message).await; HostOutcome::Report(self.report()) } } diff --git a/apps/ai-game-creator-shell/src-tauri/src/agent/direct_tools_mcp.rs b/apps/ai-game-creator-shell/src-tauri/src/agent/direct_tools_mcp.rs index 347622806..dde3bd93d 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/agent/direct_tools_mcp.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/agent/direct_tools_mcp.rs @@ -80,11 +80,17 @@ pub(crate) fn run_direct_tools_mcp_if_requested(args: &[String]) -> Option .build() { Ok(runtime) => runtime, - Err(_) => return Some(1), + Err(error) => { + eprintln!("AGC Direct Tools MCP 运行时初始化失败:{error}"); + return Some(1); + } }; Some(match runtime.block_on(run_direct_tools_mcp_stdio()) { Ok(()) => 0, - Err(_) => 1, + Err(error) => { + eprintln!("AGC Direct Tools MCP 运行失败:{error}"); + 1 + } }) } @@ -1467,13 +1473,17 @@ async fn handle_direct_tools_mcp_request(root: &Path, request: Value) -> Option< .and_then(Value::as_str) .unwrap_or_default(); if uri == "agc://skills/index" { - let text = render_agc_skill_pack_index() - .map_err(|_| ()) - .unwrap_or_else(|_| "AGC Skill 索引暂不可用".to_string()); - return Some(mcp_success( - id, - json!({ "contents": [{ "uri": uri, "mimeType": "text/plain", "text": text }] }), - )); + return match render_agc_skill_pack_index() { + Ok(text) => Some(mcp_success( + id, + json!({ "contents": [{ "uri": uri, "mimeType": "text/plain", "text": text }] }), + )), + Err(error) => Some(mcp_error( + id, + -32603, + &format!("AGC Skill 索引读取失败:{error}"), + )), + }; } if let Some(resource) = uri.strip_prefix("agc://skills/") { return match read_agc_skill_resource(resource) { @@ -1484,7 +1494,11 @@ async fn handle_direct_tools_mcp_request(root: &Path, request: Value) -> Option< )) } Ok(_) => Some(mcp_error(id, -32000, "AGC Skill 资源超过响应大小上限")), - Err(_) => Some(mcp_error(id, -32602, "未知或未审核的 AGC Skill 资源")), + Err(error) => Some(mcp_error( + id, + -32603, + &format!("AGC Skill 资源读取失败:{error}"), + )), }; } if uri != "agc://conversation/codex-responses" { diff --git a/docs/project-memory/plans/【里程碑】AGC错误具体文本展示-2026-10-04.md b/docs/project-memory/plans/【里程碑】AGC错误具体文本展示-2026-10-04.md index fa66b9947..ba14a072d 100644 --- a/docs/project-memory/plans/【里程碑】AGC错误具体文本展示-2026-10-04.md +++ b/docs/project-memory/plans/【里程碑】AGC错误具体文本展示-2026-10-04.md @@ -71,3 +71,4 @@ DirectProject 回合失败在确认不是客户端内部不可归类故障时, - 进入项目时预览活体核验的 IPC 失败原来只按“没有可复用预览”处理;现在保留安全正文并写入工作区状态,同时不误停未知活体。 - 继续真实客户端启动和旁路扫描又发现三处仍会损失事实:旧历史通用中断文案遇到换行/多空格时未命中“正文缺失”标记,非 2xx 响应正文读取失败被 `unwrap_or_default()` 抹掉,CC sidecar 的 stderr 排空超时/读取任务失败也被当成“没有 stderr”。现分别改为折叠空白识别、保留“响应正文读取失败:底层原因”和保留 stderr 排空阶段/底层原因;不改变状态码、重试和脱敏边界。 - 第二轮 Agent/CC 旁路扫描继续发现执行许可/执行会话/MCP 本地读取/编辑器 worker/Cocos worker 的 JoinError,以及 MCP future panic,会被固定成“任务未返回/异常/需要核对”;现把 join/panic 正文并入既有 ToolFailure / MCP 错误载荷,保留 `needs-reconciliation` 的不可自动重放语义。Native 定向测试:Direct MCP 33 项、Direct Tool Bridge 41 项、CC 14 项均通过。 +- 最新漏扫又补出 Direct Tools MCP 启动/运行退出码、Skill `resources/read` 索引与资源读取、交付 `finish_sealing` 错误三处固定句;现在分别写入 stderr、MCP 错误正文和交付复核底层原因,避免只剩退出码或“暂不可用/复核失败”。