Skip to content

fix(cli): set NODE_ENV for Bun worker compilation - #5164

Merged
carderne merged 3 commits into
triggerdotdev:mainfrom
ethandaniel:bun-worker-production
Dec 1, 2026
Merged

carderne merged 3 commits into
triggerdotdev:mainfrom
ethandaniel:bun-worker-production

Conversation

@ethandaniel

Copy link
Copy Markdown
Contributor

Summary

Bun inlines process.env.NODE_ENV when it compiles a worker. If NODE_ENV is unset during compilation, the task sees development even when the runtime container supplies NODE_ENV=production. This can send deployed tasks down development-only code paths. Bun compiler docs

Set NODE_ENV=production for the bun build command only. This gives Bun the correct value at compile time and preserves the existing minification behavior.

Testing

  • Reproduced the issue on Trigger.dev’s Bun 1.4.4 build image.
  • Passed 65 targeted CLI tests before syncing the branch with upstream main, including the Docker regression test. The test starts with NODE_ENV unset, builds the worker, and verifies that the compiled task sees production.

Changelog

Deployed Bun 1.4 tasks now see NODE_ENV=production when bytecode compilation is enabled.

@changeset-bot

changeset-bot Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 08c4217

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
trigger.dev Patch
@trigger.dev/build Patch
@trigger.dev/convex Patch
@trigger.dev/core Patch
@trigger.dev/linear Patch
@trigger.dev/python Patch
@trigger.dev/react-hooks Patch
@trigger.dev/redis-worker Patch
@trigger.dev/rsc Patch
@trigger.dev/schema-to-json Patch
@trigger.dev/slack Patch
@trigger.dev/sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1bbb5ae1-0848-4f88-9255-b8454f076f1c
Commits

Reviewing files that changed from the base of the PR and between a8bb5aa and 08c4217.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The Bun compile command now runs with NODE_ENV=production. The compiled-worker test checks that the worker reports NODE_ENV=production when launched. A changeset records the patch release.

Merge Risk: Minimal · previous review a8bb5

Deployed Bun workers are now compiled with NODE_ENV=production, so compiled tasks should no longer take development-only paths. No concrete merge-blocking risk was found, and the change is easy to revert.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(cli): set NODE_ENV for Bun worker compilation" matches the main change. The changeset sets NODE_ENV=production for the bun build command in packages/cli-v3/src/deploy/buildImage.ts, and…
Description check Passed The description follows the repository template. It explains the problem, which is Bun inlining process.env.NODE_ENV at compile time, and it gives the fix, which sets NODE_ENV=production for the bun b…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(cli): set NODE_ENV for Bun worker compilation" matches the main change. The changeset sets NODE_ENV=production for the bun build command in packages/cli-v3/src/deploy/buildImage.ts, and the test verifies the compiled worker sees production. It uses a conventional commit prefix and names the affected component. It is specific and concise, and it fits the title convention.

Full details: Description check

Explanation

The description follows the repository template. It explains the problem, which is Bun inlining process.env.NODE_ENV at compile time, and it gives the fix, which sets NODE_ENV=production for the bun build command only. It includes a Testing section with concrete steps and a Changelog entry. The template checklist, the Closes #<issue> line, and the Screenshots section are missing. The Closes line is needed to link the issue, but the PR objectives reference PR #5164 and no linked issue is given. The checklist items are not ticked.

Resolution

Optionally add a "Closes #<issue>" line if a related issue exists, tick the checklist items that apply, and add a Screenshots entry or mark it not applicable.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@matt-aitken
matt-aitken marked this pull request as ready for review November 30, 2026 16:53

@devin-ai-integration devin-ai-integration Bot left a comment

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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@carderne
carderne added this pull request to the merge queue Dec 1, 2026
@carderne
carderne removed this pull request from the merge queue due to a manual request Dec 1, 2026
@carderne
carderne added this pull request to the merge queue Dec 1, 2026
Merged via the queue into triggerdotdev:main with commit 67f8ca3 Dec 1, 2026
50 of 53 checks passed
@github-actions github-actions Bot mentioned this pull request Dec 1, 2026
@carderne

carderne commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Thanks for this @ethandaniel, should go out with our next release later today or tomorrow.

Thegreatsura pushed a commit to Thegreatsura/trigger.dev that referenced this pull request Dec 1, 2026
## Summary
26 new features, 36 improvements, 31 bug fixes.

## Highlights

- Sandbox tasks restrict outbound network access by default.
`sandbox.network` accepts `"restricted"` (Trigger.dev's services and the
allowed domains of granted Vault variables only), `{ allow:
["api.example.com", "*.example.com"] }` to also allow HTTPS to those
hosts, or `"unrestricted"`. Restricted sandboxes can only make outbound
connections on port 443; a blocked HTTPS request gets a `403` with an
`x-trigger-network-denied` header.
([`5d4d12e5cdbee930468868e72ce36c678a3f8e16`](triggerdotdev@5d4d12e))

## Improvements
- Add `versionSkew: "follow-mid-turn"` to `chat.agent` and
`chat.createSession`. It does everything `"follow"` does, and also moves
a turn that is still running when its version is below the skew
protection threshold: the turn finishes the step it is on, and a run on
the current deployment continues the same reply from the next step, so
no step runs twice and the person chatting sees one reply.
`chat.handOverAtStep(step)` does the same from your own `prepareStep`.
`chat.requestUpgrade()` called during a turn now moves the turn at the
next step boundary instead of waiting for the turn to end. A turn is
handed over only when the agent in the current deployment was built with
this release or later; otherwise the turn finishes on its own version.
If the API can't be reached during a handover, the old run keeps trying
to start the next run for about three minutes, and a run that continues
a chat while the API can't be reached waits for it rather than answer a
message again.
([`7662a2f83274a47f070ac1970b44f6f633e3d177`](triggerdotdev@7662a2f))
- `runs.retrieve()` returns a `buffer` field on a buffered task's run:
its buffer key, how many items it collected, and when and why its window
closed.
([`87f77acdfc7c61f07e6958d5d28807d3d26ba510`](triggerdotdev@87f77ac))
- Add buffered tasks to `@trigger.dev/sdk/preview`: a task that collects
triggers over a time or count window and runs once with the array of
payloads. They're in preview and need to be enabled for your
organization. Run tokens can buffer items too.
([`7c1789a12b7860a7363c0119932689c0cd7969bd`](triggerdotdev@7c1789a))
  
  ```ts
  import { buffer } from "@trigger.dev/sdk/preview";
  import { z } from "zod";
  
  export const embedItems = buffer.task({
  id: "embed-items",
  schema: z.object({ id: z.string() }),
  buffer: { maxItems: 100, maxDelay: "10s" },
  run: async (items) => {
    // one run per window, with every item it collected
  },
  });
  
  await embedItems.trigger({ id: "item_1" });
  ```
- `TriggerChatTransport` now renews its session token only through your
`accessToken` callback, so make it return a freshly minted token from
your server. The `publicAccessToken` option of `chat.writeTurnComplete`
is deprecated and ignored.
([`a070a403729838caf3a32906d4cd1b747c7ad703`](triggerdotdev@a070a40))
- Runs on a named machine (`machine()`) can warm start again. A runner
on a machine's image now only takes runs for that same machine, so warm
starts no longer have to be turned off for those runs.
([`d719264aa33c44799deebcf678009a69f6cab0ff`](triggerdotdev@d719264))
- Use `machine()` from `@trigger.dev/sdk/preview` to give tasks their
own image and default preset. Add apt packages or Containerfile
instructions to customize the project image. Pass the result as the
task's `machine` option to build its image at deploy time. Available
only to early testers.
([`cef33425c683fbd21992996739bea36fdc4040b5`](triggerdotdev@cef3342))
- JWT validation now accepts only HS256, the algorithm Trigger.dev
tokens are signed with.
([`2f650bd1a702c402ca1c12c2060b375b1d6ddcfd`](triggerdotdev@2f650bd))
- Resume a deployed task as soon as its run is restored after a wait. A
run that was suspended during a wait (`wait.for`, `triggerAndWait`, a
waitpoint token or session input) could take up to 5 seconds longer than
needed to continue, and the waits it finished after that, or a
cancellation, could reach the task with the same delay.
([`27b8200f5d977f9d3a3a78822772c0afdbe2d5a9`](triggerdotdev@27b8200))
- Add `@trigger.dev/sdk/preview` for features in preview. Adds sandboxed
task runs and multiple machine configs as preview features, available
only to early testers.
([`3e98abe3be9466968c162ea7d04547134a824a30`](triggerdotdev@3e98abe))
- Use `sandbox: true` to run a deployed task with access limited to its
own payload and output. Configure `sandbox.envVars` and `sandbox.scopes`
to grant environment variables or additional permissions, including the
`basic` and `oidc` presets. `basic` lets a sandbox inspect and manage
its own run (including metadata and tags), and exchange messages with
its attached Session, including waiting for input. Upgrade the SDK, CLI,
and (when self-hosting) server before adopting this option. `trigger
dev` still runs locally with development credentials and is not an
isolation boundary.
([`024c5999a53fef9c2042c0d715f1d1cf2cf1b569`](triggerdotdev@024c599))
- Add `unstable_signals`: send a small message to every executing run in
an environment that listens for its name, with
`unstable_signals.send(name, payload)`, listen inside a task with
`unstable_signals.on(name, handler)`, read the current latest once with
`unstable_signals.latest(name)`, and forget the latest with
`unstable_signals.clear(name)`. A run that starts listening receives the
latest signal of that name first. Unstable: names and behavior may
change.
([`7662a2f83274a47f070ac1970b44f6f633e3d177`](triggerdotdev@7662a2f))
- On a Head Start first turn, `chat.agent` now asks the user before
running a tool that needs approval, instead of running it as soon as the
agent takes over. Redeploy the agent to get the fix; the route needs no
change. If `run` calls `streamText` again with the handed-over messages
and a tool that needs approval, that call now throws: pass the first
call's response messages instead.
([`fd739033dfaf8e0def6715dedbb63124f838abbc`](triggerdotdev@fd73903))
- The bundled chat agent skills now use `claude-sonnet-5-5` in their
examples. They used `claude-sonnet-4-5`, which Anthropic retires on
November 30, 2026, so agents following the skills would have generated
code that stops working.
([`59dc6636b39147c1297984050181facbf9420bd5`](triggerdotdev@59dc663))
- A `chat.agent` channel's final reply is now the turn's last non-empty
run of text (tool calls split the text into runs), instead of every
step's text joined together. Notes the model wrote before its tool calls
no longer end up in the posted reply, unless nothing follows the last
tool call, in which case the text just before it is posted.
`reply.message` still has every part.
([`7a2dd6ba86a1dcc334a0e853018780b5d8fa05e7`](triggerdotdev@7a2dd6b))
- `chat.customAgent` and `chat.createSession` loops can now hold Head
Start tool calls that need approval: pass the `tools` (and AI SDK 7's
`toolApproval`) you give your `streamText` to `consumeHandover`,
`chat.createSession` or `applyHandover`. `chat.createSession` now also
continues the same assistant message when the client answers a tool
call, as `chat.agent` does, so save replies by message id.
([`d9604faf8e3a2ec4223e626f12f3219970e6187d`](triggerdotdev@d9604fa))
- `TriggerChatTransport` no longer replays the previous answer when a
chat is sent to or reconnected without a saved `lastEventId`, for
example after a page reload that doesn't restore it. Only the current
turn's answer reaches the UI, and a reload mid-answer resumes it live.
With older agents that write no turn markers, the answer can arrive when
its turn completes rather than streaming, and with the oldest, which
record no input cursor, a send made while the agent is idle can still
get the previous answer.
([`04352350bd0ce807f89dc6af15f1d7c4948fbec1`](triggerdotdev@0435235))
- With AI SDK 7's `useChat({ resume: true })`, a chat that remounts
while a reply is still streaming (for example under React StrictMode in
development) now rejoins the reply from its start instead of showing
nothing until the next message.
([`85a3dbc612b09f2530073d7d5e7ab589307c6bc2`](triggerdotdev@85a3dbc))
- A chat message sent while an earlier reply is still running, for
example after Stop on a reply resumed after a reload, now gets only its
own answer instead of the rest of that reply and an error.
([`73061256bb2e39c335f8ca55b7c8ae98b855f1bb`](triggerdotdev@7306125))
- Upgrade the CLI's `zod` dependency to 4.6.7.
([`a093664ec1c4f07b2430b497eca1445630f33405`](triggerdotdev@a093664))
- Deployed Bun 1.4 tasks now see `NODE_ENV=production` when bytecode
compilation is enabled.
([triggerdotdev#5164](triggerdotdev#5164))
- When you use Trigger.dev Cloud, the CLI and its MCP server now report
usage analytics tied to your logged-in account: which commands run and
which MCP tools are called, never the arguments you pass. Nothing is
reported for self-hosted or local instances. Turn it off with
`--skip-telemetry` or the `TRIGGER_TELEMETRY_DISABLED` environment
variable.
([`9cc017fff59ca645e313c69addfa6264715b38eb`](triggerdotdev@9cc017f))
- The MCP server's `list_runs` tool now accepts `before` to list the
page before a given cursor, using the previous cursor it shows.
([`37efe87e254c2d2abba6674ecb201d71cb8943a2`](triggerdotdev@37efe87))
- `trigger mcp --profile <name>` now takes precedence over the profile
saved in the project's `.trigger/mcp.json`. Run traces are kept in
memory and are no longer written to disk. `--log-file` now gets stricter
ownership and file-type checks; if the file fails them or cannot be
written, logging is skipped and the server keeps running.
([`5ef5b690b56ac17c7aab3edd63662a0eccc4febb`](triggerdotdev@5ef5b69))
- The MCP server's `trigger_task` tool now accepts `metadata`,
`idempotencyKeyTTL`, `concurrencyKey`, `concurrency`, `debounce`,
`lockToVersion` and `priority`, matching the options you can pass when
triggering from the SDK or the dashboard. Calls without them behave as
before.
([`ea9405ed624126adb741eb3667c8f9a7b1219cb8`](triggerdotdev@ea9405e))
  
`trigger_task` no longer sets a 10 minute ttl on its own when you pass
any option, including existing ones such as `tags`. A run now gets the
ttl you pass, otherwise the task's ttl, otherwise 10 minutes in dev and
the server's maximum ttl elsewhere (14 days on Trigger.dev Cloud; no
expiry on a self-hosted server without one), and a ttl longer than the
server's maximum is capped at it. Pass `ttl: "10m"` to keep the old
behaviour.

## Bug fixes
- Fix the type of the handle returned by `batch.triggerByTask()`. It
promised `runs`, `isCached` and `idempotencyKey`, which were never
returned, so code like `results.runs[0]` compiled but threw at runtime.
The handle is now typed as what it returns: `batchId`, `runCount` and
`publicAccessToken`; use `batch.retrieve(batchId)` to get the run IDs,
or `batch.triggerByTaskAndWait()` for typed results.
([`80fc05e8a7a647509b26a22e65dc198b94eccdc9`](triggerdotdev@80fc05e))
- Fix `AgentChat` returning another turn's reply, or several replies
joined together, instead of the answer to the message you sent: for
example when continuing a chat without a saved `lastEventId`, sending
two messages in a row, or when a run answers earlier messages first.
Agents now mark where each turn starts and where steered messages join
one on the output stream, so redeploy them on this version; with an
older agent, a reply `AgentChat` can't match to your message is
delivered when its turn completes instead of streamed. Custom readers of
the session output stream must skip control records they don't
recognise. A send aborted before its stream starts now asks the agent to
stop.
([`77fb02dd6cb08134bb5a6c911e59161e55c2b0b3`](triggerdotdev@77fb02d))
- Fix run metadata changes sometimes reaching the API only when the run
finished, so realtime subscribers and parent runs didn't see progress
while the task was still running. This also fixes a metadata `append` or
`increment` occasionally being applied twice at the end of a run, and a
new run that reused the previous run's process sometimes seeing that
run's metadata values.
([`eea6b174096ae9ec3706734f61f13e48f3ff8b8d`](triggerdotdev@eea6b17))

## Server changes

These changes affect the self-hosted Docker image and Trigger.dev Cloud:

- Copy the agent's replies in the Ask Trigger chat and the AI reply on
the Query page with a copy icon.
- Ask Trigger can now search your environment's logs by message, level,
task, run, or time range when the Logs page is available.
- The MCP server can now trigger a batch of up to 20 runs in one call,
after you approve every item.
- The remote MCP server can now list batches and show a batch with the
runs recorded on it (each run's status and error need run read access),
list waitpoint tokens and show one with the runs that waited on it, and,
after you confirm, complete a token with output, time it out, or skip a
wait.
- The remote MCP server can now read a custom dashboard in full, edit
one of its widgets, rename it or change its description, and delete it.
It can also list the Query page's recent queries, browse the model
catalogue and your model usage, show a prompt with the version a label
resolves to, and list a prompt's generations.
- The remote MCP server can now show one deployment's details and one
agent's details and activity, and its `trigger_task` tool accepts
metadata, a concurrency key, named concurrency limits, debounce, a
version to run on, priority and an idempotency key lifetime.
  
Triggering a task through the API or SDK with a very long idempotency
key lifetime no longer fails; the key gets the default lifetime instead.
- The remote MCP server can now list a project's environments, branches
and regions, promote, roll back or cancel a deployment, create or
archive a branch, set automatic archiving of preview branches, and
change the project's default region.
- AI agents connected to the MCP server can now see which environment
variables are set in each environment, and which are missing, without
ever seeing their values.
- The remote MCP server can now list error groups, show one error group
with its recent failed runs, and resolve, ignore or unresolve an error
group after you confirm.
- The remote MCP server can now delete one of your playground
conversations after you confirm it.
- The remote MCP server can now rename and delete a project after you
confirm. The delete confirmation shows what the project still has, such
as environments, schedules and queued runs, and a deleted project cannot
be restored.
- The remote MCP server's `get_prompt` tool can now render a prompt
version with variables, the same way resolving the prompt through the
API does.
- The remote MCP server can now list queues with their delays and
backlog, show a queue's concurrency keys, report an environment's
concurrency and its limits, pause, resume, override or reset a queue's
concurrency, archive or unarchive a queue, and pause or resume a whole
environment.
- The remote MCP server can now, after you confirm, redeploy a finished
deployment (like Redeploy on the Deployments page) and deploy the branch
tracked for an environment from the connected GitHub repository (like
Deploy now).
- The remote MCP server can now, after you confirm, replay a run into
another environment of the same project, like the replay dialog in the
dashboard.
- Agents connected to the remote MCP server can download a run's full
log as a file, through a link that works for one minute.
- The remote MCP server can now list an environment's tasks with their
recent activity, list and show schedules, and create, update, activate,
deactivate or delete a schedule after you confirm it.
- The remote MCP server can now list sessions with the Sessions page
filters, show a session with its runs and channels, read a session's
saved conversation, and list your playground conversations with an
agent.
- The remote MCP server can now change a session's tags and metadata,
and close a session, after you confirm it.
- The remote MCP server's `list_runs` tool can now page backwards
through runs.
- Add an Access page to organization settings where owners and admins
choose which MCP tools ask for confirmation before they change anything.
- Remote MCP can now be turned on for selected organizations, and
self-hosted installs turn it on with the `hasRemoteMcp` feature flag.
Organizations without it get a clear message from MCP tools and don't
see the Access settings page. If you already run remote MCP with
`MCP_SERVER_ENABLED`, turn on `hasRemoteMcp` globally or per
organization after upgrading, or MCP tools will refuse organization
calls.
- Session pages have a Trace tab that shows every run of a session on
one timeline, with zoom, live runs and search across runs.
- Set a skew protection threshold from the new Session upgrades page,
from an agent's page, or through the API, to move sessions on an older
version to the current deployment the next time they're used. It can
cover every session in the environment or one task's. It's a one-time
cutoff: later deploys move nothing until you set it again, and rolling
back below it clears it.
- Links from the docs can open a task's Test page with an example
payload already in the editor. If the task isn't in that environment
yet, the Test page now says so and shows the command to run or deploy
it.
- Admins can now invite team members, revoke pending invites and resend
the ones they sent, but can't invite Owners. Only Owners can remove
members or change roles.
- The audit log event panel now uses the same inspector layout as the
run page.
- The project menu in the side bar shows the project ref and copies it
on click, and the Agents card on the Tasks overview links to the AI
agents docs.
- The New environment variable dialog now starts with "Secret value" on.
Turn it off to create a variable whose value stays viewable; replacing
existing values keeps each one's setting unless you change the switch.
- Accept `GITHUB_APP_PRIVATE_KEY` with escaped `\n` line breaks, so the
key can be set as a single-line environment variable.
- The remote MCP server's alert details now show the alert's current
value next to its threshold, and its alert channel list shows each
channel's latest monitoring alert delivery.
- MCP clients signing in from claude.ai or claude.com must use Claude's
standard sign-in callback, and the consent page shows hidden characters
in an app's name as visible escapes instead of applying them.
- MCP tool errors are now plain text that names what went wrong and what
to do next, instead of a raw JSON body.
- MCP tools now refuse arguments they don't know instead of ignoring
them, and name the field the agent most likely meant.
- API requests no longer stall while the webapp's Redis is unavailable,
and login attempts are refused rather than unlimited during that time.
- The task name in the run inspector now opens the task's page instead
of the runs list.
- Span properties now have a Pretty view. JSON stored as text, like
webhook bodies, is unpacked into a tree you can open and close. Switch
to Raw to see the original.
- Picking tasks for an API key no longer clears your search after each
pick, so you can select several matching tasks in a row.
- Retrieving a run whose payload or output is an empty string now
returns that empty string instead of omitting the field.
- Dev branch runs inherit environment variables from their parent
Development environment unless the branch overrides them.
- Fix `trigger dev` keeping a run's task process alive and retrying
forever when the run finished while your computer was asleep for a long
time. The CLI now sees the run has finished and stops it.
- Starting a new chat session is faster again.
- New environment variable names created through the dashboard or API
are limited to 256 characters.
- Session metadata updates now keep the `mcpBinding` key that MCP agent
chats use. Creating or updating a session with metadata that sets or
changes that key returns a 422 error.
- The MCP write-confirmation page now shows the environment type and
labels preview branches, so a branch named "prod" can't pass for
production.
- MCP approval pages now show invisible characters and text-reordering
control characters as visible escapes. A confirmation requested before
this release keeps its original preview until it expires, at most 10
minutes later.
- The MCP promote and rollback deployment tools now say when a preview
branch is archived or unknown instead of answering "Not authorized". The
cancel deployment tool can still cancel an in-flight deployment of an
archived preview branch, like the dashboard.
- MCP tools now mark more of your project's own text, such as task
names, query errors and webhook setup steps, as data for the AI client,
and tell the client not to follow instructions found in it. Run details
show at most 16,000 characters of a payload or output inline and say how
much was cut.
- The MCP `get_limits` and `list_regions` tools now require the
`read:environments` scope instead of `read:projects`. Connections with
the default scopes need no action; if yours lacks it, reconnect the
client and request `read:environments`.
- Deleting a project through the remote MCP server no longer fails on
installations whose database uses a non-default schema.
- Resolving a monitoring alert through the remote MCP server now only
affects alerts in the environment you chose.
- The remote MCP server now shows a run's empty-string payload or output
instead of hiding it, and shows a batch's runs with the same status
names as run details.
- When an AI assistant sets a webhook signing secret, the approval page
now shows enough of it to check against your provider: the last
characters and length of a secret, or the whole public key.
- A removed member who rejoins no longer gets their old role back.
Accepting an invite whose role is no longer available, for example after
a plan change, now asks for a new invite instead of joining.
- Show the organization Access page only when the remote MCP server is
enabled; otherwise the menu item is hidden and the page redirects to the
organization.
- Project and organization deletions now return a retryable error
instead of hanging if queue cleanup fails.
- Fix queries, dashboards and alerts that combine AND and OR, which
ignored brackets and operator precedence and could return the wrong
rows.
- Queries now apply your plan's query period limit to every table of
your data they read, and queries without a table, such as `SELECT 1`,
now run.
- If resetting a queue's concurrency override fails, the override now
stays in place so you can retry the reset.
- Self-hosted instances whose database schema name has capital letters
or a hyphen no longer fail on some dashboard pages.
- Replaying a run with a large payload into a different environment now
works. The new run used to fail because it couldn't find its payload.
- Creating public tokens from scoped task credentials now requires
permission to read stored payloads.
- Chat session streams no longer include a turn refresh token; clients
renew session tokens through their own server, so a viewer given a fixed
token stops when it expires.
- Fix a chat message sent just as an agent run was ending occasionally
going unanswered until the next message arrived.
- The session Trace tab's "View live run" button now only shows when a
run is running and the timeline isn't already zoomed to it.

<details>
<summary>Raw changeset output</summary>

# Releases
## @trigger.dev/core@4.9.0

### Minor Changes

- Add `versionSkew: "follow-mid-turn"` to `chat.agent` and
`chat.createSession`. It does everything `"follow"` does, and also moves
a turn that is still running when its version is below the skew
protection threshold: the turn finishes the step it is on, and a run on
the current deployment continues the same reply from the next step, so
no step runs twice and the person chatting sees one reply.
`chat.handOverAtStep(step)` does the same from your own `prepareStep`.
`chat.requestUpgrade()` called during a turn now moves the turn at the
next step boundary instead of waiting for the turn to end. A turn is
handed over only when the agent in the current deployment was built with
this release or later; otherwise the turn finishes on its own version.
If the API can't be reached during a handover, the old run keeps trying
to start the next run for about three minutes, and a run that continues
a chat while the API can't be reached waits for it rather than answer a
message again.
([`7662a2f83274a47f070ac1970b44f6f633e3d177`](triggerdotdev@7662a2f))

### Patch Changes

- Fix the type of the handle returned by `batch.triggerByTask()`. It
promised `runs`, `isCached` and `idempotencyKey`, which were never
returned, so code like `results.runs[0]` compiled but threw at runtime.
The handle is now typed as what it returns: `batchId`, `runCount` and
`publicAccessToken`; use `batch.retrieve(batchId)` to get the run IDs,
or `batch.triggerByTaskAndWait()` for typed results.
([`80fc05e8a7a647509b26a22e65dc198b94eccdc9`](triggerdotdev@80fc05e))
- `runs.retrieve()` returns a `buffer` field on a buffered task's run:
its buffer key, how many items it collected, and when and why its window
closed.
([`87f77acdfc7c61f07e6958d5d28807d3d26ba510`](triggerdotdev@87f77ac))
- Add buffered tasks to `@trigger.dev/sdk/preview`: a task that collects
triggers over a time or count window and runs once with the array of
payloads. They're in preview and need to be enabled for your
organization. Run tokens can buffer items too.
([`7c1789a12b7860a7363c0119932689c0cd7969bd`](triggerdotdev@7c1789a))

  ```ts
  import { buffer } from "@trigger.dev/sdk/preview";
  import { z } from "zod";

  export const embedItems = buffer.task({
    id: "embed-items",
    schema: z.object({ id: z.string() }),
    buffer: { maxItems: 100, maxDelay: "10s" },
    run: async (items) => {
      // one run per window, with every item it collected
    },
  });

  await embedItems.trigger({ id: "item_1" });
  ```
- Fix `AgentChat` returning another turn's reply, or several replies
joined together, instead of the answer to the message you sent: for
example when continuing a chat without a saved `lastEventId`, sending
two messages in a row, or when a run answers earlier messages first.
Agents now mark where each turn starts and where steered messages join
one on the output stream, so redeploy them on this version; with an
older agent, a reply `AgentChat` can't match to your message is
delivered when its turn completes instead of streamed. Custom readers of
the session output stream must skip control records they don't
recognise. A send aborted before its stream starts now asks the agent to
stop.
([`77fb02dd6cb08134bb5a6c911e59161e55c2b0b3`](triggerdotdev@77fb02d))
- `TriggerChatTransport` now renews its session token only through your
`accessToken` callback, so make it return a freshly minted token from
your server. The `publicAccessToken` option of `chat.writeTurnComplete`
is deprecated and ignored.
([`a070a403729838caf3a32906d4cd1b747c7ad703`](triggerdotdev@a070a40))
- Fix run metadata changes sometimes reaching the API only when the run
finished, so realtime subscribers and parent runs didn't see progress
while the task was still running. This also fixes a metadata `append` or
`increment` occasionally being applied twice at the end of a run, and a
new run that reused the previous run's process sometimes seeing that
run's metadata values.
([`eea6b174096ae9ec3706734f61f13e48f3ff8b8d`](triggerdotdev@eea6b17))
- Runs on a named machine (`machine()`) can warm start again. A runner
on a machine's image now only takes runs for that same machine, so warm
starts no longer have to be turned off for those runs.
([`d719264aa33c44799deebcf678009a69f6cab0ff`](triggerdotdev@d719264))
- Use `machine()` from `@trigger.dev/sdk/preview` to give tasks their
own image and default preset. Add apt packages or Containerfile
instructions to customize the project image. Pass the result as the
task's `machine` option to build its image at deploy time. Available
only to early testers.
([`cef33425c683fbd21992996739bea36fdc4040b5`](triggerdotdev@cef3342))
- JWT validation now accepts only HS256, the algorithm Trigger.dev
tokens are signed with.
([`2f650bd1a702c402ca1c12c2060b375b1d6ddcfd`](triggerdotdev@2f650bd))
- Resume a deployed task as soon as its run is restored after a wait. A
run that was suspended during a wait (`wait.for`, `triggerAndWait`, a
waitpoint token or session input) could take up to 5 seconds longer than
needed to continue, and the waits it finished after that, or a
cancellation, could reach the task with the same delay.
([`27b8200f5d977f9d3a3a78822772c0afdbe2d5a9`](triggerdotdev@27b8200))
- Sandbox tasks restrict outbound network access by default.
`sandbox.network` accepts `"restricted"` (Trigger.dev's services and the
allowed domains of granted Vault variables only), `{ allow:
["api.example.com", "*.example.com"] }` to also allow HTTPS to those
hosts, or `"unrestricted"`. Restricted sandboxes can only make outbound
connections on port 443; a blocked HTTPS request gets a `403` with an
`x-trigger-network-denied` header.
([`5d4d12e5cdbee930468868e72ce36c678a3f8e16`](triggerdotdev@5d4d12e))
- Add `@trigger.dev/sdk/preview` for features in preview. Adds sandboxed
task runs and multiple machine configs as preview features, available
only to early testers.
([`3e98abe3be9466968c162ea7d04547134a824a30`](triggerdotdev@3e98abe))
- Use `sandbox: true` to run a deployed task with access limited to its
own payload and output. Configure `sandbox.envVars` and `sandbox.scopes`
to grant environment variables or additional permissions, including the
`basic` and `oidc` presets. `basic` lets a sandbox inspect and manage
its own run (including metadata and tags), and exchange messages with
its attached Session, including waiting for input. Upgrade the SDK, CLI,
and (when self-hosting) server before adopting this option. `trigger
dev` still runs locally with development credentials and is not an
isolation boundary.
([`024c5999a53fef9c2042c0d715f1d1cf2cf1b569`](triggerdotdev@024c599))
- Add `unstable_signals`: send a small message to every executing run in
an environment that listens for its name, with
`unstable_signals.send(name, payload)`, listen inside a task with
`unstable_signals.on(name, handler)`, read the current latest once with
`unstable_signals.latest(name)`, and forget the latest with
`unstable_signals.clear(name)`. A run that starts listening receives the
latest signal of that name first. Unstable: names and behavior may
change.
([`7662a2f83274a47f070ac1970b44f6f633e3d177`](triggerdotdev@7662a2f))
## @trigger.dev/sdk@4.9.0

### Minor Changes

- Add `versionSkew: "follow-mid-turn"` to `chat.agent` and
`chat.createSession`. It does everything `"follow"` does, and also moves
a turn that is still running when its version is below the skew
protection threshold: the turn finishes the step it is on, and a run on
the current deployment continues the same reply from the next step, so
no step runs twice and the person chatting sees one reply.
`chat.handOverAtStep(step)` does the same from your own `prepareStep`.
`chat.requestUpgrade()` called during a turn now moves the turn at the
next step boundary instead of waiting for the turn to end. A turn is
handed over only when the agent in the current deployment was built with
this release or later; otherwise the turn finishes on its own version.
If the API can't be reached during a handover, the old run keeps trying
to start the next run for about three minutes, and a run that continues
a chat while the API can't be reached waits for it rather than answer a
message again.
([`7662a2f83274a47f070ac1970b44f6f633e3d177`](triggerdotdev@7662a2f))
- Add `@trigger.dev/sdk/preview` for features in preview. Adds sandboxed
task runs and multiple machine configs as preview features, available
only to early testers.
([`3e98abe3be9466968c162ea7d04547134a824a30`](triggerdotdev@3e98abe))

### Patch Changes

- Fix the type of the handle returned by `batch.triggerByTask()`. It
promised `runs`, `isCached` and `idempotencyKey`, which were never
returned, so code like `results.runs[0]` compiled but threw at runtime.
The handle is now typed as what it returns: `batchId`, `runCount` and
`publicAccessToken`; use `batch.retrieve(batchId)` to get the run IDs,
or `batch.triggerByTaskAndWait()` for typed results.
([`80fc05e8a7a647509b26a22e65dc198b94eccdc9`](triggerdotdev@80fc05e))
- Add buffered tasks to `@trigger.dev/sdk/preview`: a task that collects
triggers over a time or count window and runs once with the array of
payloads. They're in preview and need to be enabled for your
organization. Run tokens can buffer items too.
([`7c1789a12b7860a7363c0119932689c0cd7969bd`](triggerdotdev@7c1789a))

  ```ts
  import { buffer } from "@trigger.dev/sdk/preview";
  import { z } from "zod";

  export const embedItems = buffer.task({
    id: "embed-items",
    schema: z.object({ id: z.string() }),
    buffer: { maxItems: 100, maxDelay: "10s" },
    run: async (items) => {
      // one run per window, with every item it collected
    },
  });

  await embedItems.trigger({ id: "item_1" });
  ```
- Fix `AgentChat` returning another turn's reply, or several replies
joined together, instead of the answer to the message you sent: for
example when continuing a chat without a saved `lastEventId`, sending
two messages in a row, or when a run answers earlier messages first.
Agents now mark where each turn starts and where steered messages join
one on the output stream, so redeploy them on this version; with an
older agent, a reply `AgentChat` can't match to your message is
delivered when its turn completes instead of streamed. Custom readers of
the session output stream must skip control records they don't
recognise. A send aborted before its stream starts now asks the agent to
stop.
([`77fb02dd6cb08134bb5a6c911e59161e55c2b0b3`](triggerdotdev@77fb02d))
- On a Head Start first turn, `chat.agent` now asks the user before
running a tool that needs approval, instead of running it as soon as the
agent takes over. Redeploy the agent to get the fix; the route needs no
change. If `run` calls `streamText` again with the handed-over messages
and a tool that needs approval, that call now throws: pass the first
call's response messages instead.
([`fd739033dfaf8e0def6715dedbb63124f838abbc`](triggerdotdev@fd73903))
- `TriggerChatTransport` now renews its session token only through your
`accessToken` callback, so make it return a freshly minted token from
your server. The `publicAccessToken` option of `chat.writeTurnComplete`
is deprecated and ignored.
([`a070a403729838caf3a32906d4cd1b747c7ad703`](triggerdotdev@a070a40))
- The bundled chat agent skills now use `claude-sonnet-5-5` in their
examples. They used `claude-sonnet-4-5`, which Anthropic retires on
November 30, 2026, so agents following the skills would have generated
code that stops working.
([`59dc6636b39147c1297984050181facbf9420bd5`](triggerdotdev@59dc663))
- A `chat.agent` channel's final reply is now the turn's last non-empty
run of text (tool calls split the text into runs), instead of every
step's text joined together. Notes the model wrote before its tool calls
no longer end up in the posted reply, unless nothing follows the last
tool call, in which case the text just before it is posted.
`reply.message` still has every part.
([`7a2dd6ba86a1dcc334a0e853018780b5d8fa05e7`](triggerdotdev@7a2dd6b))
- `chat.customAgent` and `chat.createSession` loops can now hold Head
Start tool calls that need approval: pass the `tools` (and AI SDK 7's
`toolApproval`) you give your `streamText` to `consumeHandover`,
`chat.createSession` or `applyHandover`. `chat.createSession` now also
continues the same assistant message when the client answers a tool
call, as `chat.agent` does, so save replies by message id.
([`d9604faf8e3a2ec4223e626f12f3219970e6187d`](triggerdotdev@d9604fa))
- `TriggerChatTransport` no longer replays the previous answer when a
chat is sent to or reconnected without a saved `lastEventId`, for
example after a page reload that doesn't restore it. Only the current
turn's answer reaches the UI, and a reload mid-answer resumes it live.
With older agents that write no turn markers, the answer can arrive when
its turn completes rather than streaming, and with the oldest, which
record no input cursor, a send made while the agent is idle can still
get the previous answer.
([`04352350bd0ce807f89dc6af15f1d7c4948fbec1`](triggerdotdev@0435235))
- With AI SDK 7's `useChat({ resume: true })`, a chat that remounts
while a reply is still streaming (for example under React StrictMode in
development) now rejoins the reply from its start instead of showing
nothing until the next message.
([`85a3dbc612b09f2530073d7d5e7ab589307c6bc2`](triggerdotdev@85a3dbc))
- A chat message sent while an earlier reply is still running, for
example after Stop on a reply resumed after a reload, now gets only its
own answer instead of the rest of that reply and an error.
([`73061256bb2e39c335f8ca55b7c8ae98b855f1bb`](triggerdotdev@7306125))
- Use `machine()` from `@trigger.dev/sdk/preview` to give tasks their
own image and default preset. Add apt packages or Containerfile
instructions to customize the project image. Pass the result as the
task's `machine` option to build its image at deploy time. Available
only to early testers.
([`cef33425c683fbd21992996739bea36fdc4040b5`](triggerdotdev@cef3342))
- Sandbox tasks restrict outbound network access by default.
`sandbox.network` accepts `"restricted"` (Trigger.dev's services and the
allowed domains of granted Vault variables only), `{ allow:
["api.example.com", "*.example.com"] }` to also allow HTTPS to those
hosts, or `"unrestricted"`. Restricted sandboxes can only make outbound
connections on port 443; a blocked HTTPS request gets a `403` with an
`x-trigger-network-denied` header.
([`5d4d12e5cdbee930468868e72ce36c678a3f8e16`](triggerdotdev@5d4d12e))
- Use `sandbox: true` to run a deployed task with access limited to its
own payload and output. Configure `sandbox.envVars` and `sandbox.scopes`
to grant environment variables or additional permissions, including the
`basic` and `oidc` presets. `basic` lets a sandbox inspect and manage
its own run (including metadata and tags), and exchange messages with
its attached Session, including waiting for input. Upgrade the SDK, CLI,
and (when self-hosting) server before adopting this option. `trigger
dev` still runs locally with development credentials and is not an
isolation boundary.
([`024c5999a53fef9c2042c0d715f1d1cf2cf1b569`](triggerdotdev@024c599))
- Add `unstable_signals`: send a small message to every executing run in
an environment that listens for its name, with
`unstable_signals.send(name, payload)`, listen inside a task with
`unstable_signals.on(name, handler)`, read the current latest once with
`unstable_signals.latest(name)`, and forget the latest with
`unstable_signals.clear(name)`. A run that starts listening receives the
latest signal of that name first. Unstable: names and behavior may
change.
([`7662a2f83274a47f070ac1970b44f6f633e3d177`](triggerdotdev@7662a2f))
- Updated dependencies:
  - `@trigger.dev/core@4.9.0`
## @trigger.dev/build@4.9.0

### Patch Changes

- Updated dependencies:
  - `@trigger.dev/core@4.9.0`
## trigger.dev@4.9.0

### Patch Changes

- Upgrade the CLI's `zod` dependency to 4.6.7.
([`a093664ec1c4f07b2430b497eca1445630f33405`](triggerdotdev@a093664))
- Deployed Bun 1.4 tasks now see `NODE_ENV=production` when bytecode
compilation is enabled.
([triggerdotdev#5164](triggerdotdev#5164))
- When you use Trigger.dev Cloud, the CLI and its MCP server now report
usage analytics tied to your logged-in account: which commands run and
which MCP tools are called, never the arguments you pass. Nothing is
reported for self-hosted or local instances. Turn it off with
`--skip-telemetry` or the `TRIGGER_TELEMETRY_DISABLED` environment
variable.
([`9cc017fff59ca645e313c69addfa6264715b38eb`](triggerdotdev@9cc017f))
- The MCP server's `list_runs` tool now accepts `before` to list the
page before a given cursor, using the previous cursor it shows.
([`37efe87e254c2d2abba6674ecb201d71cb8943a2`](triggerdotdev@37efe87))
- `trigger mcp --profile <name>` now takes precedence over the profile
saved in the project's `.trigger/mcp.json`. Run traces are kept in
memory and are no longer written to disk. `--log-file` now gets stricter
ownership and file-type checks; if the file fails them or cannot be
written, logging is skipped and the server keeps running.
([`5ef5b690b56ac17c7aab3edd63662a0eccc4febb`](triggerdotdev@5ef5b69))
- The MCP server's `trigger_task` tool now accepts `metadata`,
`idempotencyKeyTTL`, `concurrencyKey`, `concurrency`, `debounce`,
`lockToVersion` and `priority`, matching the options you can pass when
triggering from the SDK or the dashboard. Calls without them behave as
before.
([`ea9405ed624126adb741eb3667c8f9a7b1219cb8`](triggerdotdev@ea9405e))

`trigger_task` no longer sets a 10 minute ttl on its own when you pass
any option, including existing ones such as `tags`. A run now gets the
ttl you pass, otherwise the task's ttl, otherwise 10 minutes in dev and
the server's maximum ttl elsewhere (14 days on Trigger.dev Cloud; no
expiry on a self-hosted server without one), and a ttl longer than the
server's maximum is capped at it. Pass `ttl: "10m"` to keep the old
behaviour.
- Runs on a named machine (`machine()`) can warm start again. A runner
on a machine's image now only takes runs for that same machine, so warm
starts no longer have to be turned off for those runs.
([`d719264aa33c44799deebcf678009a69f6cab0ff`](triggerdotdev@d719264))
- Use `machine()` from `@trigger.dev/sdk/preview` to give tasks their
own image and default preset. Add apt packages or Containerfile
instructions to customize the project image. Pass the result as the
task's `machine` option to build its image at deploy time. Available
only to early testers.
([`cef33425c683fbd21992996739bea36fdc4040b5`](triggerdotdev@cef3342))
- Resume a deployed task as soon as its run is restored after a wait. A
run that was suspended during a wait (`wait.for`, `triggerAndWait`, a
waitpoint token or session input) could take up to 5 seconds longer than
needed to continue, and the waits it finished after that, or a
cancellation, could reach the task with the same delay.
([`27b8200f5d977f9d3a3a78822772c0afdbe2d5a9`](triggerdotdev@27b8200))
- Add `unstable_signals`: send a small message to every executing run in
an environment that listens for its name, with
`unstable_signals.send(name, payload)`, listen inside a task with
`unstable_signals.on(name, handler)`, read the current latest once with
`unstable_signals.latest(name)`, and forget the latest with
`unstable_signals.clear(name)`. A run that starts listening receives the
latest signal of that name first. Unstable: names and behavior may
change.
([`7662a2f83274a47f070ac1970b44f6f633e3d177`](triggerdotdev@7662a2f))
- Updated dependencies:
  - `@trigger.dev/core@4.9.0`
  - `@trigger.dev/build@4.9.0`
  - `@trigger.dev/schema-to-json@4.9.0`
## @trigger.dev/linear@4.9.0

### Patch Changes

- Updated dependencies:
  - `@trigger.dev/core@4.9.0`
## @trigger.dev/python@4.9.0

### Patch Changes

- Updated dependencies:
  - `@trigger.dev/core@4.9.0`
## @trigger.dev/react-hooks@4.9.0

### Patch Changes

- Updated dependencies:
  - `@trigger.dev/core@4.9.0`
## @trigger.dev/redis-worker@4.9.0

### Patch Changes

- Updated dependencies:
  - `@trigger.dev/core@4.9.0`
## @trigger.dev/rsc@4.9.0

### Patch Changes

- Updated dependencies:
  - `@trigger.dev/core@4.9.0`
## @trigger.dev/schema-to-json@4.9.0

### Patch Changes

- Updated dependencies:
  - `@trigger.dev/core@4.9.0`
## @trigger.dev/slack@4.9.0

### Patch Changes

- Updated dependencies:
  - `@trigger.dev/core@4.9.0`
## @trigger.dev/convex@4.9.0

No changes in this release.

</details>

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@ethandaniel

Copy link
Copy Markdown
Contributor Author

Thanks for this @ethandaniel, should go out with our next release later today or tomorrow.

Appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants