保留 MCP 解析错误正文
JSON-RPC -32700 响应附带解析器详情而不回显原始请求 补充 MCP 排障记录
This commit is contained in:
@@ -1745,7 +1745,11 @@ where
|
||||
});
|
||||
None
|
||||
}
|
||||
Err(_) => Some(mcp_error(Value::Null, -32700, "Parse error")),
|
||||
Err(error) => Some(mcp_error(
|
||||
Value::Null,
|
||||
-32700,
|
||||
&format!("Parse error: {error}"),
|
||||
)),
|
||||
},
|
||||
Some(Err(error)) => {
|
||||
terminal_error = Some(error);
|
||||
@@ -2336,7 +2340,12 @@ mod tests {
|
||||
.map(|line| serde_json::from_str::<Value>(line).unwrap())
|
||||
.collect::<Vec<_>>();
|
||||
assert_eq!(replies.len(), 2);
|
||||
assert!(replies.iter().any(|reply| reply["error"]["code"] == -32700));
|
||||
assert!(replies.iter().any(|reply| {
|
||||
reply["error"]["code"] == -32700
|
||||
&& reply["error"]["message"]
|
||||
.as_str()
|
||||
.is_some_and(|message| message.contains("Parse error"))
|
||||
}));
|
||||
assert!(replies
|
||||
.iter()
|
||||
.any(|reply| reply["id"] == "failed-call" && reply["error"]["code"] == -32603));
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
资源画布预览失败态也必须优先显示 `previewError`;只有宿主确实没有正文时才显示“未提供具体错误正文”,不能把已有的读取、解码或权限原因改成单独的“预览失败”。
|
||||
|
||||
MCP stdio 收到非法 JSON 时,JSON-RPC `-32700` 响应也要保留解析器正文(不回显原始请求),不能只返回一个无上下文的 `Parse error`。
|
||||
|
||||
## 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 上其实带着编辑器产物。
|
||||
|
||||
Reference in New Issue
Block a user