| 181 | // sets the knob and typos it should find out at boot, not by watching a |
| 182 | // runaway execution use the 5-minute default. |
| 183 | const resolveSandboxTimeoutMs = (): number | undefined => { |
| 184 | const raw = process.env.EXECUTOR_SANDBOX_TIMEOUT_MS; |
| 185 | if (!raw) return undefined; |
| 186 | const parsed = Number(raw); |
| 187 | if (!Number.isFinite(parsed) || parsed <= 0) { |
| 188 | // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: refuse to boot on a malformed operator knob |
| 189 | throw new Error( |
| 190 | `EXECUTOR_SANDBOX_TIMEOUT_MS ${JSON.stringify(raw)} is not a positive number of milliseconds`, |
| 191 | ); |
| 192 | } |
| 193 | return Math.floor(parsed); |
| 194 | }; |
| 195 | |
| 196 | // How long an MCP session may sit idle before the store evicts it. 0 disables |
| 197 | // eviction, which restores the old behaviour of holding every session for the |