You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Lazy assistant message creation: `StreamProcessor` now defers creating the assistant message until the first content-bearing chunk arrives (text, tool call, thinking, or error), eliminating empty `parts: []` messages from appearing during auto-continuation when the model returns no content
- Add `getCurrentAssistantMessageId()` to check if a message was created
15
+
-**Rewrite `uiMessageToModelMessages()` to preserve part ordering**: the function now walks parts sequentially instead of separating by type, producing correctly interleaved assistant/tool messages (text1 + toolCall1 → toolResult1 → text2 + toolCall2 → toolResult2) instead of concatenating all text and batching all tool calls. This fixes multi-round tool flows where the model would see garbled conversation history and re-call tools unnecessarily.
16
+
- Deduplicate tool result messages: when a client tool has both a `tool-result` part and a `tool-call` part with `output`, only one `role: 'tool'` message is emitted per tool call ID
17
+
18
+
**Client (@tanstack/ai-client):**
19
+
20
+
- Update `ChatClient.processStream()` to use lazy assistant message creation, preventing UI flicker from empty messages being created then removed
21
+
22
+
**Anthropic:**
23
+
24
+
- Fix consecutive user-role messages violating Anthropic's alternating role requirement by merging them in `formatMessages`
25
+
- Deduplicate `tool_result` blocks with the same `tool_use_id`
26
+
- Filter out empty assistant messages from conversation history
27
+
- Suppress duplicate `RUN_FINISHED` event from `message_stop` when `message_delta` already emitted one
28
+
- Fix `TEXT_MESSAGE_END` incorrectly emitting for `tool_use` content blocks
29
+
- Add Claude Opus 4.6 model support with adaptive thinking and effort parameter
30
+
31
+
**Gemini:**
32
+
33
+
- Fix consecutive user-role messages violating Gemini's alternating role requirement by merging them in `formatMessages`
34
+
- Deduplicate `functionResponse` parts with the same name (tool call ID)
35
+
- Filter out empty model messages from conversation history
Tighten the AG-UI adapter contract and simplify the core stream processor.
8
+
9
+
**Breaking type changes:**
10
+
11
+
-`TextMessageContentEvent.delta` is now required (was optional)
12
+
-`StepFinishedEvent.delta` is now required (was optional)
13
+
14
+
All first-party adapters already sent `delta` on every event, so this is a type-level enforcement of existing behavior. Community adapters that follow the reference implementations will not need code changes.
15
+
16
+
**Core processor simplifications:**
17
+
18
+
-`TEXT_MESSAGE_START` now resets text segment state, replacing heuristic overlap detection
19
+
-`TOOL_CALL_END` is now the authoritative signal for tool call input completion
20
+
- Removed delta/content fallback logic, whitespace-only message cleanup, and finish-reason conflict arbitration from the processor
21
+
22
+
**Adapter fixes:**
23
+
24
+
- Gemini: filter whitespace-only text parts, fix STEP_FINISHED content accumulation, emit fresh TEXT_MESSAGE_START after tool calls
25
+
- Anthropic: emit fresh TEXT_MESSAGE_START after tool_use blocks for proper text segmentation
0 commit comments