mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
9845dadebb
Bug: in a single chat session, running both HITL booking flows back-to-back (Alice 1:1 → then Sales call without refresh) used to skip the time-picker on the second flow and jump straight to "Booked ..." text. Cause: confirmation fixtures were matched on `hasToolResult: true`, which fires whenever the conversation has ANY tool message in history. After the first flow finished, the second user message short-circuited to a confirmation match before the second flow's toolCall fixture (gated on `hasToolResult: false`) had a chance to fire. The picker never rendered. Fix: re-key the two confirmation fixtures on `toolCallId` (the specific tool_call_id of the matching `book_call` invocation), which only fires when the LAST conversation message is a tool result with that id — exactly the moment we want the confirmation. Drop the `hasToolResult: false` constraint on the toolCall fixtures so they match a fresh user request regardless of prior tool history. Add a back-to-back regression test to all 17 hitl-in-chat specs: walk Alice flow to completion, then sales flow without refresh, assert two `time-picker-card` elements rendered. If the multi-flow regression returns, the second card never appears and the test fails at `toHaveCount(2)`.