Commit Graph

6683 Commits

Author SHA1 Message Date
James Ritchie 0fc234b970 Fixes incorrect icon colors (#2339) 2025-08-04 13:18:32 +01:00
James Ritchie f8126871f3 Improves large output messaging (#2341)
* Adds more information to the large payloads/outputs

* Changes the Download logs button to secondary
2025-08-04 13:18:07 +01:00
James Ritchie df0dc07678 New Task page deploy blank state (#2344)
* Adds a step by step deploy blank state to Tasks page

* Adds links to Ask AI, docs and troubleshooting
2025-08-04 13:17:06 +01:00
James Ritchie 63857b0445 Makes it clear you only get preview branches if you’re on v4 (#2343) 2025-08-04 13:13:38 +01:00
James Ritchie b985843642 Prevents long project menu titles pushing the admin buttons out of bounds (#2332) 2025-08-04 13:13:03 +01:00
Boon Kai 9ecda816dc fix(cli): improve contrast for chalkWorker yellow in light mode (#2239)
* fix(cli-output): improve color contrast for chalkWorker on light mode

* add changeset

---------

Co-authored-by: nicktrn <55853254+nicktrn@users.noreply.github.com>
2025-08-04 12:09:38 +01:00
nicktrn 7b54c3527e fix(otel): prevent infinite retry loops on unicode hex escape errors (#2337)
* prevent infinite retry loop for unicode errors

* structured logs for prisma events

* preserve all prisma event fields

* either use structured logs or stdout, never both

* split runs repo tests

* decrease test shards to 8
2025-08-02 16:54:11 +01:00
nicktrn 60b8c76adc fix(hosting): pass registry namespace env var to webapp, bump helm (#2336)
* pass deploy registry namespace to webapp

* bump helm chart and images
2025-08-02 14:20:55 +01:00
Eric Allam 3fd8ea80da fix: backwards compatible snapshot runStatus to prevent DEQUEUED status from breaking older runners (#2335)
🚀 Publish Trigger.dev Docker / units (push) Failing after 0s
🚀 Publish Trigger.dev Docker / typecheck (push) Failing after 3s
🚀 Publish Trigger.dev Docker / publish-webapp (push) Has been skipped
🚀 Publish Trigger.dev Docker / publish-worker (push) Has been skipped
🚀 Publish Trigger.dev Docker / publish-worker-v4 (push) Has been skipped
v.docker.4.0.0-v4-beta.26.1
2025-08-01 17:19:58 +01:00
Matt Aitken c576e98dbc Fix v4 changelog latest date (#2333) 2025-08-01 15:23:55 +01:00
Matt Aitken b9e62139ff v4 docs upgrade changelog (#2331) 2025-08-01 14:17:40 +01:00
github-actions[bot] 44af80e055 Release v4.0.0-v4-beta.26
🚀 Publish Trigger.dev Docker / typecheck (push) Failing after 4s
🚀 Publish Trigger.dev Docker / publish-webapp (push) Has been skipped
🚀 Publish Trigger.dev Docker / publish-worker (push) Has been skipped
🚀 Publish Trigger.dev Docker / publish-worker-v4 (push) Has been skipped
🚀 Publish Trigger.dev Docker / units (push) Failing after 4s
* chore: Update version for release (v4-beta)

* Release v4.0.0-v4-beta.26

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Aitken <matt@mattaitken.com>
@trigger.dev/python@4.0.0-v4-beta.26 @trigger.dev/build@4.0.0-v4-beta.26 @trigger.dev/core@4.0.0-v4-beta.26 @trigger.dev/redis-worker@4.0.0-v4-beta.26 @trigger.dev/rsc@4.0.0-v4-beta.26 @trigger.dev/sdk@4.0.0-v4-beta.26 trigger.dev@4.0.0-v4-beta.26 v.docker.4.0.0-v4-beta.26 @trigger.dev/react-hooks@4.0.0-v4-beta.26
2025-08-01 12:48:08 +01:00
James Ritchie 1feabd732e Docs: Adds a Reduce your spend docs page (#2330) 2025-08-01 09:20:10 +01:00
Eric Allam 134942b2dd The schedule HTTP API now accepts deduplicationKeys as well as schedule IDs in the URL (#2329) 2025-07-31 14:12:31 +01:00
Eric Allam b153324cd9 fix: importing from runEngine/index.js breaks non-node runtimes (#2328) 2025-07-31 13:22:02 +01:00
James Ritchie 59bfce86db Docs: Fixes incorrect concurrency pricing on the limits page (#2324) 2025-07-31 12:07:42 +01:00
Eric Allam 748565c9db Fix backwards compatible execution by allowing additional properties to passthrough (#2327) 2025-07-31 11:14:46 +01:00
Matt Aitken 8b31871998 Usage billing alerts (#2323)
* First draft billing alerts page

* Budget alert form working

* Don't let free plan users change the billing alert amount

* Fix missing key in map in the form

* Disable queues/org from admin API endpoint

* Don't allow resuming if runsEnabled is false

* Refer to "Billing alerts" not "Plans"

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Form missing dependencies fix

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Deal with thrown errors, fix for duplicating email fields

* Added a RuntimeEnvironment organizationId index

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-07-30 13:48:02 +01:00
Eric Allam 14dcc76f93 feat: run.ctx tidying and additions (#2322)
* Cleanup context and execution creation, cache stuff, add parent and root task run ids

* more efficient by using friendly IDs instead of doing joins

* metadata.root/parent now reference current run when run has no root/parent

* Adding changeset

* try to make test less flaky

* Clean imports

* Another attempt to fix the flaky test

* Fix usage by still passing durationMs and costInCents to the execution, just not the run.ctx
2025-07-30 13:47:12 +01:00
Nicolas Rigaudière 5ea6605ec6 feat(extensions): add lightpanda (#2192)
* feat: add lightpanda structure

* chore: add lightpanda doc links

* fix: lightpanda extension instructions

* feat: add Lightpanda guide and examples

* feat: lightpanda - add 3rd example

* feat: add lightpandaTask

* fix: lightpanda 3rd example

* fix: lightpanda 1st example

* chore: add changeset

* add v4 tag to guide

* fix: merge lightpanda docker instructions

* fix: add failsafes

* add scrape warning

* lint

* successful login also switches to that profile

* update docs and links as this is v4 only

* extension tweaks

* simplify extension

* update examples

* update docs

* remove from extensions list as v4 only

* remove from catalog

* update changeset

---------

Co-authored-by: nicktrn <55853254+nicktrn@users.noreply.github.com>
2025-07-28 18:38:13 +01:00
nicktrn 3e1cc69db9 feat(ecr): make assume role optional (#2321) 2025-07-28 14:47:30 +01:00
nicktrn 2ea52da628 fix(runner): disable warm starts after SIGTERM (#2316)
* security: bump form-data to latest patch versions (CVE-2025-7783)

* disable warm starts on sigterm

* add changeset
2025-07-28 11:29:49 +01:00
Saadi Myftija 3493b9464f Cancel readonly ClickHouse queries on client close (#2319) 2025-07-28 11:00:35 +01:00
Eric Allam a7ff6de388 fix: otel logs better DynamicFlushScheduler (#2318)
* Improve dynamic flush scheduler for otel data

The changes introduce a more flexible and adaptive dynamic flush scheduler to address production issues where the system wasn't flushing data fast enough, causing memory growth and crashes. This issue arises from the existing scheduler handling only a single flush at a time, limiting concurrency and failing to cope with the influx of logs.

- Added configuration options for setting minimum and maximum concurrency levels, maximum batch size, and memory pressure threshold. These parameters ensure that flush operations adjust dynamically based on workload and pressure.
- Implemented `pLimit` to facilitate concurrent flush operations, with adjustments made according to batch queue length and memory pressure.
- Metrics reporting improvements were added to monitor the dynamic behavior of the flush scheduler, aiding in identifying performance issues and optimizing the operation accordingly.

* Implement load shedding for TaskEvent records

This change introduces load shedding mechanisms to manage TaskEvent
records, particularly those of kind LOG, when the system experiences
high volumes and is unable to flush to the database in a timely
manner. The addition aims to prevent overwhelming the system and
ensure critical tasks are prioritized.

- Added configuration options for `loadSheddingThreshold` and
  `loadSheddingEnabled` in multiple modules to activate load shedding.
- Introduced `isDroppableEvent` function to allow specific events to
  be dropped when load shedding is enabled.
- Ensured metrics are updated to reflect dropped events and load
  shedding status, providing visibility into system performance
during high load conditions.
- Updated loggers to inform about load shedding state changes,
  ensuring timely awareness of load management activities.

* Fix undefined 'queuePressure' variable in DynamicFlushScheduler

The 'queuePressure' variable was being used without being defined
in the DynamicFlushScheduler class, causing potential runtime
errors. This commit adds the missing definition and ensures that
the variable is correctly calculated based on the 'totalQueuedItems'
and 'memoryPressureThreshold'.

- Addressed code inconsistencies and improved formatting.
- Defined 'queuePressure' in the 'adjustConcurrency' method
  to prevent potential undefined errors.
- Enhanced readability by maintaining consistent spacing and
  format across the file, contributing to the stability and
  maintainability of the code.
- Adjusted batch size logic based on the newly defined 'queuePressure'
  variable.

* Refactor concurrency adjustment logic in scheduler

The concurrency adjustment logic in the dynamic flush scheduler has been refactored to improve clarity and maintainability. This change moves the calculation of pressure metrics outside of the conditional blocks to ensure they are always determined prior to decision-making.

- The queue pressure and time since last flush calculations were moved up in the code to be independent of the 'backOff' condition.
- This refactor sets up the groundwork for more reliable concurrency scaling and better performance monitoring capabilities. The overall logic of adjusting concurrency based on system pressure metrics remains unchanged.

This adjustment addresses ongoing issues with the scheduler that were not resolved by previous changes.

* Some tweaks
2025-07-26 11:06:56 +01:00
Eric Allam 0d136a3e0c fix runs.retrieve when the payload or output has unstringifiable JSON (#2315) 2025-07-25 12:00:05 +01:00
nicktrn c8165ccd44 security: bump form-data to latest patch versions (CVE-2025-7783) (#2314) 2025-07-24 17:44:19 +01:00
Eric Allam 00cc07dad3 Ignore queryRoute() call aborted errors (#2313) 2025-07-24 16:22:21 +01:00
Eric Allam 71693eb9b3 stop double reporting errors to sentry (#2312) 2025-07-24 16:02:26 +01:00
Eric Allam fb59bfd8f8 sentry: remove node native integration because it breaks (#2311) 2025-07-24 15:37:06 +01:00
Matt Aitken 038ee75c28 Queue "View runs" buttons turn off root only (#2310) 2025-07-24 15:26:56 +01:00
Eric Allam 09d0e80804 Add sentry error reporting (#2309)
* Sentry WIP

* Configure sentry for uploading and releasing during the publish webapp step

* Delete source maps after uploading

* Forward logger.error calls to sentry through Logger.onError

* Couple tweaks to the dockerfile
2025-07-24 15:09:50 +01:00
Saadi Myftija 74808d7400 Pre-merge and pre-sort run batches before sending to clickhouse (#2308)
* Premerge run batch before sending it to clickhouse

* Pre-order batch items before sending to clickhouse in favor of performance

* existing

* Emit event on batch flushes

* When merging batches, keep the last occurrence items with the same version

* Add a couple of tests
2025-07-24 14:17:26 +01:00
Matt Aitken 6791328a94 Queues dashboard update (burst concurrency) (#2293)
* Initial burst changes to queue page

* Added tooltip and changed wording around

* View runs from Queues page

* Fix for ugly Version filter "Current" badge
2025-07-24 10:17:54 +01:00
Eric Allam 3dce1f66f7 docs: beta.25 changelog entry (#2306) 2025-07-24 09:38:24 +01:00
github-actions[bot] 17bb0c0cef Release v4.0.0-v4-beta.25
🚀 Publish Trigger.dev Docker / typecheck (push) Failing after 3s
🚀 Publish Trigger.dev Docker / publish-webapp (push) Has been skipped
🚀 Publish Trigger.dev Docker / publish-worker (push) Has been skipped
🚀 Publish Trigger.dev Docker / publish-worker-v4 (push) Has been skipped
🚀 Publish Trigger.dev Docker / units (push) Failing after 4s
* chore: Update version for release (v4-beta)

* Release v4.0.0-v4-beta.25

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Eric Allam <eallam@icloud.com>
@trigger.dev/python@4.0.0-v4-beta.25 @trigger.dev/build@4.0.0-v4-beta.25 @trigger.dev/core@4.0.0-v4-beta.25 @trigger.dev/react-hooks@4.0.0-v4-beta.25 @trigger.dev/redis-worker@4.0.0-v4-beta.25 @trigger.dev/rsc@4.0.0-v4-beta.25 trigger.dev@4.0.0-v4-beta.25 v.docker.4.0.0-v4-beta.25 @trigger.dev/sdk@4.0.0-v4-beta.25
2025-07-23 20:22:33 +01:00
Eric Allam ef59a62368 Ability to perform bulk run backfills (#2304)
* Ability to perform bulk run backfills

* Fix tests

* Allow controlling the delay interval when creating the batch
2025-07-23 20:12:35 +01:00
Eric Allam b447a8040f Use sync insert strategy since we are already batching client-side (#2303) 2025-07-23 17:17:13 +01:00
Matt Aitken ed86b4f5db Run repository test fix (#2302)
The normal database needs to be mocked because an import somewhere is 
using it which causes issues with the test container dbs and hanging at 
the end. 

Strategy copied from the trigger test file.
2025-07-23 17:10:20 +01:00
Matt Aitken 9b0eb64035 Fallback from ClickHouse to Postgres (#2300)
* Set the default replication concurrency to 2 for self-hosters

100 was a bit crazy

* Made the run repository an interface, deferring just to CH for now

* Added run repository feature flag, allowing passing a default when getting a flag

* Switch run repository using a feature flag

* Added spans

* Pass the default repository in, so we can try Postgres in the tests

* Fallback to Postgres if ClickHouse errors

* Update feature flags API endpoint
2025-07-23 16:30:30 +01:00
Eric Allam c927fbc8e4 Gracefully shutdown task run processes (#2299)
* Gracefully shutdown task run processes

* better log, thanks coderabbit
2025-07-23 16:11:26 +01:00
Matt Aitken bf4fff9cca The tasks page shows an error rather than breaking the entire page (#2297) 2025-07-23 12:28:06 +01:00
Saadi Myftija ad1672d95f Fail gracefully when runs cannot be loaded (#2296) 2025-07-23 11:21:54 +01:00
Eric Allam 6df7eb2bb5 docs: new release concurrency system and run statuses (#2287)
* WIP new docs for the new release concurrency and run statuses

* Fixed status description

* Add the beta.24 changelog entry
2025-07-22 11:30:28 +01:00
github-actions[bot] 36ced50c04 Release 4.0.0-v4-beta.24
🚀 Publish Trigger.dev Docker / typecheck (push) Failing after 0s
🚀 Publish Trigger.dev Docker / publish-webapp (push) Has been skipped
🚀 Publish Trigger.dev Docker / publish-worker (push) Has been skipped
🚀 Publish Trigger.dev Docker / publish-worker-v4 (push) Has been skipped
🚀 Publish Trigger.dev Docker / units (push) Failing after 4s
* chore: Update version for release (v4-beta)

* Release 4.0.0-v4-beta.24

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Eric Allam <eallam@icloud.com>
@trigger.dev/python@4.0.0-v4-beta.24 @trigger.dev/build@4.0.0-v4-beta.24 @trigger.dev/core@4.0.0-v4-beta.24 @trigger.dev/react-hooks@4.0.0-v4-beta.24 @trigger.dev/rsc@4.0.0-v4-beta.24 @trigger.dev/sdk@4.0.0-v4-beta.24 trigger.dev@4.0.0-v4-beta.24 v.docker.4.0.0-v4-beta.24 @trigger.dev/redis-worker@4.0.0-v4-beta.24
2025-07-22 10:42:59 +01:00
Eric Allam 684e02c8c8 fix: prevent large root/parent metadata updates from endlessly retrying (#2290)
* fixing metadata WIP

* WIP

* fix: prevent large root/parent metadata updates from endlessly retrying

* Fixed other calls to handleMetadataPacket
2025-07-21 23:04:44 +01:00
Matt Aitken 4b9f33082e AI run filtering (#2285)
* Queue in run table and filtering

* Debounce the filter changes

* Remove console log

* Added machine filtering

* Added version filtering

* Filter by version in the db

* Removed duplicate classes

* Version filtering hasFilters consistency

* Added queues and machines to the bulk action summary

* runs.list filtering for queue and machine

* Fix for machine errors

* Input field now has accessory instead of shortcut

* First experiments with the UI

* Got the fake filtering working

* AI filtering is working pretty well 

* Started working on tool calling

* Tool calling is working

* Styling progress

* Working on the error

* Errors work, improved the styling

* Nice glow effect

* Tweak the darkness of the text field

* Re-ordered the UI, set AI settings to use system prompt and telemetry

* Refactored to make it testable

* Added basic evals

* Better time inputs and evals

* Removed some code comments

* Remove unused useSearchParam change

* Tidy imports

* If no OpenAI API key send json back

* Fix for merge conflict with duplicate query filters

* Another conflict resolved

* Another merge conflict resolved

* Pass the model in, allow changing it
2025-07-21 17:53:43 +01:00
Matt Aitken a90b73c7ca Filter runs by queue, machine, version (#2277)
* Queue in run table and filtering

* Debounce the filter changes

* Remove console log

* Added machine filtering

* Added version filtering

* Filter by version in the db

* Removed duplicate classes

* Version filtering hasFilters consistency

* Added queues and machines to the bulk action summary

* runs.list filtering for queue and machine

* Fix for machine errors
2025-07-21 16:21:46 +01:00
Eric Allam ff018718f7 Added experimental_devProcessCwdInBuildDir config option (#2269)
* Added experimental_devProcessCwdInBuildDir config option

Added experimental_devProcessCwdInBuildDir config option to opt-in to new process.cwd behavior when executing tasks in the dev CLI. Currently process.cwd maps to the "root" of your trigger.dev project (the directory that contains your trigger.config.ts file). Setting experimental_devProcessCwdInBuildDir to true changes process.cwd to instead be the temporary build directory inside of the .trigger directory.

This makes it so the files added via the additionalFiles extension can be read using the same path in dev and deployed tasks.

* Remove claude code reference because it breaks windows tests 😡
2025-07-21 16:06:25 +01:00
Eric Allam 07980f8ebd fix: allow updating run metadata up to 1 hour after completion (#2288) 2025-07-21 16:05:29 +01:00
Eric Allam 8d5c86fea0 v4: simplified release concurrency system and status changes (#2284)
* WIP

* Make release concurrency system extremely simple, everything just releases all the time

* update the deadlock detection to use the new lockedQueueReleaseConcurrencyOnWaitpoint column

* WIP new release concurrency system

* Remove releaseConcurrency and releaseConcurrencyOnWaitpoint

Also removed deadlock detection, and added environment burst concurrency

* Added new DEQUEUED status

Cleaned up the API run statuses, including now detecting new clients and not breaking older clients by adding an API version header to all requests

* Introduce the new "current dequeued concurrency set"

* Remove QUEUED_EXECUTING because we no longer "eagerly" release before checkpointing

* Remove waitpoint test for QUEUED_EXECUTING

* Add isWaiting

* Add changeset

* Use createdAt for ordering realtime runs instead of number

* Clarify the envCurrentDequeuedKey usage

* mock the db.server file to fix the tests

* Updated changset "EXECUTED" -> "EXECUTING"

---------

Co-authored-by: Matt Aitken <matt@mattaitken.com>
2025-07-21 15:45:27 +01:00