fix(frontend): apply script editor timeout to preview/Test runs (#9794)

The custom timeout configured in the script editor settings was only
honored for deployed script runs: it is persisted on the script row and
passed as custom_timeout when running by hash/path. Preview ("Test")
runs derive their timeout solely from the `timeout` query param of
/jobs/run/preview, which the editor never sent, so Test silently fell
back to the instance default.

Forward the editor's timeout setting through ScriptBuilder ->
ScriptEditor -> JobLoader.runPreview as the preview run's timeout query
param. The backend already clamps custom_timeout against the instance
max in resolve_job_timeout, so previews get the same ceiling as deployed
runs.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ruben Fiszel
2026-06-25 17:34:54 +02:00
committed by GitHub
parent 9d61e4e59e
commit 6664ce6dc0
4 changed files with 17 additions and 2 deletions
+5
View File
@@ -11800,6 +11800,11 @@ paths:
in: query
schema:
type: boolean
- name: timeout
description: custom timeout in seconds for this preview run
in: query
schema:
type: integer
- $ref: "#/components/parameters/NewJobId"
requestBody:
+3 -1
View File
@@ -336,12 +336,14 @@
callbacks?: Callbacks,
flowPath?: string,
modules?: Record<string, import('$lib/gen').ScriptModule> | null,
tempScriptRefs?: Record<string, string>
tempScriptRefs?: Record<string, string>,
timeout?: number
): Promise<string> {
return abstractRun(
() =>
JobService.runScriptPreview({
workspace: $workspaceStore!,
timeout,
requestBody: {
path,
content: code,
@@ -2016,6 +2016,7 @@
stablePathForCaptures={initialPath || fakeInitialPath}
bind:code={script.content}
lang={script.language}
timeout={script.timeout}
kind={script.kind}
autoKind={script.auto_kind}
{template}
@@ -158,6 +158,10 @@
// succeeded.
requireValidAssets?: boolean
args: Record<string, any>
// Custom timeout (in seconds) from the script settings. Forwarded to the
// preview run so "Test" honors the same timeout a deployed run would,
// instead of silently falling back to the instance default.
timeout?: number
selectedTab?: 'main' | 'preprocessor' | 'diagram'
hasPreprocessor?: boolean
captureTable?: CaptureTable | undefined
@@ -215,6 +219,7 @@
customUi = undefined,
requireValidAssets = false,
args = $bindable(),
timeout = undefined,
selectedTab = $bindable('main'),
hasPreprocessor = $bindable(false),
captureTable = $bindable(undefined),
@@ -791,7 +796,9 @@
}
},
undefined,
activeModuleTab !== null ? undefined : modules
activeModuleTab !== null ? undefined : modules,
undefined,
timeout
)
if (job) {
onTestJob?.({ jobId: job })