A run keeps the inputs its flow declared at submit

Run.declared (migration 2e7ca7d10044) snapshots the declarations on submit
and import. The run detail's Inputs panel reads them, and a run from before
falls back to the flow's current declarations.
This commit is contained in:
2026-10-15 10:20:29 +02:00
parent eca3fa0049
commit caa2cff6b1
10 changed files with 77 additions and 6 deletions
+7 -2
View File
@@ -44,7 +44,7 @@ export function RunDetail({ id }: { id: string }) {
const cancel = useCancelRun()
const retry = useRetryRun()
const names = useMetricNames(id)
const { declared, gone } = useFlowInputs(run?.flow)
const { declared: current, gone } = useFlowInputs(run?.flow)
const [metric, setMetric] = useState("")
if (isPending || !run) return <Skeleton className="h-96 w-full rounded-lg" />
@@ -58,6 +58,11 @@ export function RunDetail({ id }: { id: string }) {
// Said once, where it applies.
const cached = nodes.some((node) => node.status === "cached")
// What the flow declared when this run was submitted. A run from before
// that was kept reads against the flow's current declarations.
const declared = run.declared
? new Map(Object.entries(run.declared))
: current
// Declared order first, so the panel reads the way the flow does; anything
// the run carries that the flow no longer declares still shows, since it is
// what the run was actually given.
@@ -173,7 +178,7 @@ export function RunDetail({ id }: { id: string }) {
<h2 className="font-medium text-sm">Inputs</h2>
{fed.length === 0 ? (
<p className="text-muted-foreground text-sm">
{gone
{gone && !run.declared
? "The run carried no parameters of its own, and its flow is gone, so what it took from the flow cannot be read back."
: "This flow declares no inputs, so there was nothing to choose."}
</p>