{"record":{"id":"6351cb434c2d64af","repo":"deepseek-ai/deepseek-harness","slug":"dsh-code-runtime-worker-thread-config-maxoutputby","errorCode":null,"errorMessage":"dsh-code-runtime-worker-thread: config.maxOutputBytes must be a safe integer of at least ${MIN_OUTPUT_BYTES}, got ${String(this.config.maxOutputBytes)}","messagePattern":"dsh-code-runtime-worker-thread: config\\.maxOutputBytes must be a safe integer of at least (.+?), got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/code-runtime/code-runtime-worker-thread/src/index.ts","lineNumber":262,"sourceCode":"  })\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   */\n  private async teardown(): Promise<void> {\n    this.disposed = true\n    const runs = [...this.live]","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/code-runtime/code-runtime-worker-thread/src/index.ts#L244-L280","documentation":"Beyond the generic positivity pass, the constructor requires maxOutputBytes to be a safe integer of at least MIN_OUTPUT_BYTES (4) — the byte cost of an empty logs array plus an empty JSON failure message, i.e. the smallest cap that can still represent a counted payload.","triggerScenarios":"cordis.yml sets maxOutputBytes below 4 (e.g. 1), to a fractional value such as 1024.5, or above Number.MAX_SAFE_INTEGER.","commonSituations":"Tuning output caps aggressively small to mute program output; fractional values from unit arithmetic; 'unlimited' sentinels past 2^53-1.","solutions":["Set maxOutputBytes to a safe integer of at least 4 (default 67108864 = 64 MiB).","Omit the key to take the default.","Check unit arithmetic for fractional results before writing the value."],"exampleFix":"# before\nmaxOutputBytes: 1\n\n# after — smallest representable cap, or omit for the 64 MiB default\nmaxOutputBytes: 4","handlingStrategy":"validation","validationCode":"const valid = maxOutputBytes === undefined\n  || (Number.isSafeInteger(maxOutputBytes) && maxOutputBytes >= 4)\nif (!valid) throw new Error('maxOutputBytes must be a safe integer >= 4')","typeGuard":"const isValidOutputCap = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isSafeInteger(v) && v >= 4","tryCatchPattern":null,"preventionTips":["Keep byte caps as integer literals or integer-valued arithmetic.","Never use a sub-4 cap to mute output — disable the tool instead.","Remember the cap counts serialized logs, completion value, and failure message together."],"tags":["config","validation","output-limits","code-runtime"],"backgroundTag":"config-validation-failed","analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}