{"record":{"id":"59e828aa67cd63ef","repo":"deepseek-ai/deepseek-harness","slug":"dsh-code-runtime-worker-thread-config-maxwallms-m","errorCode":null,"errorMessage":"dsh-code-runtime-worker-thread: config.maxWallMs must be at most ${MAX_TIMER_DELAY_MS} (Node clamps a longer setTimeout delay to 1ms), got ${String(this.config.maxWallMs)}","messagePattern":"dsh-code-runtime-worker-thread: config\\.maxWallMs must be at most (.+?) \\(Node clamps a longer setTimeout delay to 1ms\\), got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/code-runtime/code-runtime-worker-thread/src/index.ts","lineNumber":268,"sourceCode":"  private readonly live = new Set<LiveRun>()\n  private disposed = false\n\n  constructor(ctx: Context, config: Config) {\n    super(ctx)\n    // Schemastery filled the defaults; the cast records that. Positivity is a\n    // semantic check the schema's plain number type does not carry.\n    this.config = config as ResolvedConfig\n    for (const [key, value] of Object.entries(this.config)) {\n      if (!(Number.isFinite(value) && value > 0)) throw new Error(`dsh-code-runtime-worker-thread: config.${key} must be a positive number, got ${String(value)}`)\n    }\n    if (!Number.isSafeInteger(this.config.maxOutputBytes) || this.config.maxOutputBytes < MIN_OUTPUT_BYTES) {\n      throw new Error(`dsh-code-runtime-worker-thread: config.maxOutputBytes must be a safe integer of at least ${MIN_OUTPUT_BYTES}, got ${String(this.config.maxOutputBytes)}`)\n    }\n    // maxWallMs reaches setTimeout, which clamps any delay above\n    // MAX_TIMER_DELAY_MS to 1 ms; the positivity check above accepts such a\n    // value, so a 25-day ceiling would time the run out immediately.\n    if (this.config.maxWallMs > MAX_TIMER_DELAY_MS) {\n      throw new Error(`dsh-code-runtime-worker-thread: config.maxWallMs must be at most ${MAX_TIMER_DELAY_MS} (Node clamps a longer setTimeout delay to 1ms), got ${String(this.config.maxWallMs)}`)\n    }\n    ctx.effect(() => () => this.teardown(), 'worker code-runtime teardown')\n  }\n\n  /**\n   * Dispose to quiescence: mark the service unusable, fail every in-flight\n   * run as aborted, and AWAIT each worker's exit so no worker outlives the\n   * fiber.\n   */\n  private async teardown(): Promise<void> {\n    this.disposed = true\n    const runs = [...this.live]\n    for (const run of runs) run.settle({ kind: 'abort', message: 'runtime disposed' })\n    await Promise.all(runs.map(run => run.finished))\n  }\n\n  /**\n   * Execute one program in a fresh worker. Program outcomes — including a","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/code-runtime/code-runtime-worker-thread/src/index.ts#L250-L286","documentation":"maxWallMs backs the wall-clock kill timer, which is a setTimeout. Node clamps any delay above 2,147,483,647 ms (about 24.9 days) to 1 ms, so a larger ceiling would kill the run immediately instead of late. The constructor therefore rejects maxWallMs above MAX_TIMER_DELAY_MS at load.","triggerScenarios":"cordis.yml sets maxWallMs above 2147483647 — e.g. 2592000000 for 30 days, or a sentinel like Number.MAX_SAFE_INTEGER.","commonSituations":"Copying an 'effectively unlimited' ceiling from elsewhere; unit confusion (seconds written where milliseconds are expected); genuinely wanting month-long runs, which Node timers cannot express.","solutions":["Cap maxWallMs at 2147483647 or lower (default 600000 = 10 minutes).","If longer effective wall time is needed, restructure into resumable or checkpointed runs instead of one long run.","Re-check the unit math — the value is milliseconds."],"exampleFix":"# before — 30 days exceeds Node's maximum setTimeout delay\nmaxWallMs: 2592000000\n\n# after — at or below 2147483647 ms (~24.9 days); default is 600000\nmaxWallMs: 2147483647","handlingStrategy":"validation","validationCode":"const MAX_TIMER_DELAY_MS = 2_147_483_647\nif (maxWallMs !== undefined && !(maxWallMs > 0 && maxWallMs <= MAX_TIMER_DELAY_MS)) {\n  throw new Error('maxWallMs must be in (0, 2147483647] milliseconds')\n}","typeGuard":"const isValidWallCap = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v) && v > 0 && v <= 2_147_483_647","tryCatchPattern":null,"preventionTips":["Treat 2^31-1 ms as a hard ceiling for any timer-backed config value.","Use the default or modest budgets; wall time is a backstop — computeMs meters actual busy time.","Never feed sentinels like Number.MAX_SAFE_INTEGER into timer delays."],"tags":["config","validation","timeout","settimeout","node-timers"],"backgroundTag":"settimeout-max-delay-exceeded","analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}