Skip to content

Commit 2301ed6

Browse files
authored
refactor(run-engine): make taskIdentifier optional on run-queue messages (#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)
1 parent 5f1a3e1 commit 2301ed6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • internal-packages/run-engine/src/run-queue

internal-packages/run-engine/src/run-queue/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import type { MinimalAuthenticatedEnvironment } from "../shared/index.js";
44

55
export const InputPayload = z.object({
66
runId: z.string(),
7-
taskIdentifier: z.string(),
7+
/** Deprecated: not read on the V2 dequeue path; will stop being written in a follow-up. Optional to keep new readers compatible with old payloads that still include it, and vice versa. */
8+
taskIdentifier: z.string().optional(),
89
orgId: z.string(),
910
projectId: z.string(),
1011
environmentId: z.string(),

0 commit comments

Comments
 (0)