| 164 | // sets the knob and typos it should find out at boot, not by watching a |
| 165 | // runaway execution use the 5-minute default. |
| 166 | const resolveSandboxTimeoutMs = (): number | undefined => { |
| 167 | const raw = process.env.EXECUTOR_SANDBOX_TIMEOUT_MS; |
| 168 | if (!raw) return undefined; |
| 169 | const parsed = Number(raw); |
| 170 | if (!Number.isFinite(parsed) || parsed <= 0) { |
| 171 | // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: refuse to boot on a malformed operator knob |
| 172 | throw new Error( |
| 173 | `EXECUTOR_SANDBOX_TIMEOUT_MS ${JSON.stringify(raw)} is not a positive number of milliseconds`, |
| 174 | ); |
| 175 | } |
| 176 | return Math.floor(parsed); |
| 177 | }; |
| 178 | |
| 179 | // The org slug doubles as a URL segment (`/<slug>/policies`), so an |
| 180 | // operator-set value must fit the shared grammar and avoid reserved root |