deepseek-ai/deepseek-harness · error · Error

invalid wait timeout: expected a positive number of millisec

Error message

invalid wait timeout: expected a positive number of milliseconds, got ${JSON.stringify(timeoutMs)}

What it means

Error "invalid wait timeout: expected a positive number of milliseconds, got ${JSON.stringify(timeoutMs)}" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/jobs/jobs-local/src/index.ts:234

    const job = this.expect(id)
    this.assertAccess(job, caller)
    if (isTerminal(job.status)) {
      job.reported = true
      return 'already-finished'
    }
    // Cancel first so a throw leaves both lifecycle and notice state unchanged.
    job.cancel(reason)
    job.status = 'stopping'
    job.reported = true
    this.notifyChanged(job.owner)
    return 'requested'
  }

  async wait(id: JobId, timeoutMs: number, caller?: Agent, signal?: AbortSignal): Promise<JobSnapshot> {
    const job = this.expect(id)
    this.assertAccess(job, caller)
    if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
      throw new Error(`invalid wait timeout: expected a positive number of milliseconds, got ${JSON.stringify(timeoutMs)}`)
    }
    if (!isTerminal(job.status)) {
      if (signal?.aborted) throw new Error('wait aborted')
      // Abort removes the waiter synchronously so same-tick settlement cannot
      // suppress a notice for a wait that will reject.
      job.waiters += 1
      let counted = true
      const uncount = (): void => {
        if (!counted) return
        counted = false
        job.waiters -= 1
      }
      try {
        // The scoped deadline distinguishes a successful wait timeout from
        // caller cancellation and clears its timer on every exit.
        using d = deadline(signal, timeoutMs, TASK_WAIT_TIMEOUT)
        await new Promise<void>((resolve, reject) => {
          const onSettled = (): void => {

View on GitHub (pinned to b150a551b8)

Solutions

  1. Pass a positive number of milliseconds as the wait timeout.

When it happens

Trigger: Thrown at packages/jobs/jobs-local/src/index.ts:234 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/35ef138ee720a08c. Report an issue: GitHub.