From 078191624ee292fba91cfe7f7c41b9ad094ced90 Mon Sep 17 00:00:00 2001 From: Grady Dillon Date: Sun, 26 Jul 2026 01:38:46 -0400 Subject: [PATCH] Stub both poll routes so the test doesn't pin an SDK detail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two cases stubbed GET /bulk/{id} because that is where the SDK's getJob happened to look. That is the SDK's implementation detail, not this layer's contract — and it just moved to the kind-agnostic /jobs/{id}. These tests are about the MCP layer's structured output, so pinning one path made them fail on an SDK upgrade that changed nothing here. Stub both, and they pass against either SDK version. Co-Authored-By: Claude Opus 5 --- test/structured-output.test.mjs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/structured-output.test.mjs b/test/structured-output.test.mjs index 0c16d87..7e3456f 100644 --- a/test/structured-output.test.mjs +++ b/test/structured-output.test.mjs @@ -196,7 +196,15 @@ test("extract returns typed structured content alongside the text block", async }); test("get_job returns job state as real JSON types, not prose", async () => { - const restore = stubFetch({ "GET /bulk/job_abc": BULK_BODY }); + // Both routes are stubbed on purpose. Which URL the SDK polls is its + // implementation detail — it moved from /bulk/{id} to the kind-agnostic + // /jobs/{id} — and this test is about the MCP layer's structured output, + // not the SDK's routing. Pinning one path would make it fail on an SDK + // upgrade that changed nothing here. + const restore = stubFetch({ + "GET /jobs/job_abc": BULK_BODY, + "GET /bulk/job_abc": BULK_BODY, + }); try { const res = await callTool("get_job", { job_id: "job_abc" }); const sc = res.structuredContent; @@ -225,8 +233,10 @@ test("get_job returns job state as real JSON types, not prose", async () => { test("a finished job with no results still validates", async () => { // The empty-results branch renders "(no results)" as text; the structured // side must stay a real empty array rather than that string. + const EMPTY = { ...BULK_BODY, job_id: "job_empty", total: 0, completed: 0, results: [] }; const restore = stubFetch({ - "GET /bulk/job_empty": { ...BULK_BODY, job_id: "job_empty", total: 0, completed: 0, results: [] }, + "GET /jobs/job_empty": EMPTY, + "GET /bulk/job_empty": EMPTY, }); try { const res = await callTool("get_job", { job_id: "job_empty" });