Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .changeset/pre.json
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Remaining .server-changes file not cleaned up

The PR deletes 14 .server-changes/*.md files as part of this release, but .server-changes/dev-cli-disconnect-md (note: missing .md extension) remains on disk. This file appears to be a pre-existing artifact — its odd filename (no .md extension) suggests it may have been created incorrectly. It won't be picked up by tooling that expects .md files. This is not introduced by this PR, but the release cleanup pass could have caught it.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,22 @@
"@trigger.dev/schema-to-json": "4.4.6",
"@trigger.dev/sdk": "4.4.6"
},
"changesets": []
"changesets": [
"agent-skills",
"ai-prompts",
"ai-tool-helpers",
"cap-idempotency-key-length",
"chat-agent-on-boot-hook",
"chat-agent",
"chat-history-read-primitives",
"chat-session-attributes",
"locals-key-dual-package-fix",
"mcp-agent-chat-sessions",
"mcp-list-runs-region",
"mock-chat-agent-test-harness",
"plugin-auth-path",
"retry-sigsegv",
"runs-list-region-filter",
"sessions-primitive"
]
}
6 changes: 0 additions & 6 deletions .server-changes/admin-tabs-preserve-search.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/agent-playground.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/agents-dashboard.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/ai-span-inspector.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/fix-ck-queue-length-cap-and-dashboard.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/fix-worker-deployment-version-race.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/google-auth-conflict-warn.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/models-registry.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/plugin-auth-path.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/prompts-dashboard.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/run-agent-view.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/runs-task-source-filter.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/sessions-dashboard.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/streamdown-v2-upgrade.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/task-metadata-cache.md

This file was deleted.

4 changes: 2 additions & 2 deletions hosting/k8s/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: trigger
description: The official Trigger.dev Helm chart
type: application
version: 4.4.6
appVersion: v4.4.6
version: 4.5.0-rc.0
appVersion: v4.5.0-rc.0
home: https://trigger.dev
sources:
- https://github.com/triggerdotdev/trigger.dev
Expand Down
17 changes: 17 additions & 0 deletions packages/build/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# @trigger.dev/build

## 4.5.0-rc.0

### Patch Changes

- Add Agent Skills for `chat.agent`. Drop a folder with a `SKILL.md` and any helper scripts/references next to your task code, register it with `skills.define({ id, path })`, and the CLI bundles it into the deploy image automatically — no `trigger.config.ts` changes. The agent gets a one-line summary in its system prompt and discovers full instructions on demand via `loadSkill`, with `bash` and `readFile` tools scoped per-skill (path-traversal guards, output caps, abort-signal propagation). ([#3543](https://github.com/triggerdotdev/trigger.dev/pull/3543))

```ts
const pdfSkill = skills.define({ id: "pdf-extract", path: "./skills/pdf-extract" });

chat.skills.set([await pdfSkill.local()]);
```

Built on the [AI SDK cookbook pattern](https://ai-sdk.dev/cookbook/guides/agent-skills) — portable across providers. SDK + CLI only for now; dashboard-editable `SKILL.md` text is on the roadmap.

- Updated dependencies:
- `@trigger.dev/core@4.5.0-rc.0`

## 4.4.6

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/build/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trigger.dev/build",
"version": "4.4.6",
"version": "4.5.0-rc.0",
"description": "trigger.dev build extensions",
"license": "MIT",
"publishConfig": {
Expand Down Expand Up @@ -82,7 +82,7 @@
},
"dependencies": {
"@prisma/config": "^6.10.0",
"@trigger.dev/core": "workspace:4.4.6",
"@trigger.dev/core": "workspace:4.5.0-rc.0",
"mlly": "^1.7.1",
"pkg-types": "^1.1.3",
"resolve": "^1.22.8",
Expand Down
21 changes: 21 additions & 0 deletions packages/cli-v3/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# trigger.dev

## 4.5.0-rc.0

### Patch Changes

- Add Agent Skills for `chat.agent`. Drop a folder with a `SKILL.md` and any helper scripts/references next to your task code, register it with `skills.define({ id, path })`, and the CLI bundles it into the deploy image automatically — no `trigger.config.ts` changes. The agent gets a one-line summary in its system prompt and discovers full instructions on demand via `loadSkill`, with `bash` and `readFile` tools scoped per-skill (path-traversal guards, output caps, abort-signal propagation). ([#3543](https://github.com/triggerdotdev/trigger.dev/pull/3543))

```ts
const pdfSkill = skills.define({ id: "pdf-extract", path: "./skills/pdf-extract" });

chat.skills.set([await pdfSkill.local()]);
```

Built on the [AI SDK cookbook pattern](https://ai-sdk.dev/cookbook/guides/agent-skills) — portable across providers. SDK + CLI only for now; dashboard-editable `SKILL.md` text is on the roadmap.

- The CLI MCP server's agent-chat tools (`start_agent_chat`, `send_agent_message`, `close_agent_chat`) now run on the new Sessions primitive, so AI assistants driving a `chat.agent` get the same idempotent-by-`chatId`, durable-across-runs behavior the browser transport gets. Required PAT scopes go from `write:inputStreams` to `read:sessions` + `write:sessions`. ([#3546](https://github.com/triggerdotdev/trigger.dev/pull/3546))
- MCP `list_runs` tool: add a `region` filter input and surface each run's executing region in the formatted summary. ([#3612](https://github.com/triggerdotdev/trigger.dev/pull/3612))
- Updated dependencies:
- `@trigger.dev/core@4.5.0-rc.0`
- `@trigger.dev/build@4.5.0-rc.0`
- `@trigger.dev/schema-to-json@4.5.0-rc.0`

## 4.4.6

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions packages/cli-v3/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trigger.dev",
"version": "4.4.6",
"version": "4.5.0-rc.0",
"description": "A Command-Line Interface for Trigger.dev projects",
"type": "module",
"license": "MIT",
Expand Down Expand Up @@ -95,9 +95,9 @@
"@opentelemetry/sdk-trace-node": "2.0.1",
"@opentelemetry/semantic-conventions": "1.36.0",
"@s2-dev/streamstore": "^0.22.5",
"@trigger.dev/build": "workspace:4.4.6",
"@trigger.dev/core": "workspace:4.4.6",
"@trigger.dev/schema-to-json": "workspace:4.4.6",
"@trigger.dev/build": "workspace:4.5.0-rc.0",
"@trigger.dev/core": "workspace:4.5.0-rc.0",
"@trigger.dev/schema-to-json": "workspace:4.5.0-rc.0",
"ansi-escapes": "^7.0.0",
"braces": "^3.0.3",
"c12": "^1.11.1",
Expand Down
85 changes: 85 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,90 @@
# internal-platform

## 4.5.0-rc.0

### Patch Changes

- Add Agent Skills for `chat.agent`. Drop a folder with a `SKILL.md` and any helper scripts/references next to your task code, register it with `skills.define({ id, path })`, and the CLI bundles it into the deploy image automatically — no `trigger.config.ts` changes. The agent gets a one-line summary in its system prompt and discovers full instructions on demand via `loadSkill`, with `bash` and `readFile` tools scoped per-skill (path-traversal guards, output caps, abort-signal propagation). ([#3543](https://github.com/triggerdotdev/trigger.dev/pull/3543))

```ts
const pdfSkill = skills.define({ id: "pdf-extract", path: "./skills/pdf-extract" });

chat.skills.set([await pdfSkill.local()]);
```

Built on the [AI SDK cookbook pattern](https://ai-sdk.dev/cookbook/guides/agent-skills) — portable across providers. SDK + CLI only for now; dashboard-editable `SKILL.md` text is on the roadmap.

- Reject overlong `idempotencyKey` values at the API boundary so they no longer trip an internal size limit on the underlying unique index and surface as a generic 500. Inputs are capped at 2048 characters — well above what `idempotencyKeys.create()` produces (a 64-character hash) and above any realistic raw key. Applies to `tasks.trigger`, `tasks.batchTrigger`, `batch.create` (Phase 1 streaming batches), `wait.createToken`, `wait.forDuration`, and the input/session stream waitpoint endpoints. Over-limit requests now return a structured 400 instead. ([#3560](https://github.com/triggerdotdev/trigger.dev/pull/3560))
- **AI Agents** — run AI SDK chat completions as durable Trigger.dev agents instead of fragile API routes. Define an agent in one function, point `useChat` at it from React, and the conversation survives page refreshes, network blips, and process restarts. ([#3543](https://github.com/triggerdotdev/trigger.dev/pull/3543))

```ts
import { chat } from "@trigger.dev/sdk/ai";
import { streamText } from "ai";
import { openai } from "@ai-sdk/openai";

export const myChat = chat.agent({
id: "my-chat",
run: async ({ messages, signal }) =>
streamText({ model: openai("gpt-4o"), messages, abortSignal: signal }),
});
```

```tsx
import { useChat } from "@ai-sdk/react";
import { useTriggerChatTransport } from "@trigger.dev/sdk/chat/react";

const transport = useTriggerChatTransport({ task: "my-chat", accessToken, startSession });
const { messages, sendMessage } = useChat({ transport });
```

**What you get:**

- **AI SDK `useChat` integration** — a custom [`ChatTransport`](https://sdk.vercel.ai/docs/ai-sdk-ui/transport) (`useTriggerChatTransport`) plugs straight into Vercel AI SDK's `useChat` hook. Text streaming, tool calls, reasoning, and `data-*` parts all work natively over Trigger.dev's realtime streams. No custom API routes needed.
- **First-turn fast path (`chat.headStart`)** — opt-in handler that runs the first turn's `streamText` step in your warm server process while the agent run boots in parallel, cutting cold-start TTFC by roughly half (measured 2801ms → 1218ms on `claude-sonnet-4-6`). The agent owns step 2+ (tool execution, persistence, hooks) so heavy deps stay where they belong. Web Fetch handler works natively in Next.js, Hono, SvelteKit, Remix, Workers, etc.; bridge to Express/Fastify/Koa via `chat.toNodeListener`. New `@trigger.dev/sdk/chat-server` subpath.
- **Multi-turn durability via Sessions** — every chat is backed by a durable Session that outlives any individual run. Conversations resume across page refreshes, idle timeout, crashes, and deploys; `resume: true` reconnects via `lastEventId` so clients only see new chunks. `sessions.list` enumerates chats for inbox-style UIs.
- **Auto-accumulated history, delta-only wire** — the backend accumulates the full conversation across turns; clients only ship the new message each turn. Long chats never hit the 512 KiB body cap. Register `hydrateMessages` to be the source of truth yourself.
- **Lifecycle hooks** — `onPreload`, `onChatStart`, `onValidateMessages`, `hydrateMessages`, `onTurnStart`, `onBeforeTurnComplete`, `onTurnComplete`, `onChatSuspend`, `onChatResume` — for persistence, validation, and post-turn work.
- **Stop generation** — client-driven `transport.stopGeneration(chatId)` aborts mid-stream; the run stays alive for the next message, partial response is captured, and aborted parts (stuck `partial-call` tools, in-progress reasoning) are auto-cleaned.
- **Tool approvals (HITL)** — tools with `needsApproval: true` pause until the user approves or denies via `addToolApprovalResponse`. The runtime reconciles the updated assistant message by ID and continues `streamText`.
- **Steering and background injection** — `pendingMessages` injects user messages between tool-call steps so users can steer the agent mid-execution; `chat.inject()` + `chat.defer()` adds context from background work (self-review, RAG, safety checks) between turns.
- **Actions** — non-turn frontend commands (undo, rollback, regenerate, edit) sent via `transport.sendAction`. Fire `hydrateMessages` + `onAction` only — no turn hooks, no `run()`. `onAction` can return a `StreamTextResult` for a model response, or `void` for side-effect-only.
- **Typed state primitives** — `chat.local<T>` for per-run state accessible from hooks, `run()`, tools, and subtasks (auto-serialized through `ai.toolExecute`); `chat.store` for typed shared data between agent and client; `chat.history` for reading and mutating the message chain; `clientDataSchema` for typed `clientData` in every hook.
- **`chat.toStreamTextOptions()`** — one spread into `streamText` wires up versioned system [Prompts](https://trigger.dev/docs/ai/prompts), model resolution, telemetry metadata, compaction, steering, and background injection.
- **Multi-tab coordination** — `multiTab: true` + `useMultiTabChat` prevents duplicate sends and syncs state across browser tabs via `BroadcastChannel`. Non-active tabs go read-only with live updates.
- **Network resilience** — built-in indefinite retry with bounded backoff, reconnect on `online` / tab refocus / bfcache restore, `Last-Event-ID` mid-stream resume. No app code needed.

See [/docs/ai-chat](https://trigger.dev/docs/ai-chat/overview) for the full surface — quick start, three backend approaches (`chat.agent`, `chat.createSession`, raw task), persistence and code-sandbox patterns, type-level guides, and API reference.

- Stamp `gen_ai.conversation.id` (the chat id) on every span and metric emitted from inside a `chat.task` or `chat.agent` run. Lets you filter dashboard spans, runs, and metrics by the chat conversation that produced them — independent of the run boundary, so multi-run chats correlate cleanly. No code changes required on the user side. ([#3543](https://github.com/triggerdotdev/trigger.dev/pull/3543))
- Fix `LocalsKey<T>` type incompatibility across dual-package builds. The phantom value-type brand no longer uses a module-level `unique symbol`, so a single TypeScript compilation that resolves the type from both the ESM and CJS outputs (which can happen under certain pnpm hoisting layouts) no longer sees two structurally-incompatible variants of the same type. ([#3626](https://github.com/triggerdotdev/trigger.dev/pull/3626))
- Unit-test `chat.agent` definitions offline with `mockChatAgent` from `@trigger.dev/sdk/ai/test`. Drives a real agent's turn loop in-process — no network, no task runtime — so you can send messages, actions, and stop signals via driver methods, inspect captured output chunks, and verify hooks fire. Pairs with `MockLanguageModelV3` from `ai/test` for model mocking. `setupLocals` lets you pre-seed `locals` (DB clients, service stubs) before `run()` starts. ([#3543](https://github.com/triggerdotdev/trigger.dev/pull/3543))

The broader `runInMockTaskContext` harness it's built on lives at `@trigger.dev/core/v3/test` — useful for unit-testing any task code, not just chat.

- Retry `TASK_PROCESS_SIGSEGV` task crashes under the user's retry policy instead of failing the run on the first segfault. SIGSEGV in Node tasks is frequently non-deterministic (native addon races, JIT/GC interaction, near-OOM in native code, host issues), so retrying on a fresh process often succeeds. The retry is gated by the task's existing `retry` config + `maxAttempts` — same path `TASK_PROCESS_SIGTERM` and uncaught exceptions already use — so tasks without a retry policy still fail fast. ([#3552](https://github.com/triggerdotdev/trigger.dev/pull/3552))
- Add `region` to the runs list / retrieve API: filter runs by region (`runs.list({ region: "..." })` / `filter[region]=<masterQueue>`) and read each run's executing region from the new `region` field on the response. ([#3612](https://github.com/triggerdotdev/trigger.dev/pull/3612))
- **Sessions** — a durable, run-aware stream channel keyed on a stable `externalId`. A Session is the unit of state that owns a multi-run conversation: messages flow through `.in`, responses through `.out`, both survive run boundaries. Sessions back the new `chat.agent` runtime, and you can build on them directly for any pattern that needs durable bi-directional streaming across runs. ([#3542](https://github.com/triggerdotdev/trigger.dev/pull/3542))

```ts
import { sessions, tasks } from "@trigger.dev/sdk";

// Trigger a task and subscribe to its session output in one call
const { runId, stream } = await tasks.triggerAndSubscribe("my-task", payload, {
externalId: "user-456",
});

for await (const chunk of stream) {
// ...
}

// Enumerate existing sessions (powers inbox-style UIs without a separate index)
for await (const s of sessions.list({ type: "chat.agent", tag: "user:user-456" })) {
console.log(s.id, s.externalId, s.createdAt, s.closedAt);
}
```

See [/docs/ai-chat/overview](https://trigger.dev/docs/ai-chat/overview) for the full surface — Sessions powers the durable, resumable chat runtime described there.

## 4.4.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trigger.dev/core",
"version": "4.4.6",
"version": "4.5.0-rc.0",
"description": "Core code used across the Trigger.dev SDK and platform",
"license": "MIT",
"publishConfig": {
Expand Down
8 changes: 8 additions & 0 deletions packages/plugins/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @trigger.dev/plugins

## 4.5.0-rc.0

### Patch Changes

- The public interfaces for a plugin system. Initially consolidated authentication and authorization interfaces. ([#3499](https://github.com/triggerdotdev/trigger.dev/pull/3499))
- Updated dependencies:
- `@trigger.dev/core@4.5.0-rc.0`

## 0.0.0-prerelease-20260506134321

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trigger.dev/plugins",
"version": "4.4.6",
"version": "4.5.0-rc.0",
"description": "Plugin contracts and interfaces for Trigger.dev",
"license": "MIT",
"publishConfig": {
Expand Down
9 changes: 9 additions & 0 deletions packages/python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @trigger.dev/python

## 4.5.0-rc.0

### Patch Changes

- Updated dependencies:
- `@trigger.dev/sdk@4.5.0-rc.0`
- `@trigger.dev/core@4.5.0-rc.0`
- `@trigger.dev/build@4.5.0-rc.0`

## 4.4.6

### Patch Changes
Expand Down
Loading