Files
triggerdotdev--trigger.dev/apps/webapp
Eric Allam 55fa0f7266 fix(core,webapp): plumb maxDuration / lockToVersion / region through SessionTriggerConfig + sync playground transport clientData
Two fixes from Devin's review on PR #3173.

## SessionTriggerConfig is missing 3 fields the playground UI shows

The playground sidebar (`PlaygroundSidebar`) renders working controls for
`maxDuration`, `version`, and `region`. The action received the form fields,
but `SessionTriggerConfig` didn't accept them so they were `void`-suppressed
and silently dropped. Runs ignored the user's max-duration cap, the version
pin didn't apply, and region selection had no effect.

- `packages/core/src/v3/schemas/api.ts` — add three optional fields to
  `SessionTriggerConfig`: `maxDuration` (positive int, seconds),
  `lockToVersion` (string), `region` (string). All three forward to the
  matching field on `TaskRunOptions`.
- `apps/webapp/app/services/realtime/sessionRunManager.server.ts` — extend
  `triggerSessionRun`'s `body.options` to thread the three fields through
  to `TriggerTaskService` when present.
- `apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.playground.action.tsx`
  — fold the three form fields into `triggerConfig`; remove the `void`
  suppressions.

## Playground transport's clientData becomes stale after edits

The route constructs `TriggerChatTransport` directly via `useRef` (to avoid
the React-version mismatch the hook had). The hook normally calls
`setClientData` whenever `clientData` changes, but this manual construction
bypassed that — so `clientData` was captured at construction and never
updated. Per-turn `metadata` merges (`this.defaultMetadata` in
`packages/trigger-sdk/src/v3/chat.ts`) used the stale initial value for
the whole conversation. `startSession` was already reading from the live
ref so session creation was unaffected; this only fixed the per-turn path.

- `apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.playground.$agentParam/route.tsx`
  — add a `useEffect` that calls `transport.setClientData(...)` whenever
  `clientDataJson` changes.

Changeset (patch, @trigger.dev/core) for the schema additions; server-
changes file for the webapp-only behaviour fix.
2026-05-10 22:11:25 +01:00
..
2026-01-09 11:39:36 +00:00
2025-03-08 14:53:06 +00:00
2023-01-10 16:09:42 +00:00
2022-12-06 12:28:16 +00:00
2024-10-09 12:52:52 +01:00

Trigger webapp - powered by Remix

To start, run with pnpm run dev --filter webapp

Build the docker image locally:

pnpm run docker:build:webapp
docker run -it triggerdotdev-webapp sh