deepseek-ai/deepseek-harness · error · Error

terminal cleanup failed; surviving pid: ${this.pid}

Error message

terminal cleanup failed; surviving pid: ${this.pid}

What it means

Error "terminal cleanup failed; surviving pid: ${this.pid}" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/subprocess/subprocess-local/src/terminal.ts:252

      return
    }
    if (!this.exited) {
      try {
        this.terminal.kill('SIGTERM')
      } catch (_topLevelAlreadyExitedDuringTerm) {
        // The exit callback is authoritative.
      }
      await Promise.race([this.done.then(() => undefined), delay(this.graceMs)])
    }
    if (!this.exited) {
      try {
        this.terminal.kill('SIGKILL')
      } catch (_topLevelAlreadyExitedDuringKill) {
        // The exit callback is authoritative.
      }
      await Promise.race([this.done.then(() => undefined), delay(this.graceMs)])
    }
    if (!this.exited) throw new Error(`terminal cleanup failed; surviving pid: ${this.pid}`)
  }

  private async stopShellWindows(): Promise<void> {
    // node-pty's Windows kill(signal) throws ("Signals not supported on
    // windows"), and its bare kill() delegates to a console-list agent that
    // fails when the parent has no console. taskkill tree escalation is the
    // teardown path, fenced on the shell's start identity like every
    // descendant; a root identity miss falls back to the bare kill. taskkill
    // termination also does not reliably fire node-pty's exit notification
    // (the same console-list agent), so the tiers verify the shell's absence
    // through the inspector instead of waiting on `done` alone.
    const shellGone = (): boolean =>
      this.exited || (this.rootIdentity !== undefined && !this.inspector.isAlive(this.rootIdentity))
    if (!shellGone() && this.rootIdentity !== undefined) {
      this.inspector.signalProcess(this.rootIdentity, 'SIGTERM')
      await this.waitForWindowsShellExit()
    }
    if (!shellGone() && this.rootIdentity === undefined) {

View on GitHub (pinned to b150a551b8)

Solutions

  1. Kill the surviving pid manually and check why the process ignored termination (permissions, uninterruptible state).

When it happens

Trigger: Thrown at packages/subprocess/subprocess-local/src/terminal.ts:252 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/1c3a94121a031421. Report an issue: GitHub.