From fc6441f100744fcfb134f3a6e6134bab5f3397e7 Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Wed, 16 Jul 2025 17:15:32 +0100 Subject: [PATCH 01/13] Access machinePreset from the run list presenter --- apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts | 1 + apps/webapp/app/services/runsRepository.server.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts b/apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts index bc061b36d7..5bda4bc673 100644 --- a/apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts +++ b/apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts @@ -231,6 +231,7 @@ export class NextRunListPresenter { rootTaskRunId: run.rootTaskRunId, metadata: run.metadata, metadataType: run.metadataType, + machinePreset: run.machinePreset, }; }), pagination: { diff --git a/apps/webapp/app/services/runsRepository.server.ts b/apps/webapp/app/services/runsRepository.server.ts index 156efa45e3..acc3670206 100644 --- a/apps/webapp/app/services/runsRepository.server.ts +++ b/apps/webapp/app/services/runsRepository.server.ts @@ -169,6 +169,7 @@ export class RunsRepository { batchId: true, metadata: true, metadataType: true, + machinePreset: true, }, }); From fa8c893fec813317c70aad8158505f3f3e8ea8d3 Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Wed, 16 Jul 2025 17:15:50 +0100 Subject: [PATCH 02/13] New icons for machine presets --- apps/webapp/app/assets/icons/MachineIcon.tsx | 221 +++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 apps/webapp/app/assets/icons/MachineIcon.tsx diff --git a/apps/webapp/app/assets/icons/MachineIcon.tsx b/apps/webapp/app/assets/icons/MachineIcon.tsx new file mode 100644 index 0000000000..a58023a283 --- /dev/null +++ b/apps/webapp/app/assets/icons/MachineIcon.tsx @@ -0,0 +1,221 @@ +import { cn } from "~/utils/cn"; + +export function MachineIcon({ preset, className }: { preset?: string; className?: string }) { + if (!preset) { + return ; + } + + switch (preset) { + case "no-machine": + return ; + case "micro": + return ; + case "small-1x": + return ; + case "small-2x": + return ; + case "medium-1x": + return ; + case "medium-2x": + return ; + case "large-1x": + return ; + case "large-2x": + return ; + default: + return ; + } +} + +function MachineDefaultIcon({ className }: { className?: string }) { + return ( + + + + + + ); +} + +function MachineIconNoMachine({ className }: { className?: string }) { + return ( + + + + + + + ); +} + +function MachineIconMicro({ className }: { className?: string }) { + return ( + + + + + + ); +} + +function MachineIconSmall1x({ className }: { className?: string }) { + return ( + + + + + + ); +} + +function MachineIconSmall2x({ className }: { className?: string }) { + return ( + + + + + + ); +} + +function MachineIconMedium1x({ className }: { className?: string }) { + return ( + + + + + + ); +} + +function MachineIconMedium2x({ className }: { className?: string }) { + return ( + + + + + + ); +} + +function MachineIconLarge1x({ className }: { className?: string }) { + return ( + + + + + + ); +} + +function MachineIconLarge2x({ className }: { className?: string }) { + return ( + + + + + + ); +} From c570803bc167a8c7f51ad3ca431ea997b041eaa9 Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Wed, 16 Jul 2025 17:17:04 +0100 Subject: [PATCH 03/13] New icon + name combo label for the machine preset --- .../app/components/MachineLabelCombo.tsx | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 apps/webapp/app/components/MachineLabelCombo.tsx diff --git a/apps/webapp/app/components/MachineLabelCombo.tsx b/apps/webapp/app/components/MachineLabelCombo.tsx new file mode 100644 index 0000000000..5f36dbb881 --- /dev/null +++ b/apps/webapp/app/components/MachineLabelCombo.tsx @@ -0,0 +1,63 @@ +import { type MachinePresetName } from "@trigger.dev/core/v3"; +import { MachineIcon } from "~/assets/icons/MachineIcon"; +import { cn } from "~/utils/cn"; + +export function MachineLabelCombo({ + preset, + className, + iconClassName, + labelClassName, +}: { + preset?: MachinePresetName | null; + className?: string; + iconClassName?: string; + labelClassName?: string; +}) { + return ( + + + + + ); +} + +export function MachineLabel({ + preset, + className, +}: { + preset?: MachinePresetName | null; + className?: string; +}) { + return ( + {formatMachinePresetName(preset)} + ); +} + +export function formatMachinePresetName(preset?: MachinePresetName | null): string { + if (!preset) { + return "No machine yet"; + } + + switch (preset) { + case "micro": + return "Micro"; + case "small-1x": + return "Small 1x"; + case "small-2x": + return "Small 2x"; + case "medium-1x": + return "Medium 1x"; + case "medium-2x": + return "Medium 2x"; + case "large-1x": + return "Large 1x"; + case "large-2x": + return "Large 2x"; + default: + // Fallback for any unknown presets - capitalize first letter and replace hyphens with spaces + return (preset as string) + .split("-") + .map((word: string) => word.charAt(0).toUpperCase() + word.slice(1)) + .join(" "); + } +} From 7dafc2aedb54ec9cbaec146499996dbd4d982837 Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Wed, 16 Jul 2025 17:17:36 +0100 Subject: [PATCH 04/13] =?UTF-8?q?Adds=20new=20=E2=80=9CMachine=E2=80=9D=20?= =?UTF-8?q?column=20to=20the=20runs=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/components/runs/v3/TaskRunsTable.tsx | 70 ++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx b/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx index f555f26cb4..32939b5154 100644 --- a/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx +++ b/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx @@ -8,7 +8,11 @@ import { } from "@heroicons/react/20/solid"; import { BeakerIcon, BookOpenIcon, CheckIcon } from "@heroicons/react/24/solid"; import { useLocation } from "@remix-run/react"; -import { formatDuration, formatDurationMilliseconds } from "@trigger.dev/core/v3"; +import { + formatDuration, + formatDurationMilliseconds, + MachinePresetName, +} from "@trigger.dev/core/v3"; import { useCallback, useRef } from "react"; import { Badge } from "~/components/primitives/Badge"; import { Button, LinkButton } from "~/components/primitives/Buttons"; @@ -52,6 +56,8 @@ import { filterableTaskRunStatuses, TaskRunStatusCombo, } from "./TaskRunStatus"; +import { MachineIcon } from "~/assets/icons/MachineIcon"; +import { MachineLabelCombo } from "~/components/MachineLabelCombo"; type RunsTableProps = { total: number; @@ -201,6 +207,65 @@ export function TaskRunsTable({ Compute )} + +
+
+ + No machine yet +
+ + The machine is set at the moment the run is dequeued. + +
+
+
+ + Micro +
+ + The smallest and cheapest machine available. + +
+
+
+ Small 1x & 2x +
+ + Smaller machines for basic workloads. Small 1x is the default machine. + +
+
+
+ Medium 1x & 2x +
+ + Medium machines for more demanding workloads. + +
+
+
+ Large 1x & 2x +
+ + Larger machines for the most demanding workloads such as video processing. The + larger the machine, the more expensive it is. + +
+ + Read docs + + + } + > + Machine +
Test Created at )} + + + {run.isTest ? : "–"} From efb20b66d510fe1b6b660b8176bf911d8d0809fa Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Wed, 16 Jul 2025 17:43:45 +0100 Subject: [PATCH 05/13] Make a separate component for the machine tooltip info --- .../app/components/MachineTooltipInfo.tsx | 63 +++++++++++++++++++ .../app/components/runs/v3/TaskRunsTable.tsx | 59 +---------------- 2 files changed, 65 insertions(+), 57 deletions(-) create mode 100644 apps/webapp/app/components/MachineTooltipInfo.tsx diff --git a/apps/webapp/app/components/MachineTooltipInfo.tsx b/apps/webapp/app/components/MachineTooltipInfo.tsx new file mode 100644 index 0000000000..f2e129a6a5 --- /dev/null +++ b/apps/webapp/app/components/MachineTooltipInfo.tsx @@ -0,0 +1,63 @@ +import { BookOpenIcon } from "lucide-react"; +import { MachineIcon } from "~/assets/icons/MachineIcon"; +import { docsPath } from "~/utils/pathBuilder"; +import { LinkButton } from "./primitives/Buttons"; +import { Header3 } from "./primitives/Headers"; +import { Paragraph } from "./primitives/Paragraph"; + +export function MachineTooltipInfo() { + return ( +
+
+
+ + No machine yet +
+ + The machine is set at the moment the run is dequeued. + +
+
+
+ + Micro +
+ + The smallest and cheapest machine available. + +
+
+
+ Small 1x & 2x +
+ + Smaller machines for basic workloads. Small 1x is the default machine. + +
+
+
+ Medium 1x & 2x +
+ + Medium machines for more demanding workloads. + +
+
+
+ Large 1x & 2x +
+ + Larger machines for the most demanding workloads such as video processing. The larger the + machine, the more expensive it is. + +
+ + Read docs + +
+ ); +} diff --git a/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx b/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx index 32939b5154..b2c820379c 100644 --- a/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx +++ b/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx @@ -58,6 +58,7 @@ import { } from "./TaskRunStatus"; import { MachineIcon } from "~/assets/icons/MachineIcon"; import { MachineLabelCombo } from "~/components/MachineLabelCombo"; +import { MachineTooltipInfo } from "~/components/MachineTooltipInfo"; type RunsTableProps = { total: number; @@ -207,63 +208,7 @@ export function TaskRunsTable({ Compute )} - -
-
- - No machine yet -
- - The machine is set at the moment the run is dequeued. - -
-
-
- - Micro -
- - The smallest and cheapest machine available. - -
-
-
- Small 1x & 2x -
- - Smaller machines for basic workloads. Small 1x is the default machine. - -
-
-
- Medium 1x & 2x -
- - Medium machines for more demanding workloads. - -
-
-
- Large 1x & 2x -
- - Larger machines for the most demanding workloads such as video processing. The - larger the machine, the more expensive it is. - -
- - Read docs - - - } - > + }> Machine Test From 3d5f27607eec1b3e9131a15ee988fa12fac56095 Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Wed, 16 Jul 2025 17:44:04 +0100 Subject: [PATCH 06/13] add machinePreset to the span presenter --- apps/webapp/app/presenters/v3/SpanPresenter.server.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/webapp/app/presenters/v3/SpanPresenter.server.ts b/apps/webapp/app/presenters/v3/SpanPresenter.server.ts index 0c16a5cc99..92426f731f 100644 --- a/apps/webapp/app/presenters/v3/SpanPresenter.server.ts +++ b/apps/webapp/app/presenters/v3/SpanPresenter.server.ts @@ -372,6 +372,7 @@ export class SpanPresenter extends BasePresenter { workerQueue: run.workerQueue, spanId: run.spanId, isCached: !!span.originalRun, + machinePreset: run.machinePreset, }; } From ddc87351919543b76a03c8c5b833d9166ff9e5a4 Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Wed, 16 Jul 2025 17:44:31 +0100 Subject: [PATCH 07/13] Show the Machine in the Details tab in the Run inspector --- .../route.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx b/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx index 2c85b0aa56..70113ac8de 100644 --- a/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx +++ b/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx @@ -7,6 +7,7 @@ import { import { type LoaderFunctionArgs } from "@remix-run/server-runtime"; import { formatDurationMilliseconds, + MachinePresetName, type TaskRunError, taskRunErrorEnhancer, } from "@trigger.dev/core/v3"; @@ -18,6 +19,8 @@ import { AdminDebugRun } from "~/components/admin/debugRun"; import { CodeBlock } from "~/components/code/CodeBlock"; import { EnvironmentCombo } from "~/components/environments/EnvironmentLabel"; import { Feedback } from "~/components/Feedback"; +import { MachineLabelCombo } from "~/components/MachineLabelCombo"; +import { MachineTooltipInfo } from "~/components/MachineTooltipInfo"; import { Button, LinkButton } from "~/components/primitives/Buttons"; import { Callout } from "~/components/primitives/Callout"; import { DateTime, DateTimeAccurate } from "~/components/primitives/DateTime"; @@ -36,7 +39,6 @@ import { import { TabButton, TabContainer } from "~/components/primitives/Tabs"; import { TextLink } from "~/components/primitives/TextLink"; import { InfoIconTooltip, SimpleTooltip } from "~/components/primitives/Tooltip"; -import { RuntimeIcon } from "~/components/RuntimeIcon"; import { RunTimeline, RunTimelineEvent, SpanTimeline } from "~/components/run/RunTimeline"; import { PacketDisplay } from "~/components/runs/v3/PacketDisplay"; import { RunIcon } from "~/components/runs/v3/RunIcon"; @@ -46,6 +48,7 @@ import { SpanTitle } from "~/components/runs/v3/SpanTitle"; import { TaskRunAttemptStatusCombo } from "~/components/runs/v3/TaskRunAttemptStatus"; import { TaskRunStatusCombo, TaskRunStatusReason } from "~/components/runs/v3/TaskRunStatus"; import { WaitpointDetailTable } from "~/components/runs/v3/WaitpointDetails"; +import { RuntimeIcon } from "~/components/RuntimeIcon"; import { WarmStartCombo } from "~/components/WarmStarts"; import { useEnvironment } from "~/hooks/useEnvironment"; import { useOrganization } from "~/hooks/useOrganizations"; @@ -615,6 +618,17 @@ function RunBody({ )} + + + + Machine + } /> + + + + + + {run.schedule && ( Schedule From 391cd50bfea1339f8f523a6a4bb4c139eacd6576 Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Wed, 16 Jul 2025 17:51:51 +0100 Subject: [PATCH 08/13] Show an admin only separator --- .../route.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx b/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx index 70113ac8de..542c7a958a 100644 --- a/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx +++ b/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx @@ -738,12 +738,15 @@ function RunBody({ {run.engine} {isAdmin && ( - <> +
+ + Admin only + Worker queue {run.workerQueue} - +
)} From cfe691648511bcf89cb5fc6ff256bb99032326cf Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Wed, 16 Jul 2025 17:52:04 +0100 Subject: [PATCH 09/13] Fix docs icon in the button --- apps/webapp/app/components/MachineTooltipInfo.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/webapp/app/components/MachineTooltipInfo.tsx b/apps/webapp/app/components/MachineTooltipInfo.tsx index f2e129a6a5..60c917e4cf 100644 --- a/apps/webapp/app/components/MachineTooltipInfo.tsx +++ b/apps/webapp/app/components/MachineTooltipInfo.tsx @@ -1,9 +1,9 @@ -import { BookOpenIcon } from "lucide-react"; import { MachineIcon } from "~/assets/icons/MachineIcon"; import { docsPath } from "~/utils/pathBuilder"; import { LinkButton } from "./primitives/Buttons"; import { Header3 } from "./primitives/Headers"; import { Paragraph } from "./primitives/Paragraph"; +import { BookOpenIcon } from "@heroicons/react/20/solid"; export function MachineTooltipInfo() { return ( From 47fa254bba497a6e47887880eb8d05f9255b0345 Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Wed, 16 Jul 2025 17:55:53 +0100 Subject: [PATCH 10/13] Small padding tweak --- apps/webapp/app/components/MachineTooltipInfo.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/webapp/app/components/MachineTooltipInfo.tsx b/apps/webapp/app/components/MachineTooltipInfo.tsx index 60c917e4cf..3b3616288b 100644 --- a/apps/webapp/app/components/MachineTooltipInfo.tsx +++ b/apps/webapp/app/components/MachineTooltipInfo.tsx @@ -7,7 +7,7 @@ import { BookOpenIcon } from "@heroicons/react/20/solid"; export function MachineTooltipInfo() { return ( -
+
From d1ec2ba755e6d0f29537e41c9492625ca5d56bac Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Wed, 16 Jul 2025 18:00:24 +0100 Subject: [PATCH 11/13] Move the Machine nearer the costs --- .../route.tsx | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx b/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx index 542c7a958a..056c44d0b5 100644 --- a/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx +++ b/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx @@ -618,17 +618,7 @@ function RunBody({ )} - - - - Machine - } /> - - - - - - + {run.schedule && ( Schedule @@ -695,6 +685,17 @@ function RunBody({ : "–"} + + + + Machine + } /> + + + + + + Run invocation cost From 7ff3a63736ad4502928fe2c29f5e6ccd2de3d0fe Mon Sep 17 00:00:00 2001 From: Matt Aitken Date: Thu, 17 Jul 2025 14:15:54 +0100 Subject: [PATCH 12/13] Don't cast the machine preset --- apps/webapp/app/components/runs/v3/TaskRunsTable.tsx | 2 +- .../app/presenters/v3/NextRunListPresenter.server.ts | 3 ++- apps/webapp/app/presenters/v3/SpanPresenter.server.ts | 10 +++++----- .../route.tsx | 2 +- apps/webapp/app/routes/resources.runs.$runParam.ts | 6 ++---- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx b/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx index b2c820379c..4a76cd18dd 100644 --- a/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx +++ b/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx @@ -386,7 +386,7 @@ export function TaskRunsTable({ )} - + {run.isTest ? : "–"} diff --git a/apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts b/apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts index 5bda4bc673..9217c5039d 100644 --- a/apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts +++ b/apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts @@ -9,6 +9,7 @@ import { timeFilters } from "~/components/runs/v3/SharedFilters"; import { findDisplayableEnvironment } from "~/models/runtimeEnvironment.server"; import { getAllTaskIdentifiers } from "~/models/task.server"; import { RunsRepository } from "~/services/runsRepository.server"; +import { machinePresetFromRun } from "~/v3/machinePresets.server"; import { ServiceValidationError } from "~/v3/services/baseService.server"; import { isCancellableRunStatus, isFinalRunStatus, isPendingRunStatus } from "~/v3/taskStatus"; @@ -231,7 +232,7 @@ export class NextRunListPresenter { rootTaskRunId: run.rootTaskRunId, metadata: run.metadata, metadataType: run.metadataType, - machinePreset: run.machinePreset, + machinePreset: run.machinePreset ? machinePresetFromRun(run)?.name : undefined, }; }), pagination: { diff --git a/apps/webapp/app/presenters/v3/SpanPresenter.server.ts b/apps/webapp/app/presenters/v3/SpanPresenter.server.ts index 92426f731f..7d3c219bee 100644 --- a/apps/webapp/app/presenters/v3/SpanPresenter.server.ts +++ b/apps/webapp/app/presenters/v3/SpanPresenter.server.ts @@ -8,7 +8,7 @@ import { getMaxDuration } from "@trigger.dev/core/v3/isomorphic"; import { RUNNING_STATUSES } from "~/components/runs/v3/TaskRunStatus"; import { logger } from "~/services/logger.server"; import { eventRepository, rehydrateAttribute } from "~/v3/eventRepository.server"; -import { machinePresetFromName } from "~/v3/machinePresets.server"; +import { machinePresetFromName, machinePresetFromRun } from "~/v3/machinePresets.server"; import { getTaskEventStoreTableForRun, type TaskEventStoreTable } from "~/v3/taskEventStore.server"; import { isFailedRunStatus, isFinalRunStatus } from "~/v3/taskStatus"; import { BasePresenter } from "./basePresenter.server"; @@ -269,6 +269,8 @@ export class SpanPresenter extends BasePresenter { }) : undefined; + const machine = run.machinePreset ? machinePresetFromRun(run) : undefined; + const context = { task: { id: run.taskIdentifier, @@ -307,9 +309,7 @@ export class SpanPresenter extends BasePresenter { slug: run.project.slug, name: run.project.name, }, - machine: run.machinePreset - ? machinePresetFromName(run.machinePreset as MachinePresetName) - : undefined, + machine, }; return { @@ -372,7 +372,7 @@ export class SpanPresenter extends BasePresenter { workerQueue: run.workerQueue, spanId: run.spanId, isCached: !!span.originalRun, - machinePreset: run.machinePreset, + machinePreset: machine?.name, }; } diff --git a/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx b/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx index 056c44d0b5..7158c57b01 100644 --- a/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx +++ b/apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx @@ -693,7 +693,7 @@ function RunBody({ - + diff --git a/apps/webapp/app/routes/resources.runs.$runParam.ts b/apps/webapp/app/routes/resources.runs.$runParam.ts index 7866ee9327..899dbb63f0 100644 --- a/apps/webapp/app/routes/resources.runs.$runParam.ts +++ b/apps/webapp/app/routes/resources.runs.$runParam.ts @@ -5,7 +5,7 @@ import { RUNNING_STATUSES } from "~/components/runs/v3/TaskRunStatus"; import { $replica } from "~/db.server"; import { requireUserId } from "~/services/session.server"; import { v3RunParamsSchema } from "~/utils/pathBuilder"; -import { machinePresetFromName } from "~/v3/machinePresets.server"; +import { machinePresetFromName, machinePresetFromRun } from "~/v3/machinePresets.server"; import { FINAL_ATTEMPT_STATUSES, isFinalRunStatus } from "~/v3/taskStatus"; export type RunInspectorData = UseDataFunctionReturn; @@ -183,9 +183,7 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => { slug: run.project.slug, name: run.project.name, }, - machine: run.machinePreset - ? machinePresetFromName(run.machinePreset as MachinePresetName) - : undefined, + machine: run.machinePreset ? machinePresetFromRun(run) : undefined, }; return typedjson({ From 1f75ca68614b635ad181a33209f3381889a10211 Mon Sep 17 00:00:00 2001 From: Matt Aitken Date: Thu, 17 Jul 2025 14:17:48 +0100 Subject: [PATCH 13/13] Remove typecast, better to have a bad label if we add a new machine and don't update thos --- apps/webapp/app/components/MachineLabelCombo.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/webapp/app/components/MachineLabelCombo.tsx b/apps/webapp/app/components/MachineLabelCombo.tsx index 5f36dbb881..40a37e59a6 100644 --- a/apps/webapp/app/components/MachineLabelCombo.tsx +++ b/apps/webapp/app/components/MachineLabelCombo.tsx @@ -54,10 +54,6 @@ export function formatMachinePresetName(preset?: MachinePresetName | null): stri case "large-2x": return "Large 2x"; default: - // Fallback for any unknown presets - capitalize first letter and replace hyphens with spaces - return (preset as string) - .split("-") - .map((word: string) => word.charAt(0).toUpperCase() + word.slice(1)) - .join(" "); + return preset; } }