|
1 | 1 | # @copilotkit/aimock |
2 | 2 |
|
| 3 | +## [1.16.4] - 2026-04-30 |
| 4 | + |
| 5 | +### Fixed |
| 6 | + |
| 7 | +- **Router: `toolCallId` matched stale tool messages from history**. The matcher previously used `getLastMessageByRole(messages, "tool")`, so once a conversation contained any prior tool result, every subsequent request still had a "last tool message" buried in history — a `toolCallId` fixture could win and shadow `userMessage` matchers for new user turns. Tightened to require the tool message to be the **last** message in the request (which is the only state in which the LLM is being asked to respond to a tool result). Surfaced as: in CopilotKit's beautiful-chat showcase, clicking a second suggestion replayed the first chart's content fixture instead of producing a new tool call. |
| 8 | + |
| 9 | +## [1.16.3] - 2026-04-29 |
| 10 | + |
| 11 | +### Fixed |
| 12 | + |
| 13 | +- **Responses API**: `response.function_call_arguments.done` events now include `item_id` field, matching the real OpenAI Responses API shape. Without this, TanStack AI's OpenAI adapter emits `TOOL_CALL_END` with `toolCallId: undefined`, breaking ag-ui verify middleware. |
| 14 | + |
| 15 | +## [1.16.2] - 2026-04-28 |
| 16 | + |
| 17 | +### Fixed |
| 18 | + |
| 19 | +- **Bedrock invoke native stream format** — `invoke-with-response-stream` now emits Anthropic-native snake_case payloads (`content_block_delta`, `input_json_delta`) wrapped in Bedrock EventStream `chunk` frames, instead of Converse-style camelCase events. Converse-stream retains camelCase format. (PR #144, sf-jin-ku) |
| 20 | +- **Bedrock invoke false-green test** — Reasoning negative test used wrong event filters, masking a real bug; corrected to match actual stream shape (PR #144) |
| 21 | +- **Bedrock invoke/stream hardening** — Set `completionReq.stream = true` in streaming handler; use deterministic `tool_use_${index}` fallback IDs; change `textContent || null` to `?? null` to preserve empty strings; warn on unsupported content block types and unexpected roles; add webSearches warning on tool-call-only responses |
| 22 | +- **Converse stream shape alignment** — Wrap `contentBlockStop` and `messageStop` payloads to match real AWS Converse API; remove duplicate top-level `contentBlockIndex` from `contentBlockStart`/`contentBlockDelta`; add trailing `metadata` events (usage + latencyMs) to all stream builders |
| 23 | +- **Converse request conversion** — Filter empty-string text blocks in all paths; unwrap `inputSchema` from `{ json: {...} }` Converse API wrapper; set `completionReq.stream = true` in streaming handler; add content-loss warnings for non-text blocks; fix error type `||` to `??` |
| 24 | + |
| 25 | +### Changed |
| 26 | + |
| 27 | +- Extract shared test helpers (`createMockReq`/`createMockRes`/`createDefaults`) into `helpers/mock-res.ts` |
| 28 | +- Convert reasoning-all-providers tests to per-test server lifecycle |
| 29 | +- Add content+toolCalls streaming integration coverage for both invoke and converse paths (PR #144) |
| 30 | + |
| 31 | +## [1.16.1] - 2026-04-28 |
| 32 | + |
| 33 | +### Fixed |
| 34 | + |
| 35 | +- **Responses API: item_reference dropped** — `responsesInputToMessages()` now synthesizes an assistant message with a matching `function_call` when a `function_call_output` has no prior matching call, preventing item_reference loss |
| 36 | +- **Responses API: annotations missing** — Added `annotations: []` to all four `output_text` content items (streaming `.added`, `.done`, prefix, and non-streaming) for schema conformance |
| 37 | +- **Responses API: item_id missing on reasoning events** — Added `item_id` to `reasoning_summary_part.added`, `reasoning_summary_part.done`, and `reasoning_summary_text.done` events |
| 38 | +- **Responses API: web_search_call action missing type** — Changed `action: { query }` to `action: { type: "search", query }` in both streaming events and output prefix |
| 39 | +- **Responses API: item_reference for text messages** — Extended item_reference handling to cover assistant text messages, not just function_call_output compensation |
| 40 | +- **Responses API: multi-fco assistantCount inflation** — Fixed backward scan in `responsesInputToMessages()` to find and append to existing assistant messages with tool_calls instead of creating duplicates |
| 41 | + |
| 42 | +### Added |
| 43 | + |
| 44 | +- **Debug logging across all LLM handlers** — Added `logger.debug("Fixture matched: ...")` on match and `logger.debug("No fixture matched...")` on no-match to: server.ts, responses.ts, messages.ts, gemini.ts, bedrock.ts, bedrock-converse.ts, cohere.ts, ollama.ts, embeddings.ts, images.ts, speech.ts, transcription.ts, video.ts |
| 45 | + |
| 46 | +## 1.16.0 |
| 47 | + |
| 48 | +### Added |
| 49 | + |
| 50 | +- **`turnIndex` match criterion**: Stateless conversation-depth matching — counts `role: "assistant"` messages in the request's message array. Use for multi-turn conversation flows in shared/deployed instances where `sequenceIndex` counters break under concurrency. `turnIndex: 0` matches the first turn (no prior assistant messages), `turnIndex: 1` the second, etc. |
| 51 | +- **`hasToolResult` match criterion**: Stateless boolean — `true` when any `role: "tool"` message exists in the request, `false` when none do. Simplest option for 2-step HITL flows (tool call → tool result → follow-up). |
| 52 | +- `onTurn(turn, pattern, response, opts)` convenience method on the programmatic API. |
| 53 | + |
3 | 54 | ## 1.15.1 |
4 | 55 |
|
5 | 56 | ### Fixed |
|
0 commit comments