deepseek-ai/deepseek-harness · error · Error

the workflow worker entry must be loaded inside a worker thr

Error message

the workflow worker entry must be loaded inside a worker thread (no parentPort)

What it means

Error "the workflow worker entry must be loaded inside a worker thread (no parentPort)" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/workflow/workflow-worker-thread/src/session.ts:129

    this.pending.get(callId)?.settled.reject(new Error(rendered))
  }

  /** The host acked the dispose; the call's book-keeping is complete. */
  onChildDisposed(callId: number): void {
    const entry = this.pending.get(callId)
    this.pending.delete(callId)
    entry?.disposed.resolve()
  }
}

/**
 * Narrow the nullable `parentPort` the bootstrap reads from
 * `node:worker_threads`.
 * @param port - `parentPort` as imported (null on the main thread).
 * @returns the port, non-null.
 */
export function requireParentPort(port: MessagePort | null): MessagePort {
  if (port === null) throw new Error('the workflow worker entry must be loaded inside a worker thread (no parentPort)')
  return port
}

/**
 * Run one workflow script to settlement against `port`, posting the terminal result message
 * exactly once; resolves after that post (stray children may still be winding down through the
 * port — the host owns their teardown and ultimately terminates the thread). It never rejects:
 * constructor failure becomes an error result. Host pre-parse makes syntax failure here a likely
 * Node-version skew, but the session still reports it instead of dying silently.
 * @param port - the channel to the host (the real `parentPort`, or one side
 *   of an in-process `MessageChannel` in tests).
 * @param init - the run payload the host provided as `workerData`.
 */
export async function runWorkerSession(port: MessagePort, init: WorkerInit): Promise<void> {
  const post: Post = (type, payload) => {
    port.postMessage({ type, ...payload })
  }
  const children = new ChildRpcBridge(post)

View on GitHub (pinned to b150a551b8)

Solutions

  1. Load the worker entry only through the workflow host's worker-thread spawn; do not import it directly in the main thread.

When it happens

Trigger: Thrown at packages/workflow/workflow-worker-thread/src/session.ts:129 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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