Skip to content

Commit 216a4e0

Browse files
committed
test(claude): cover indexed reasoning content parts
1 parent b23cc1f commit 216a4e0

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎tests/claude-outbound.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,17 @@ describe("claude outbound SSE", () => {
259259
expect(msg2.content.find((b: Record<string, unknown>) => b.type === "thinking").thinking).toBe("AB");
260260
});
261261

262+
test("indexed reasoning content parts get the separator too", async () => {
263+
const indexedContent = [
264+
sse("response.created", { response: { id: "resp_1", status: "in_progress" } }),
265+
sse("response.reasoning_text.delta", { item_id: "rs_1", output_index: 0, content_index: 0, delta: "A" }),
266+
sse("response.reasoning_text.delta", { item_id: "rs_1", output_index: 0, content_index: 1, delta: "B" }),
267+
sse("response.completed", { response: { status: "completed", usage: { input_tokens: 1, output_tokens: 1 } } }),
268+
].join("");
269+
const msg = await collectAnthropicMessage(responsesSseToAnthropicSse(streamFrom(indexedContent), "m"), "m") as Record<string, any>;
270+
expect(msg.content.find((b: Record<string, unknown>) => b.type === "thinking").thinking).toBe("A\n\nB");
271+
});
272+
262273
test("data-only Responses frames infer event names from payload types", async () => {
263274
const upstream = [
264275
dataOnlySse({ type: "response.created", response: { id: "resp_data_only", status: "in_progress" } }),

0 commit comments

Comments
 (0)