Skip to content

Commit 2e8f597

Browse files
authored
Merge branch 'main' into fix/prisma-infra-error-leak
2 parents a068023 + 4e919e7 commit 2e8f597

104 files changed

Lines changed: 4514 additions & 528 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
"@trigger.dev/sdk": patch
3+
---
4+
5+
`chat.headStart` now works with the `chat.customAgent` and `chat.createSession` backends, not only `chat.agent`. The warm step-1 response hands over to your loop the same way it does for a managed agent.
6+
7+
In a `chat.customAgent` loop, consume the handover on turn 0:
8+
9+
```ts
10+
const conversation = new chat.MessageAccumulator();
11+
const { isFinal, skipped } = await conversation.consumeHandover({ payload });
12+
if (skipped) return; // warm handler aborted, so exit without a turn
13+
if (isFinal) {
14+
await chat.writeTurnComplete(); // step 1 is the response, no streamText
15+
} else {
16+
const result = streamText({ model, messages: conversation.modelMessages, tools });
17+
// Pass originalMessages so the handed-over tool round merges into the
18+
// step-1 assistant instead of starting a new message.
19+
const response = await chat.pipeAndCapture(result, {
20+
originalMessages: conversation.uiMessages,
21+
});
22+
if (response) await conversation.addResponse(response);
23+
}
24+
```
25+
26+
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.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
"@trigger.dev/sdk": patch
3+
---
4+
5+
Add `triggerConfig` support to `chat.headStart()` and `chat.openSession()`, so the auto-triggered handover-prepare run inherits tags, queue, machine, and other session trigger options the same way `chat.createStartSessionAction()` does. The `chat:{chatId}` tag is prepended automatically.
6+
7+
```ts
8+
export const POST = chat.headStart({
9+
agentId: "my-agent",
10+
triggerConfig: { tags: ["org:acme"], queue: "chat" },
11+
run: async ({ chat }) => streamText({ ...chat.toStreamTextOptions(), model }),
12+
});
13+
```
14+
15+
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 forwards `maxDuration`, `region`, and `lockToVersion` so both session entry points stay consistent.

.changeset/span-api-cached-cost.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/core": patch
3+
---
4+
5+
The run span API response now includes `cachedCost` and `cacheCreationCost` on the `ai` object, alongside the existing `inputCost` / `outputCost` / `totalCost`. `inputCost` reflects only the non-cached input, so these fields let you reconstruct the full cost breakdown for prompt-cached calls.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@trigger.dev/sdk": patch
3+
"trigger.dev": patch
4+
---
5+
6+
The agent skills installed by `trigger skills` 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 coding agent's skills directory. Adds a `trigger-cost-savings` skill for auditing and reducing compute spend (right-sizing machines, `maxDuration`, batching, debounce), and `@trigger.dev/sdk` now bundles the full Trigger.dev documentation so your agent can read the complete, version-pinned reference directly from node_modules.

.github/workflows/publish-docs.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 📚 Publish docs
2+
3+
on:
4+
push:
5+
tags:
6+
- "docs-release-*"
7+
8+
# Only needs to move the docs-live ref; Mintlify's GitHub app deploys from it.
9+
permissions:
10+
contents: write
11+
12+
concurrency:
13+
group: publish-docs
14+
cancel-in-progress: false
15+
16+
jobs:
17+
publish:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: 📥 Checkout tagged commit
21+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
with:
23+
persist-credentials: false
24+
25+
- name: 🔗 Check for broken links
26+
working-directory: ./docs
27+
run: npx mintlify@4.0.393 broken-links
28+
29+
- name: 🚀 Fast-forward docs-live to the tagged commit
30+
env:
31+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
run: |
33+
gh api -X PATCH \
34+
"repos/${{ github.repository }}/git/refs/heads/docs-live" \
35+
-f sha="${{ github.sha }}" \
36+
-F force=false
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: fix
4+
---
5+
6+
LLM cost no longer double-counts cached input tokens. Prompt-cache reads and writes are now billed once at their cache rate instead of also being charged at the full input price, so cost and cache hit-rate figures on the AI metrics dashboard and Models page are accurate.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: feature
4+
---
5+
6+
The Models page now has a Your models tab showing your project's model usage (cost, calls, latency, prompt-cache savings, and trend sparklines over a selectable time range) alongside the full model library, ordered by provider relevance and release date. The AI metrics dashboard also gains a caching section with cache hit rate, cached tokens, and estimated savings.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: feature
4+
---
5+
6+
Gradually roll out a new run execution backend to a configurable percentage of organizations.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: fix
4+
---
5+
6+
Fix the task page search bar clearing or resetting while typing, caused by a re-render race between the input sync effect and the activity charts.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: fix
4+
---
5+
6+
Fix Vercel env var sync and onboarding preview leaking reserved `TRIGGER_*` keys.

0 commit comments

Comments
 (0)