{"record":{"id":"28d301b0abf9bffe","repo":"deepseek-ai/deepseek-harness","slug":"dsh-code-runtime-worker-thread-config-key-must","errorCode":null,"errorMessage":"dsh-code-runtime-worker-thread: config.${key} must be a positive number, got ${String(value)}","messagePattern":"dsh-code-runtime-worker-thread: config\\.(.+?) must be a positive number, got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/code-runtime/code-runtime-worker-thread/src/index.ts","lineNumber":259,"sourceCode":"    maxWallMs: z.number().default(600_000),\n    maxOutputBytes: z.number().default(67_108_864),\n    maxOldGenerationSizeMb: z.number().default(512),\n  })\n\n  readonly language = 'typescript'\n  readonly isolation = 'worker-thread'\n\n  private readonly config: ResolvedConfig\n  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   */","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/code-runtime/code-runtime-worker-thread/src/index.ts#L241-L277","documentation":"WorkerThreadCodeRuntime's constructor validates every config field (computeMs, maxWallMs, maxOutputBytes, maxOldGenerationSizeMb — schemastery fills defaults first) and rejects any that is not a finite positive number. The schema types these as plain numbers, so positivity is a semantic check only the constructor can make; it fires at plugin load and names the first offending key.","triggerScenarios":"cordis.yml sets any of the four caps to 0, a negative number, Infinity, or NaN — for example computeMs: 0 or maxOldGenerationSizeMb: -1.","commonSituations":"Trying to express 'no limit' with 0 (not supported — omit the key to take the default); templated or computed config producing NaN/Infinity; unit mistakes (seconds vs milliseconds) yielding values that fail the check.","solutions":["Set the named config.<key> to a finite positive number (units: computeMs and maxWallMs in milliseconds, maxOutputBytes in bytes, maxOldGenerationSizeMb in MiB).","To express 'use the default', omit the key instead of writing 0.","If config is generated, print the rendered cordis.yml and look for NaN, Infinity, or empty values."],"exampleFix":"# before — 0 does not mean 'unlimited'; it fails the positivity check\ncomputeMs: 0\n\n# after — omit for the 60000 ms default, or give a positive budget\ncomputeMs: 120000","handlingStrategy":"validation","validationCode":"const caps = { computeMs, maxWallMs, maxOutputBytes, maxOldGenerationSizeMb }\nfor (const [key, value] of Object.entries(caps)) {\n  if (value !== undefined && !(Number.isFinite(value) && value > 0)) {\n    throw new Error(`rejecting cordis.yml before load: ${key}=${String(value)} is not a positive number`)\n  }\n}","typeGuard":"const isPositiveCap = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v) && v > 0","tryCatchPattern":null,"preventionTips":["Treat 0 and negative values as invalid for every runtime cap; omit keys to accept defaults.","Lint generated cordis.yml (render then parse) before boot.","Mind the units: milliseconds, bytes, MiB — a seconds/milliseconds mix-up produces rejects or instant timeouts."],"tags":["config","validation","cordis-yml","worker-thread","code-runtime"],"backgroundTag":"config-validation-failed","analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}