test(llm): lock event reducer laws (#34423)

This commit is contained in:
Shoubhit Dash
2026-06-29 17:22:46 +05:30
committed by GitHub
parent b0151e1d02
commit e5101d9651
3 changed files with 50 additions and 3 deletions
@@ -395,6 +395,10 @@ describe("Anthropic Messages route", () => {
expect(response.events.find((event) => event.type === "reasoning-end")).toMatchObject({
providerMetadata: { anthropic: { signature: "sig_1" } },
})
expect(response.message.content).toEqual([
{ type: "text", text: "Hello!" },
{ type: "reasoning", text: "thinking", providerMetadata: { anthropic: { signature: "sig_1" } } },
])
expect(response.events.at(-1)).toMatchObject({
type: "finish",
reason: "stop",
@@ -778,6 +778,11 @@ describe("OpenAI Responses route", () => {
{ type: "step-finish", index: 0, reason: "stop" },
{ type: "finish", reason: "stop" },
])
expect(response.events.filter((event) => event.type === "finish")).toHaveLength(1)
expect(response.message.content).toEqual([
{ type: "reasoning", text: "thinking" },
{ type: "text", text: "Hello" },
])
}),
)