test(release): tolerate OpenAI replay id preservation

This commit is contained in:
Peter Steinberger
2026-05-01 20:47:39 +01:00
parent f05723e0c4
commit a256745323

View File

@@ -261,9 +261,21 @@ describeLive("openai reasoning compat live", () => {
"toolResult",
"user",
]);
const assistantToolIds = (
((sanitized[1] as { content?: unknown }).content ?? []) as unknown[]
)
.filter(
(block): block is { type: "toolCall"; id: string } =>
typeof block === "object" &&
block !== null &&
(block as { type?: unknown }).type === "toolCall" &&
typeof (block as { id?: unknown }).id === "string",
)
.map((block) => block.id);
expect(assistantToolIds).toHaveLength(3);
expect(
sanitized.slice(2, 5).map((message) => (message as { toolCallId?: string }).toolCallId),
).toEqual(["callkeep", "callmissinga", "callmissingb"]);
).toEqual(assistantToolIds);
expect(
sanitized
.slice(3, 5)