From 41692f252b709d574efeb3eee16248531f6ced9f Mon Sep 17 00:00:00 2001 From: hhang <169027046+xu91102@users.noreply.github.com> Date: Thu, 29 Oct 2026 17:35:34 +0800 Subject: [PATCH] test(mcp): retain structured bundle path diagnostics Keep absolute-path refusal and all rejected parameter facts independent of legacy flat or current structured SDK diagnostic rendering. Retain relative CLI, absolute MCP and no-Evidence controls. Refs #5150 --- .../boundary/mcp/bundleComparisonMcp.test.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/boundary/mcp/bundleComparisonMcp.test.ts b/tests/boundary/mcp/bundleComparisonMcp.test.ts index b80c9ccd9c..9020ff9320 100644 --- a/tests/boundary/mcp/bundleComparisonMcp.test.ts +++ b/tests/boundary/mcp/bundleComparisonMcp.test.ts @@ -155,22 +155,22 @@ it("requires absolute bundle paths without changing server-cwd semantics", async }, }); const relativeCases = [ - ["left.json", "right.json", "left_bundle_path"], - ["left.json", join(root, "right.json"), "left_bundle_path"], - [join(root, "left.json"), "right.json", "right_bundle_path"], + ["left.json", "right.json", ["left_bundle_path", "right_bundle_path"]], + ["left.json", join(root, "right.json"), ["left_bundle_path"]], + [join(root, "left.json"), "right.json", ["right_bundle_path"]], ] as const; - for (const [leftPath, rightPath, rejectedField] of relativeCases) { + for (const [leftPath, rightPath, rejectedFields] of relativeCases) { const result = await compare(leftPath, rightPath); - expect(parseMcpToolError(result).error).toMatchObject({ + const { error } = parseMcpToolError(result); + expect(error).toMatchObject({ code: "invalid_request", category: "invalid_input", + details: { operation: "compare_bundles" }, }); - expect(result.content[0]).toMatchObject({ - text: expect.stringContaining( - `${rejectedField}: must be an absolute local filesystem path`, - ), - }); + const details = JSON.stringify(error.details); + for (const field of rejectedFields) expect(details).toContain(field); } + expect(connected.session.exportEvidenceBundle().records).toEqual([]); expect( bundleComparisonInputSchema.parse({ left_bundle_path: "left.json",