Skip to content

Commit e5fca6b

Browse files
authored
docs(ai-chat): add the 4.5.0-rc.7 changelog entry (#3991)
## Summary Adds the `4.5.0-rc.7` entry to the AI chat changelog, covering the agent-facing changes in [v4.5.0-rc.7](https://github.com/triggerdotdev/trigger.dev/releases/tag/v4.5.0-rc.7): - `chat.headStart` now works with the `chat.customAgent` and `chat.createSession` backends, not just `chat.agent` - Opt-in Anthropic system-prompt caching via `chat.toStreamTextOptions()` - Three custom-agent-loop fixes: continuation replay, mid-stream steering, and task-backed tools - `trigger skills` follow-ups: `trigger-` namespacing, SDK-bundled docs, and a new cost-savings skill Generic, non-agent rc.7 items (the CLI uninitialized-project error message, run-span cost fields) are intentionally left out to keep this changelog scoped to AI chat agents.
1 parent c97d246 commit e5fca6b

1 file changed

Lines changed: 75 additions & 0 deletions

File tree

docs/ai-chat/changelog.mdx

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

7+
<Update label="June 17, 2026" description="4.5.0-rc.7" tags={["SDK", "CLI", "Bug fix"]}>
8+
9+
## chat.headStart now works for custom agents and sessions
10+
11+
[Head Start](/ai-chat/fast-starts#head-start) — running the first `streamText` step in your warm server while the agent boots in parallel — now works with the `chat.customAgent` and `chat.createSession` backends, not just the managed `chat.agent`. The warm step-1 response hands over to your loop the same way it does for a managed agent. ([#3963](https://github.com/triggerdotdev/trigger.dev/pull/3963))
12+
13+
In a `chat.customAgent` loop, consume the handover on turn 0:
14+
15+
```ts
16+
const conversation = new chat.MessageAccumulator();
17+
const { isFinal, skipped } = await conversation.consumeHandover({ payload });
18+
if (skipped) return; // warm handler aborted, so exit without a turn
19+
if (isFinal) {
20+
await chat.writeTurnComplete(); // step 1 is the response, no streamText
21+
} else {
22+
const result = streamText({ model, messages: conversation.modelMessages, tools });
23+
// Pass originalMessages so the handed-over tool round merges into the
24+
// step-1 assistant instead of starting a new message.
25+
const response = await chat.pipeAndCapture(result, {
26+
originalMessages: conversation.uiMessages,
27+
});
28+
if (response) await conversation.addResponse(response);
29+
}
30+
```
31+
32+
With `chat.createSession`, the iterator surfaces it as `turn.handover`; call `turn.complete()` with no argument on a final handover. The lower-level `chat.waitForHandover()` and `accumulator.applyHandover()` are also exported for hand-rolled loops. See [Handover with custom agents](/ai-chat/fast-starts#handover-with-custom-agents).
33+
34+
## Cache your system prompt with Anthropic prompt caching
35+
36+
`chat.toStreamTextOptions()` can now emit the system prompt as a cacheable message when you opt in, so a large, stable system block is billed at cache-read rates on every turn instead of full price. Without an option, `system` stays a plain string. ([#3952](https://github.com/triggerdotdev/trigger.dev/pull/3952))
37+
38+
```ts
39+
// at the streamText call site (Anthropic sugar)
40+
streamText({
41+
...chat.toStreamTextOptions({ cacheControl: { type: "ephemeral" } }),
42+
messages,
43+
});
44+
45+
// provider-agnostic equivalent
46+
chat.toStreamTextOptions({
47+
systemProviderOptions: { anthropic: { cacheControl: { type: "ephemeral" } } },
48+
});
49+
50+
// or where the prompt is defined
51+
chat.prompt.set(SYSTEM_PROMPT, {
52+
providerOptions: { anthropic: { cacheControl: { type: "ephemeral" } } },
53+
});
54+
```
55+
56+
Pairs with a `prepareMessages` cache breakpoint to cache the conversation prefix across turns too. See the [Prompt caching](/ai-chat/prompt-caching) guide.
57+
58+
## Custom agent loop fixes
59+
60+
Three fixes for custom agent loops (`chat.customAgent`, `chat.createSession`, and hand-rolled `MessageAccumulator` loops): ([#3936](https://github.com/triggerdotdev/trigger.dev/pull/3936))
61+
62+
- **Continuations no longer replay answered messages.** The `.in` resume cursor is now seeded before any listener attaches (the same boot logic `chat.agent` uses), so a chat that continues after a cancel, crash, or upgrade only sees genuinely new messages.
63+
- **Steering mid-stream keeps the in-flight response.** `chat.pipeAndCapture` now stamps a server-generated message id on the stream, so a `prepareStep` injection keeps the partial text instead of replacing the message.
64+
- **Task-backed tools work from custom loops.** `ai.toolExecute` now threads the parent's session to the child run, so child tasks can stream progress into the chat with `chat.stream.writer({ target: "root" })` instead of failing with "session handle is not initialized".
65+
66+
See [Custom agents](/ai-chat/custom-agents).
67+
68+
## trigger skills: namespacing, docs bundling, and a cost-savings skill
69+
70+
Follow-ups to the [`trigger skills`](/ai-chat/patterns/skills) command shipped in rc.6:
71+
72+
- The skills installed into your coding assistant are now namespaced with a `trigger-` prefix (e.g. `trigger-authoring-tasks`, `trigger-getting-started`) so they don't collide with unrelated skills in your skills directory. ([#3970](https://github.com/triggerdotdev/trigger.dev/pull/3970))
73+
- `@trigger.dev/sdk` now bundles the Trigger.dev agent skills and the full Trigger.dev documentation those skills reference. The installed skills read this content from `node_modules`, so the guidance your AI assistant follows is pinned to the SDK version in your project and stays current across upgrades instead of going stale until the next reinstall. ([#3937](https://github.com/triggerdotdev/trigger.dev/pull/3937), [#3970](https://github.com/triggerdotdev/trigger.dev/pull/3970))
74+
- New `trigger-cost-savings` skill for auditing and reducing compute spend — right-sizing machines, `maxDuration`, batching, and debounce. ([#3970](https://github.com/triggerdotdev/trigger.dev/pull/3970))
75+
76+
```bash
77+
npx trigger.dev@4.5.0-rc.7 skills
78+
```
79+
80+
</Update>
81+
782
<Update label="June 12, 2026" description="4.5.0-rc.6" tags={["SDK", "CLI", "Bug fix"]}>
883

984
## chat.agent reliability fixes

0 commit comments

Comments
 (0)