-
chore: release v4.5.0-rc.7 (#3932)
发布于
2026-06-17 12:14:38 +00:00 | 653 次提交 在此版本后已推送到 mainSummary
7 improvements.
Improvements
-
@trigger.dev/sdknow bundles the Trigger.dev agent skills and a
curated snapshot of the docs those skills reference. The skills that
trigger skillsinstalls into your coding agent read this content from
node_modules, so the guidance your AI assistant follows is pinned to the
SDK version installed in your project and stays current across upgrades
instead of going stale until the next reinstall.
(#3937) -
Running a CLI command like
dev,deploy,preview, orupdate
before initializing a project no longer crashes with a rawCannot find matching package.jsonstack trace. The CLI now detects the missing
project and points you tonpx trigger.dev@latest initinstead.
(#3929) -
The agent skills installed by
trigger skillsare now namespaced with
atrigger-prefix (e.g.trigger-authoring-tasks,
trigger-getting-started) so they don't collide with unrelated skills
in your coding agent's skills directory. Adds atrigger-cost-savings
skill for auditing and reducing compute spend (right-sizing machines,
maxDuration, batching, debounce), and@trigger.dev/sdknow bundles
the full Trigger.dev documentation so your agent can read the complete,
version-pinned reference directly from node_modules.
(#3970) -
The run span API response now includes
cachedCostand
cacheCreationCoston theaiobject, alongside the existing
inputCost/outputCost/totalCost.inputCostreflects only the
non-cached input, so these fields let you reconstruct the full cost
breakdown for prompt-cached calls.
(#3958) -
chat.headStartnow works with thechat.customAgentand
chat.createSessionbackends, not onlychat.agent. The warm step-1
response hands over to your loop the same way it does for a managed
agent. (#3963)In a
chat.customAgentloop, consume the handover on turn 0:const conversation = new chat.MessageAccumulator();
const { isFinal, skipped } = await conversation.consumeHandover({
payload });
if (skipped) return; // warm handler aborted, so exit without a turn
if (isFinal) {
await chat.writeTurnComplete(); // step 1 is the response, no streamText
} else {
const result = streamText({ model, messages: conversation.modelMessages,
tools });
// Pass originalMessages so the handed-over tool round merges into the
// step-1 assistant instead of starting a new message.
const response = await chat.pipeAndCapture(result, {
originalMessages: conversation.uiMessages,
});
if (response) await conversation.addResponse(response);
}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. - Cache your chat agent's system prompt with Anthropic prompt caching. `chat.toStreamTextOptions()` now emits 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. ([#3952](https://github.com/triggerdotdev/trigger.dev/pull/3952)) ```ts // at the streamText call site (Anthropic sugar) streamText({ ...chat.toStreamTextOptions({ cacheControl: { type: "ephemeral" } }), messages, }); // provider-agnostic equivalent chat.toStreamTextOptions({ systemProviderOptions: { anthropic: { cacheControl: { type: "ephemeral" } } }, }); // or where the prompt is defined chat.prompt.set(SYSTEM_PROMPT, { providerOptions: { anthropic: { cacheControl: { type: "ephemeral" } } }, });Without an option,
systemstays a plain string. Pairs with a
prepareMessagescache breakpoint to cache the conversation prefix
across turns too.-
Three fixes for custom agent loops (
chat.customAgent,
chat.createSession, and hand-rolledMessageAccumulatorloops):
(#3936) -
Continuation runs no longer replay already-answered user messages into
the first turn. The.inresume cursor is now seeded before any
listener attaches (the same boot logicchat.agentuses), so a chat
that continues after a cancel, crash, or upgrade only sees genuinely new
messages. -
Steering a hand-rolled loop mid-stream no longer wipes the in-flight
assistant response.chat.pipeAndCapturenow stamps a server-generated
message id on the stream, so aprepareStepinjection keeps the partial
text instead of replacing the message. -
Task-backed tools (
ai.toolExecute) now work from custom agent loops:
the parent's session is threaded to the child run, so child tasks can
stream progress into the chat withchat.stream.writer({ target: "root" })instead of failing with "session handle is not initialized".
Raw changeset output
⚠️⚠️⚠️⚠️⚠️⚠️
mainis currently in pre mode so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
changeset pre exitonmain.⚠️⚠️⚠️⚠️⚠️⚠️
Releases
@trigger.dev/build@4.5.0-rc.7
Patch Changes
- Updated dependencies:
@trigger.dev/core@4.5.0-rc.7
trigger.dev@4.5.0-rc.7
Patch Changes
@trigger.dev/sdknow bundles the Trigger.dev agent skills and a
curated snapshot of the docs those skills reference. The skills that
trigger skillsinstalls into your coding agent read this content from
node_modules, so the guidance your AI assistant follows is pinned to the
SDK version installed in your project and stays current across upgrades
instead of going stale until the next reinstall.
(#3937)- Running a CLI command like
dev,deploy,preview, orupdate
before initializing a project no longer crashes with a rawCannot find matching package.jsonstack trace. The CLI now detects the missing
project and points you tonpx trigger.dev@latest initinstead.
(#3929) - The agent skills installed by
trigger skillsare now namespaced with
atrigger-prefix (e.g.trigger-authoring-tasks,
trigger-getting-started) so they don't collide with unrelated skills
in your coding agent's skills directory. Adds atrigger-cost-savings
skill for auditing and reducing compute spend (right-sizing machines,
maxDuration, batching, debounce), and@trigger.dev/sdknow bundles
the full Trigger.dev documentation so your agent can read the complete,
version-pinned reference directly from node_modules.
(#3970) - Updated dependencies:
@trigger.dev/core@4.5.0-rc.7@trigger.dev/build@4.5.0-rc.7@trigger.dev/schema-to-json@4.5.0-rc.7
@trigger.dev/core@4.5.0-rc.7
Patch Changes
- The run span API response now includes
cachedCostand
cacheCreationCoston theaiobject, alongside the existing
inputCost/outputCost/totalCost.inputCostreflects only the
non-cached input, so these fields let you reconstruct the full cost
breakdown for prompt-cached calls.
(#3958)
@trigger.dev/python@4.5.0-rc.7
Patch Changes
- Updated dependencies:
@trigger.dev/sdk@4.5.0-rc.7@trigger.dev/core@4.5.0-rc.7@trigger.dev/build@4.5.0-rc.7
@trigger.dev/react-hooks@4.5.0-rc.7
Patch Changes
- Updated dependencies:
@trigger.dev/core@4.5.0-rc.7
@trigger.dev/redis-worker@4.5.0-rc.7
Patch Changes
- Updated dependencies:
@trigger.dev/core@4.5.0-rc.7
@trigger.dev/rsc@4.5.0-rc.7
Patch Changes
- Updated dependencies:
@trigger.dev/core@4.5.0-rc.7
@trigger.dev/schema-to-json@4.5.0-rc.7
Patch Changes
- Updated dependencies:
@trigger.dev/core@4.5.0-rc.7
@trigger.dev/sdk@4.5.0-rc.7
Patch Changes
-
@trigger.dev/sdknow bundles the Trigger.dev agent skills and a
curated snapshot of the docs those skills reference. The skills that
trigger skillsinstalls into your coding agent read this content from
node_modules, so the guidance your AI assistant follows is pinned to the
SDK version installed in your project and stays current across upgrades
instead of going stale until the next reinstall.
(#3937) -
chat.headStartnow works with thechat.customAgentand
chat.createSessionbackends, not onlychat.agent. The warm step-1
response hands over to your loop the same way it does for a managed
agent. (#3963)In a
chat.customAgentloop, consume the handover on turn 0:const conversation = new chat.MessageAccumulator();
const { isFinal, skipped } = await conversation.consumeHandover({
payload });
if (skipped) return; // warm handler aborted, so exit without a turn
if (isFinal) {
await chat.writeTurnComplete(); // step 1 is the response, no streamText
} else {
const result = streamText({ model, messages: conversation.modelMessages,
tools });
// Pass originalMessages so the handed-over tool round merges into the
// step-1 assistant instead of starting a new message.
const response = await chat.pipeAndCapture(result, {
originalMessages: conversation.uiMessages,
});
if (response) await conversation.addResponse(response);
}
```With
chat.createSession, the iterator surfaces it asturn.handover;
callturn.complete()with no argument on a final handover. The
lower-levelchat.waitForHandover()andaccumulator.applyHandover()
are also exported for hand-rolled loops.-
Add
triggerConfigsupport tochat.headStart()and
chat.openSession(), so the auto-triggered handover-prepare run
inherits tags, queue, machine, and other session trigger options the
same waychat.createStartSessionAction()does. Thechat:{chatId}tag
is prepended automatically.
(#3963)export const POST = chat.headStart({ agentId: "my-agent", triggerConfig: { tags: ["org:acme"], queue: "chat" },
run: async ({ chat }) => streamText({ ...chat.toStreamTextOptions(),
model }),
});
```Because the session is created once on the first head-start turn and is
idempotent on the chat id, this is the only place to set those options
for a head-start chat's lifetime.chat.createStartSessionAction()now
also forwardsmaxDuration,region, andlockToVersionso both
session entry points stay consistent.-
Cache your chat agent's system prompt with Anthropic prompt caching.
chat.toStreamTextOptions()now emits 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.
(#3952)// at the streamText call site (Anthropic sugar) streamText({
...chat.toStreamTextOptions({ cacheControl: { type: "ephemeral" } }),
messages,
});// provider-agnostic equivalent chat.toStreamTextOptions({systemProviderOptions: { anthropic: { cacheControl: { type: "ephemeral"
} } },
});// or where the prompt is defined chat.prompt.set(SYSTEM_PROMPT, {providerOptions: { anthropic: { cacheControl: { type: "ephemeral" } } },
});
```Without an option,
systemstays a plain string. Pairs with a
prepareMessagescache breakpoint to cache the conversation prefix
across turns too.-
Three fixes for custom agent loops (
chat.customAgent,
chat.createSession, and hand-rolledMessageAccumulatorloops):
(#3936) -
Continuation runs no longer replay already-answered user messages into
the first turn. The.inresume cursor is now seeded before any
listener attaches (the same boot logicchat.agentuses), so a chat
that continues after a cancel, crash, or upgrade only sees genuinely new
messages. -
Steering a hand-rolled loop mid-stream no longer wipes the in-flight
assistant response.chat.pipeAndCapturenow stamps a server-generated
message id on the stream, so aprepareStepinjection keeps the partial
text instead of replacing the message. -
Task-backed tools (
ai.toolExecute) now work from custom agent loops:
the parent's session is threaded to the child run, so child tasks can
stream progress into the chat withchat.stream.writer({ target: "root" })instead of failing with "session handle is not initialized". -
The agent skills installed by
trigger skillsare now namespaced with
atrigger-prefix (e.g.trigger-authoring-tasks,
trigger-getting-started) so they don't collide with unrelated skills
in your coding agent's skills directory. Adds atrigger-cost-savings
skill for auditing and reducing compute spend (right-sizing machines,
maxDuration, batching, debounce), and@trigger.dev/sdknow bundles
the full Trigger.dev documentation so your agent can read the complete,
version-pinned reference directly from node_modules.
(#3970) -
Updated dependencies:
@trigger.dev/core@4.5.0-rc.7
@trigger.dev/plugins@4.5.0-rc.7
Patch Changes
- Updated dependencies:
@trigger.dev/core@4.5.0-rc.7
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
下载附件
-