Trigger.dev v4.8.7

Concurrency key objects for `chat.agent`, 6 AI SDK 7 bug fixes, and 4 server improvements.

1 improvement, 6 bug fixes, and 4 server changes.

Improvements

  • chat.agent and sessions now accept the object form of concurrencyKey in triggerConfig, giving each concurrency limit its own key, the same as task.trigger(). (767ab452)

Bug fixes

  • Fix runs failing with TASK_DID_CONCURRENT_WAIT on their first wait when processKeepAlive is enabled. (fe57ea01)
  • Fix chat.agent channels on AI SDK 7 failing the whole turn when a channel file can't be downloaded. The file is now replaced with an [Attached file "…" could not be loaded] note and the turn continues. AI SDK 7 describes file URLs in a tagged form the SDK didn't recognise. On AI SDK 6, an inline data: file in a channel message is no longer passed to a connector's download. (c888eb88)
  • Fix two compaction problems on AI SDK 7: a chat.agent turn resuming after a tool approval sent the full pre-compaction transcript instead of the summary, and between-turn compaction checked whole-turn token usage instead of the last step's, triggering shouldCompact thresholds too early on multi-step turns. If you call compactIfNeeded on a chat.MessageAccumulator, pass the last step's usage: (await result.steps).at(-1)?.usage. (c615d762)
  • Fix chat.agent steering on AI SDK 7: a steering message turned into a system message no longer fails the step with an invalid-prompt error. chat.toStreamTextOptions() now sets allowSystemInMessages: true (pass allowSystemInMessages: false after the spread to keep AI SDK 7's strict default). A turn whose stream ends on an error now correctly reports finishReason: "error" in onTurnComplete. (53f17ee0)
  • Fix a chat.agent tool result containing a BigInt failing the next turn when the app defines BigInt.prototype.toJSON. The value is now serialized using toJSON before being sent to the model. (8167e49f)
  • Fix chat.agent failing with AI_InvalidPromptError ("The messages do not match the ModelMessage[] schema") when a tool returns a non-plain-JSON value such as a Date from an ORM row. On AI SDK 6 and AI SDK 7 before 7.0.101, tool results are now converted to JSON consistently: a Date becomes its ISO string, and a value JSON can't hold (such as a BigInt or circular reference) is replaced by an error result that names the tool and the field. (49b3dc05)

Server changes

These changes are included in the v4.8.7 Docker image and are already live on Trigger.dev Cloud:

  • Worker registration now checks the size and encoding of task source files, with an error that names the file if one can't be accepted.
  • The session page now shows a message when earlier conversation messages couldn't be loaded, with a retry option; closing a session keeps the view you were on.
  • On a live run's trace, "Errors only" and search now pick up a span that fails or gets a new name after it first appears.
  • Alert webhook URL validation is now consistent with other outbound URL checks.

How to upgrade

Update the trigger.dev/* packages to v4.8.7 using your package manager:


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 users: update your Docker image to ghcr.io/triggerdotdev/trigger.dev:v4.8.7.

Deploy your first agent today

Get set up in minutes, either on your own or with your coding agent.

Get started for free