Skip to content

Commit 2daa141

Browse files
cliffhallclaude
andcommitted
test(everything): mark the tests that pin known bugs
These suites are characterization tests: they assert current behavior so the SDK v2 migration can show it changed nothing. Some of them pin behavior that is wrong. Each of those now carries a uniform marker immediately above its test declaration: // KNOWN BUG #<issue>: pins current (wrong) behavior; the fix changes this assertion. // KNOWN BUG (no issue): <what is wrong>; the fix changes this assertion. so `git grep "KNOWN BUG"` lists exactly the tests a bug fix is expected to change. Regression guards for fixed bugs, correct SDK-mandated behavior (the #3267 priming event) and pins of intended design carry no marker. Comments only; no assertion changes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: cliffhall <[email protected]>
1 parent c82b737 commit 2daa141

9 files changed

Lines changed: 18 additions & 0 deletions

‎src/everything/__tests__/gzip-file-as-resource.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ describe("gzip-file-as-resource", () => {
150150
expect(gunzipSync(blob).toString()).toBe("second");
151151
});
152152

153+
// KNOWN BUG #4808: pins current (wrong) behavior; the fix changes this assertion.
153154
it("evicts another session's resource of the same name (#4808)", async () => {
154155
// Characterization of #4808: session resources are tracked in one
155156
// module-level map keyed by URI, so the second session's registration

‎src/everything/__tests__/prompts.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ describe("resource-prompt", () => {
9696
});
9797
});
9898

99+
// KNOWN BUG (no issue): blobResource() labels blob content text/plain instead of a binary MIME type; the fix changes this assertion.
99100
it("embeds a blob resource", async () => {
100101
const result = await session.client.getPrompt({
101102
name: "resource-prompt",

‎src/everything/__tests__/resources.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ describe("dynamic resource templates", () => {
6161
]);
6262
});
6363

64+
// KNOWN BUG (no issue): blobResource() labels blob content text/plain instead of a binary MIME type; the fix changes this assertion.
6465
it("fabricates a blob resource from its id, labelled text/plain", async () => {
6566
// Characterization: the template advertises application/octet-stream,
6667
// but the content says text/plain (#4854 baseline).

‎src/everything/__tests__/sampling-elicitation.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ describe("trigger-elicitation-request", () => {
388388
expect(texts[0]).toBe("⚠️ User cancelled the elicitation dialog.");
389389
});
390390

391+
// KNOWN BUG (no issue): trigger-elicitation-request is listed for a URL-only elicitation client, whose call then fails; the fix changes this assertion.
391392
it("is listed for a URL-only client, which then cannot answer its form request", async () => {
392393
// Characterization: the tool is gated on `elicitation` alone, so a
393394
// client that declared only URL mode sees it and the call fails.

‎src/everything/__tests__/sse.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ describe("SSE transport", () => {
8383
await Promise.all([a.client.close(), b.client.close()]);
8484
});
8585

86+
// KNOWN BUG (no issue): POST /message for an unknown session is never answered; the fix changes this assertion.
8687
it("forgets the session and cleans up when the stream closes", async () => {
8788
const { client, sessionId } = await connectSse();
8889
await client.close();
@@ -104,6 +105,7 @@ describe("SSE transport", () => {
104105
);
105106
});
106107

108+
// KNOWN BUG (no issue): POST /message for an unknown session is never answered; the fix changes this assertion.
107109
it("never answers a POST for an unknown session", async () => {
108110
expect(
109111
await respondsWithin(`${base}/message?sessionId=nope`, {
@@ -114,6 +116,7 @@ describe("SSE transport", () => {
114116
expect(error).toHaveBeenCalledWith("No transport found for sessionId nope");
115117
});
116118

119+
// KNOWN BUG (no issue): a second GET /sse for an existing session is never answered; the fix changes this assertion.
117120
it("never answers a second GET /sse for an existing session, and only logs it", async () => {
118121
const { client, sessionId } = await connectSse();
119122
expect(await respondsWithin(`${base}/sse?sessionId=${sessionId}`, {})).toBe(
@@ -126,6 +129,7 @@ describe("SSE transport", () => {
126129
await client.close();
127130
});
128131

132+
// KNOWN BUG (no issue): GET /sse?sessionId=<unknown> throws a TypeError that surfaces as a 500; the fix changes this assertion.
129133
it("fails a GET /sse for an unknown session id with a 500", async () => {
130134
// Characterization: the reconnect branch reads `.sessionId` of a missing
131135
// transport, and Express turns the TypeError into a 500.

‎src/everything/__tests__/streamable-http.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ describe("Streamable HTTP transport", () => {
158158
});
159159
});
160160

161+
// KNOWN BUG #4087: pins current (wrong) behavior; the fix changes this assertion.
161162
it("replays events from other streams after a Last-Event-ID (#4087)", async () => {
162163
// Characterization of #4087: the in-memory event store replays every
163164
// event stored after the given one, whatever stream it belongs to, so a
@@ -240,6 +241,7 @@ describe("Streamable HTTP transport", () => {
240241
},
241242
);
242243

244+
// KNOWN BUG (no issue): answers 400, not the 404 the spec requires, for an unknown or terminated session ID; the fix changes this assertion.
243245
it.each(["GET", "DELETE"])(
244246
"answers %s for an unknown session with a 400",
245247
async (method) => {
@@ -252,6 +254,7 @@ describe("Streamable HTTP transport", () => {
252254
},
253255
);
254256

257+
// KNOWN BUG (no issue): answers 400, not the 404 the spec requires, for an unknown or terminated session ID, and the error omits the request id; the fix changes this assertion.
255258
it("answers a POST for an unknown session with a 400 that omits the request id", async () => {
256259
// Characterization: no body parser runs before this check, so
257260
// `req.body` is undefined and the error carries no `id`.
@@ -272,6 +275,7 @@ describe("Streamable HTTP transport", () => {
272275
});
273276
});
274277

278+
// KNOWN BUG (no issue): answers 400, not the 404 the spec requires, for an unknown or terminated session ID; the fix changes this assertion.
275279
it("ends a session on DELETE, cleaning it up and refusing it afterwards", async () => {
276280
const { client, transport, sessionId } = await connectHttp();
277281
await transport.terminateSession();
@@ -374,6 +378,7 @@ describe("Streamable HTTP transport", () => {
374378
});
375379

376380
describe("shutdown", () => {
381+
// KNOWN BUG (no issue): the SIGINT handler walks the session Map with for...in, so it never closes a session; the fix changes this assertion.
377382
it("logs and exits 0 without closing any session", async () => {
378383
// Characterization: the handler walks the session Map with `for...in`,
379384
// which visits no entries, so no transport is closed (#4854 baseline).

‎src/everything/__tests__/surface.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ describe("initialize", () => {
6363
);
6464
});
6565

66+
// KNOWN BUG #4792: pins current (wrong) behavior; the fix changes this assertion.
6667
it("names capability-gated tools in its instructions even for a client that cannot see them (#4792)", async () => {
6768
// Characterization of #4792: the instructions are static, so a client
6869
// that declares no sampling, elicitation or roots capability is told

‎src/everything/__tests__/tasks.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ describe("trigger-sampling-request-async", () => {
422422
);
423423
});
424424

425+
// KNOWN BUG (no issue): trigger-sampling-request-async drops the status message of a task that is already finished when created; the fix changes this assertion.
425426
it("does not poll a client task that is already finished when it is created", async () => {
426427
// Characterization: the status message is only read from polls, so a
427428
// task that fails before it is returned is reported with "No message".
@@ -585,6 +586,7 @@ describe("trigger-elicitation-request-async", () => {
585586
);
586587
});
587588

589+
// KNOWN BUG (no issue): trigger-elicitation-request-async polls for longer than the 10-minute TTL it requests for its task; the fix changes this assertion.
588590
it("fails on the last poll instead when the client honors the 10-minute TTL", async () => {
589591
// Characterization: 600 one-second polls outlast the 600000 ms TTL the
590592
// tool asks for, so a client that expires the task on time answers the

‎src/everything/__tests__/tools.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ describe("trigger-long-running-operation", () => {
206206
});
207207

208208
describe("get-resource-links", () => {
209+
// KNOWN BUG (no issue): blobResource() labels blob content text/plain instead of a binary MIME type; the fix changes this assertion.
209210
it("returns three links by default, blob for odd ids and text for even", async () => {
210211
const result = await call("get-resource-links");
211212
const content = contentOf(result);
@@ -270,6 +271,7 @@ describe("get-resource-reference", () => {
270271
);
271272
});
272273

274+
// KNOWN BUG (no issue): blobResource() labels blob content text/plain instead of a binary MIME type; the fix changes this assertion.
273275
it("returns an embedded blob resource", async () => {
274276
const result = await call("get-resource-reference", {
275277
resourceType: "Blob",

0 commit comments

Comments
 (0)