From acc6715a88f809cef73c8ee214d40676c0d9ad48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sat, 15 Aug 2026 20:57:24 +0200 Subject: [PATCH] Allow timeoutSeconds: 0 to mean no timeout Previously every script was forced to have a positive timeout capped at 24h, with no way to run something genuinely unbounded. execa only enforces its timeout option when it's greater than 0, so this just relaxes the schema's lower bound from positive to >= 0 and lets that flow through unchanged - no engine logic needed beyond a clarifying comment. The 1800s default and 86400s cap for finite timeouts are unchanged; 0 is an explicit opt-in, not the default. Co-Authored-By: Claude Sonnet 5 --- app/src/lib/config/schema.ts | 3 ++- app/src/lib/runner/engine.ts | 1 + docs/CONFIG_REFERENCE.md | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/lib/config/schema.ts b/app/src/lib/config/schema.ts index 4740508..ab4b7a2 100644 --- a/app/src/lib/config/schema.ts +++ b/app/src/lib/config/schema.ts @@ -174,7 +174,8 @@ const scriptSchema = z args: z.array(z.string()).default([]), cwd: z.string().default("./"), shell: z.boolean().default(false), - timeoutSeconds: z.number().int().positive().max(86400).default(1800), + // 0 means no timeout - execa only enforces the timeout when it's > 0. + timeoutSeconds: z.number().int().min(0).max(86400).default(1800), variables: z.array(variableWithChecks).default([]), }) .superRefine((script, ctx) => { diff --git a/app/src/lib/runner/engine.ts b/app/src/lib/runner/engine.ts index abf636b..bbbe869 100644 --- a/app/src/lib/runner/engine.ts +++ b/app/src/lib/runner/engine.ts @@ -117,6 +117,7 @@ async function executeRun( ...process.env, ...invocation.env, }, + // `timeoutSeconds: 0` means no timeout - execa only enforces this when > 0. timeout: script.timeoutSeconds * 1000, cancelSignal: controller.signal, reject: false, diff --git a/docs/CONFIG_REFERENCE.md b/docs/CONFIG_REFERENCE.md index 89e1211..0b8118e 100644 --- a/docs/CONFIG_REFERENCE.md +++ b/docs/CONFIG_REFERENCE.md @@ -63,7 +63,7 @@ pass `--inline` to those commands to get the raw hash printed for pasting into t | `args` | string[] | `[]` | Fixed leading args, before variable-derived ones | | `cwd` | string | `./` | Resolved relative to the config file's directory | | `shell` | boolean | `false` | Opt-in shell interpretation — see the Security Notes in the README before using this | -| `timeoutSeconds` | number | `1800` | 1–86400 | +| `timeoutSeconds` | number | `1800` | 0–86400. `0` means no timeout - the run is never killed for taking too long | | `variables` | array | `[]` | See below | ## `scripts[].variables[]`