fix: declare a history entry's args and is_preview in the OpenAPI schema

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Guilhem Lemouel
2026-10-26 13:03:42 -07:00
co-authored by Claude Opus 5.5
parent 58290ac98a
commit e5aea51101
3 changed files with 24 additions and 15 deletions
+6
View File
@@ -31550,6 +31550,12 @@ components:
type: boolean
success:
type: boolean
args:
description: >
the run's args, or "WINDMILL_TOO_BIG" when too large to inline; set in the history
for a run in progress and for the runs of an opened group (`top_run`), null otherwise
is_preview:
type: boolean
started_by:
$ref: "#/components/schemas/RunStartedBy"
trigger_kind:
@@ -1,5 +1,11 @@
<script lang="ts">
import { InputService, type Job, type RunnableType, type RunStartedBy } from '$lib/gen'
import {
InputService,
type Input,
type Job,
type RunnableType,
type RunStartedBy
} from '$lib/gen'
import { createEventDispatcher, onDestroy, untrack } from 'svelte'
import { ChevronDown, ChevronRight, ExternalLink, Loader2 } from 'lucide-svelte'
import { twMerge } from 'tailwind-merge'
@@ -19,8 +25,7 @@
shortId,
shortPath,
startedByIcon,
topRunIcon,
type HistoryEntry
topRunIcon
} from './runHistory'
const operatingWorkspace = useOperatingWorkspace()
@@ -92,7 +97,7 @@
}
/** What a refresh compares to tell that an entry changed, a running run finishing included. */
function summary(entry: HistoryEntry): string {
function summary(entry: Input): string {
const g = entry.group
const top = entry.top_run
return [
@@ -108,7 +113,7 @@
].join()
}
async function withPayload(input: HistoryEntry) {
async function withPayload(input: Input) {
if (isGroupEntry(input)) {
return input
}
@@ -155,7 +160,7 @@
includePreview: true,
startedBy: categorized ? startedBy?.join(',') : undefined,
args: searchArgs ? JSON.stringify(searchArgs) : undefined
})) as HistoryEntry[]
})) as Input[]
const inputsWithPayload = await Promise.all(inputs.map(withPayload))
for (const entry of inputs) {
@@ -171,7 +176,7 @@
infiniteList?.setLoader(loadInputsPageFn)
}
async function loadGroup(entry: HistoryEntry) {
async function loadGroup(entry: Input) {
openGroups[entry.id] = {
loading: true,
runs: openGroups[entry.id]?.runs ?? [],
@@ -185,7 +190,7 @@
startedBy: startedBy?.join(','),
topRun: entry.top_run?.id ?? entry.id,
args: searchArgs ? JSON.stringify(searchArgs) : undefined
})) as HistoryEntry[]
})) as Input[]
if (!openGroups[entry.id]) {
return
}
@@ -212,7 +217,7 @@
}
}
function toggleGroup(entry: HistoryEntry) {
function toggleGroup(entry: Input) {
if (openGroups[entry.id]) {
delete openGroups[entry.id]
} else {
+4 -6
View File
@@ -4,8 +4,6 @@ import BarsStaggered from './icons/BarsStaggered.svelte'
import { triggerDisplayNamesMap, triggerIconMapMono } from './triggers/utils'
import { logFeatureUsage } from '$lib/utils/featureUsage'
export type HistoryEntry = Input & { args?: unknown; is_preview?: boolean }
export const TOP_LEVEL_CATEGORIES: RunStartedBy[] = [
'manual',
'api',
@@ -73,7 +71,7 @@ const HANDLER_LABELS: Record<string, string> = {
/** Icon and tooltip for how a run started. Manual runs and previews have none: the first is
* the common case and the second keeps its "P" badge. */
export function startedByIcon(run: HistoryEntry): { icon: any; title: string } | undefined {
export function startedByIcon(run: Input): { icon: any; title: string } | undefined {
switch (run.started_by) {
case 'api':
return { icon: triggerIconMapMono.webhook, title: 'Started through the API' }
@@ -114,7 +112,7 @@ export function topRunIcon(top: InputTopRun): { icon: any; title: string } | und
}
/** What an inner row shows where a top-level run shows its author. */
export function innerRunLabel(run: HistoryEntry): string {
export function innerRunLabel(run: Input): string {
if (run.retry != undefined) return `Retry ${run.retry}`
switch (run.started_by) {
case 'flow_step':
@@ -145,7 +143,7 @@ export function shortId(id: string): string {
}
/** Text for the runs an entry holds besides itself: "+2 retries", "+1 handler", "+3 runs". */
export function innerRunsLabel(entry: HistoryEntry): string | undefined {
export function innerRunsLabel(entry: Input): string | undefined {
const group = entry.group
if (!group || group.runs === 0) return undefined
const plus = group.complete ? '' : '+'
@@ -166,7 +164,7 @@ export function innerRunsLabel(entry: HistoryEntry): string | undefined {
/** A history entry standing for several runs inside another top-level run, opened rather
* than selected. */
export function isGroupEntry(entry: HistoryEntry): boolean {
export function isGroupEntry(entry: Input): boolean {
return !!entry.group && !!entry.top_run
}