mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-06 15:18:58 +00:00
test(release): tolerate OpenAI replay id preservation
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user