From cc11da1eddecd184ae1c2d0b745b585a499632bd Mon Sep 17 00:00:00 2001 From: kdletters <61648117+kdletters@users.noreply.github.com> Date: Tue, 6 Oct 2026 14:03:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E7=95=99=E6=8F=92=E4=BB=B6=20RPC=20?= =?UTF-8?q?=E5=9B=9E=E5=86=99=E5=A4=B1=E8=B4=A5=E6=AD=A3=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 宿主响应写入失败终止插件 RPC 循环并传给等待调用 补充插件通道排障记录 --- apps/ai-game-creator-shell/src-tauri/src/plugin_host.rs | 5 ++++- docs/project-memory/shared-memory/pitfalls.md | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/plugin_host.rs b/apps/ai-game-creator-shell/src-tauri/src/plugin_host.rs index 5c505e70d..d527716d6 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/plugin_host.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/plugin_host.rs @@ -1584,7 +1584,10 @@ impl PluginHost { json!({"jsonrpc":"2.0","id":id,"error":{"code":-32001,"message":error}}) } }; - let _ = write_rpc_shared(&writer, &payload); + if let Err(error) = write_rpc_shared(&writer, &payload) { + terminal_error = Some(format!("插件 RPC 响应写入失败:{error}")); + break; + } } } } diff --git a/docs/project-memory/shared-memory/pitfalls.md b/docs/project-memory/shared-memory/pitfalls.md index 9c832253b..2c04c35cd 100644 --- a/docs/project-memory/shared-memory/pitfalls.md +++ b/docs/project-memory/shared-memory/pitfalls.md @@ -28,6 +28,8 @@ Direct 的 Tauri 进度、活动回合和 manifest 事件不能忽略 `app.emit` 进程输出超限、ConPTY 握手失败、输出读取失败和快照落盘失败后的终止控制也属于同一条诊断链,控制消息发送失败要带 processId 写入日志,不能只留下业务错误正文。 +插件向宿主发起 RPC 后,宿主回写响应失败必须终止这条插件 RPC 读取循环并把写失败正文传给等待方;继续读而不收口会让插件调用看起来像无响应。 + ## 2026-10-03 AGC 随包 plugins 的 feature 档位必须与消费方一致,且门禁会因 build.rs 未重跑而假通过 - **现象**:Windows 本机 `npm run check:generated-bindings`(`npm run lint` 链内,`scripts/check-repository-ci.sh` 的 Repository checks 也走它)在 `build.rs:167:29` panic:`插件随包资源校验失败:随包插件存在未声明文件:.../src-tauri/resources/plugins/agc-godot-editor/native/gdextension/bin/win-x64/agc_godot_editor.dll(目标 x86_64-pc-windows-msvc 与当前 feature 组合不允许;请先执行随包资源准备步骤)`;树上换成 `agc-unity-editor/dotnet/publish/win-x64/Agc.Unity.Attach.exe` 时报同一类错。反向还有更隐蔽的形态:门禁 2 秒就 exit 0 说「通过」,但 tree 上其实带着编辑器产物。