From a6efa4fcefeffcf5ff5310b8154988b4be30c349 Mon Sep 17 00:00:00 2001 From: Ysopwnable <161784452+N0zoM1z0@users.noreply.github.com> Date: Tue, 13 Oct 2026 12:00:04 +0800 Subject: [PATCH] test(mcp): reuse advertised schema in inventory check (#2469) Reuse the current advertised binary_session definition for real SDK reply validation while preserving all inventory assertions and the 10-second deadline. Avoid initializing validators for unrelated tools in this correctness check. Closes #2453. Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage) --- tests/boundary/mcp/serverWorkflowMcp.test.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/boundary/mcp/serverWorkflowMcp.test.ts b/tests/boundary/mcp/serverWorkflowMcp.test.ts index c72fca5cb9..f25027b2a6 100644 --- a/tests/boundary/mcp/serverWorkflowMcp.test.ts +++ b/tests/boundary/mcp/serverWorkflowMcp.test.ts @@ -122,11 +122,18 @@ it("advertises the complete currently available inventory with a session", async const listed = await client.listTools(); const names = listed.tools.map((t) => t.name); + const sessionTool = listed.tools.find( + ({ name }) => name === "binary_session", + ); + if (sessionTool === undefined) + throw new Error("Missing advertised binary_session tool"); + // Validate this reply with its current advertised schema. The SDK otherwise + // builds output validators for the entire catalog on the first cached call. const status = structured( - await client.callTool({ - name: "binary_session", - arguments: {}, - }), + await client.callTool( + { name: "binary_session", arguments: {} }, + { toolDefinition: sessionTool }, + ), ); const inventory = expandToolAvailability( toolContract("binary_session").outputSchema.parse(status).result