Skip to content

Commit 43b4936

Browse files
authored
docs(ai-chat): add the 4.5.0-rc.6 changelog entry (#3927)
## Summary Adds the 4.5.0-rc.6 entry to the AI chat changelog, covering the chat-facing items shipping in [#3870](#3870): the chat.agent reliability batch, the continuation boot latency fix, the chat.headStart hydration and reasoning fixes, the chat.createSession stop and continuation fixes, and the new trigger skills installer. Should merge alongside the release so the changelog matches the published version.
1 parent 3bc3a17 commit 43b4936

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

docs/ai-chat/changelog.mdx

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,72 @@ sidebarTitle: "Changelog"
44
description: "Pre-release updates for AI chat agents."
55
---
66

7+
<Update label="June 12, 2026" description="4.5.0-rc.6" tags={["SDK", "CLI", "Bug fix"]}>
8+
9+
## chat.agent reliability fixes
10+
11+
A batch of fixes for edge cases around message delivery, stopping, and error handling:
12+
13+
- **No more duplicate turns from mid-stream sends.** A user message sent while the agent was streaming could be delivered twice — once via steering and again on the next turn — running a duplicate turn. Delivery is now deduplicated.
14+
- **Idempotent input appends.** Sends to `session.in` carry an idempotency key, so a client retry after a network blip can't append the same message twice.
15+
- **Stop clears streaming state.** Stopping a generation now clears the session's streaming snapshot, so a page reload right after a stop no longer replays the stopped turn.
16+
- **`onTurnComplete` fires on errored turns.** When `run()` or a lifecycle hook throws, `onTurnComplete` now runs with `error` carrying the thrown value and `finishReason: "error"`, and the failed turn's user message is persisted so it isn't lost on the next run. Use this to mark the turn failed in your own storage. See [error handling](/ai-chat/error-handling#using-onturncomplete).
17+
18+
```ts
19+
onTurnComplete: async ({ chatId, uiMessages, stopped, error }) => {
20+
await db.chat.update({
21+
where: { id: chatId },
22+
data: {
23+
messages: uiMessages,
24+
lastTurnStatus: error ? "errored" : stopped ? "stopped" : "ok",
25+
},
26+
});
27+
},
28+
```
29+
- **Full tag sets on chat runs.** Runs triggered by chat sessions can now carry the full set of dashboard tags instead of being silently truncated.
30+
- **Stream hygiene for custom agents.** Manual `chat.writeTurnComplete()` callers now trim the output stream the way `chat.agent` does, sending a custom action no longer leaves a second stream reader running, and a long-lived `watch` subscription no longer grows its dedupe set without bound.
31+
32+
## Continuation boots no longer stall
33+
34+
Continuation runs (after a cancel, crash, or version upgrade) used to stall around 10 seconds before the first turn: finding the `session.in` resume cursor drained an SSE long-poll that always waited out its full 5 second inactivity window, twice per boot. The cursor is now found with a non-blocking records read, the boot reads run concurrently, and chat snapshots carry the cursor so subsequent boots skip the scan entirely.
35+
36+
## chat.headStart: hydration and reasoning fixes
37+
38+
Two fixes for the [Head Start](/ai-chat/fast-starts) handover:
39+
40+
- With `hydrateMessages` registered, the warm route's step-1 partial now reaches the agent's accumulator, so `onTurnComplete` carries the full first turn, tool-call handovers resume from step 2 instead of re-running step 1, and the assistant `messageId` stays stable across the handover.
41+
- Extended-thinking models' step-1 reasoning now lands in the durable session history (and `onTurnComplete`) under the same assistant `messageId`, with provider metadata intact so Anthropic thinking signatures survive replays.
42+
43+
## chat.createSession: stop and continuation fixes
44+
45+
Stopping a generation no longer wedges the run: `turn.complete()` bare-awaited the AI SDK's `totalUsage` promise, which never settles after a stop-abort, so the loop hung inside the stopped turn and the chat couldn't take another message. It's now raced with a timeout, the same guard `chat.agent`'s turn loop uses.
46+
47+
Continuation runs also no longer invoke the model with an empty prompt: a message-less continuation boot now waits for the next session input, and `turn.continuation` is preserved so your loop can seed stored history on the first turn:
48+
49+
```ts
50+
for await (const turn of session) {
51+
if (turn.continuation && turn.number === 0) {
52+
const stored = await loadMessages(turn.chatId);
53+
const incoming = turn.uiMessages.filter((m) => !stored.some((s) => s.id === m.id));
54+
await turn.setMessages([...stored, ...incoming]);
55+
}
56+
57+
// ... streamText + turn.complete as usual
58+
}
59+
```
60+
61+
See [chat.createSession](/ai-chat/backend#chat-createsession).
62+
63+
## trigger skills: agent skills for your coding assistant
64+
65+
The CLI's new `trigger skills` command installs Trigger.dev agent skills — including the chat.agent authoring skill — into your coding assistant's native skills directory (Claude Code, Cursor, GitHub Copilot, and AGENTS-compatible tools such as Codex). The skills ship inside the CLI, versioned with it, and `trigger dev` offers to install them on first run. `trigger init` can now also set up the MCP server and skills as part of project scaffolding.
66+
67+
```bash
68+
npx trigger.dev@4.5.0-rc.6 skills
69+
```
70+
71+
</Update>
72+
773
<Update label="June 5, 2026" description="4.5.0-rc.5" tags={["SDK", "Bug fix"]}>
874

975
## AI SDK 7 support

0 commit comments

Comments
 (0)