Skip to content

trigger.dev v4.9.0

Latest

Choose a tag to compare

@github-actions github-actions released this 01 Dec 15:06
· 13 commits to main since this release
1b6f836

trigger.dev v4.9.0

Upgrade

npx trigger.dev@latest update  # npm
pnpm dlx trigger.dev@latest update  # pnpm
yarn dlx trigger.dev@latest update  # yarn
bunx trigger.dev@latest update  # bun

Self-hosted Docker image: ghcr.io/triggerdotdev/trigger.dev:v4.9.0

Release notes

Read the full release notes: https://trigger.dev/changelog/v4-9-0

What's changed

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)

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)

  • 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)

  • 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)

    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)

  • 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)

  • 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)

  • JWT validation now accepts only HS256, the algorithm Trigger.dev tokens are signed with. (2f650bd1a702c402ca1c12c2060b375b1d6ddcfd)

  • 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)

  • 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)

  • 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)

  • 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)

  • 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)

  • 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)

  • 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)

  • 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)

  • 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)

  • 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)

  • 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)

  • Upgrade the CLI's zod dependency to 4.6.7. (a093664ec1c4f07b2430b497eca1445630f33405)

  • Deployed Bun 1.4 tasks now see NODE_ENV=production when bytecode compilation is enabled. (#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)

  • 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)

  • 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)

  • 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)

    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)
  • 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)
  • 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)

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.

All packages: v4.9.0

@trigger.dev/build, @trigger.dev/convex, @trigger.dev/core, @trigger.dev/linear, @trigger.dev/python, @trigger.dev/react-hooks, @trigger.dev/redis-worker, @trigger.dev/rsc, @trigger.dev/schema-to-json, @trigger.dev/sdk, @trigger.dev/slack, trigger.dev

Contributors

Chris Arderne, Eric Allam, Katia Bulatova, @d-cs, Paul Cioanca, @Mariefay, Wes Mason, @nicktrn, Saadi Myftija, Adrien de Peretti, @jack, Oskar Otwinowski, triggerdotdev-the-inspector[bot], github-actions[bot], João Dias, @D-K-P, Matt Aitken, pullfrog[bot], @isshaddad, claude[bot], dependabot[bot], James Ritchie, bufo-dev[bot], Ethan Daniel

Full changelog: v4.8.0...v4.9.0