fix(mcp): deliver typed errors without invalid structured output (#1277)

* fix(mcp): deliver tool errors within advertised schema contracts

Retain complete typed JSON error content while omitting non-conforming
structured errors at the public transport boundary. Recover oversized
diagnostics into Evidence before removing their private structured carrier.
Update schema-validated client readers and cover actual stdio delivery.

Closes #1261

Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)

* test(mcp): read typed errors in canonical Evidence regressions

* test(mcp): validate public error diagnostics in acceptance workflows
This commit is contained in:
Ysopwnable
2026-10-09 13:54:32 +00:00
committed by GitHub
parent 0c6852b392
commit 7e96f25f8b
56 changed files with 324 additions and 156 deletions
+3 -2
View File
@@ -1,3 +1,4 @@
import { requireMcpToolError } from "./mcp-verifier-results.mjs";
import assert from "node:assert/strict";
import { execFile } from "node:child_process";
import { mkdtemp, readFile, rm } from "node:fs/promises";
@@ -158,11 +159,11 @@ const verifyDefaultScreenshotDelivery = async ({
);
assert.equal(constrained.isError, true);
assert.equal(
constrained.structuredContent?.error?.details?.resource,
requireMcpToolError(constrained)?.details?.resource,
"transport",
);
const reference =
constrained.structuredContent?.error?.details?.reported_limits
requireMcpToolError(constrained)?.details?.reported_limits
?.evidence_reference;
assert.equal(reference?.kind, "retained-evidence");
await client.ping();