Skip to content

Commit a256745

Browse files
committed
test(release): tolerate OpenAI replay id preservation
1 parent f05723e commit a256745

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/agents/openai-reasoning-compat.live.test.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,21 @@ describeLive("openai reasoning compat live", () => {
261261
"toolResult",
262262
"user",
263263
]);
264+
const assistantToolIds = (
265+
((sanitized[1] as { content?: unknown }).content ?? []) as unknown[]
266+
)
267+
.filter(
268+
(block): block is { type: "toolCall"; id: string } =>
269+
typeof block === "object" &&
270+
block !== null &&
271+
(block as { type?: unknown }).type === "toolCall" &&
272+
typeof (block as { id?: unknown }).id === "string",
273+
)
274+
.map((block) => block.id);
275+
expect(assistantToolIds).toHaveLength(3);
264276
expect(
265277
sanitized.slice(2, 5).map((message) => (message as { toolCallId?: string }).toolCallId),
266-
).toEqual(["callkeep", "callmissinga", "callmissingb"]);
278+
).toEqual(assistantToolIds);
267279
expect(
268280
sanitized
269281
.slice(3, 5)

0 commit comments

Comments
 (0)