[pull] main from triggerdotdev:main#111
Merged
Merged
Conversation
#3554) ## Summary TTL expiration on queued runs was being scheduled twice: once via a per-run `expireRun` worker job (the original implementation) and once via the batch TTL system (added more recently). Both paths attempt to flip the same run to `EXPIRED`. The per-run job almost always won the race, leaving the batch consumer to observe runs already expired by the older path. This collapses TTL expiration onto the batch path so every queued TTLed run goes through a single Redis-backed sorted set + batch consumer instead of also getting its own scheduled redis-worker job. ## Design `engine.trigger` and `delayedRunSystem.enqueueDelayedRun` no longer call `ttlSystem.scheduleExpireRun`. The remaining `enqueueSystem.enqueueRun({ includeTtl: true })` already adds the run to the TTL sorted set; `TtlSystem.expireRunsBatch` flips it to `EXPIRED` when the TTL fires. Delayed runs get the same coverage by passing `includeTtl: true` on their post-delay enqueue, so the TTL is armed from the moment the run enters the queue (matching how the old job behaved — `parseNaturalLanguageDuration` is evaluated at enqueue time). The new path explicitly does not re-expire runs once they have been allocated a concurrency slot. That is intentional: TTL is for runs that are queued and have never started. Once a run has a slot it is on its way to executing. ## Test plan - [x] `pnpm run test --filter @internal/run-engine ./src/engine/tests/ttl.test.ts` — 15 tests, including a new "Re-enqueued runs are not expired by TTL once they have started" that locks in the queued-and-never-started contract. - [x] `pnpm run test --filter @internal/run-engine ./src/engine/tests/delays.test.ts` — 5 tests, including "Delayed run with a ttl" which now also asserts the TTL is armed from queue-enter time, not `createdAt`. - [x] `pnpm run test --filter @internal/run-engine ./src/engine/tests/lazyWaitpoint.test.ts` — 12 tests. - [x] `pnpm run typecheck --filter @internal/run-engine`.
…ges (#3559) ## Summary Make `taskIdentifier` optional on the run-queue message schema. No behavior change in this PR; readers continue to accept payloads that include the field. A separate change will stop writing it on the wire to shrink the per-run payload that lives in Redis while runs wait to be dequeued. ## Design The field is written into every payload at enqueue time but no consumer reads it back on the dequeue path. Both the run-engine and supervisor derive `taskIdentifier` from the loaded `TaskRun` row instead. Relaxing the schema first means readers tolerate payloads that omit it, so the writer-side change can ship without producing schema-parse errors during a rolling deploy. `projectId` is left required: `WorkerQueueResolver.#getOverride` reads it for project-scoped runtime worker-queue overrides. ## Test plan - [x] `pnpm run typecheck --filter @internal/run-engine` - [x] `pnpm run typecheck --filter webapp` - [x] `pnpm run test ./src/run-queue/tests/enqueueMessage.test.ts ./src/run-queue/tests/workerQueueResolver.test.ts --run` (28/28 passing)
### Style updates to the notifications - Tightened up the typography - Brighter background to make it stand out a bit more - A bit more padding to make it more readable - Show the close button on hover instead - Turned the notification into a separate component as it's shared on the admin page modal - Minor tweaks to the behavior of toggling the notification beween open/closed side menu states ### Before <img width="224" height="313" alt="before" src="https://github.com/user-attachments/assets/c9a9377c-4a3b-4477-921a-3c86385d3f0b" /> ### After (with image) <img width="239" height="284" alt="CleanShot 2026-05-11 at 17 22 01" src="https://github.com/user-attachments/assets/311b4dbc-4853-4e6c-9f83-8173b38bd466" /> ### After (no image) <img width="239" height="189" alt="after" src="https://github.com/user-attachments/assets/884e062b-3608-4cb3-a462-d50597257753" /> --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )