deepseek-ai/deepseek-harness · error · Error

subprocess-e2b: terminal cleanup failed; surviving process g

Error message

subprocess-e2b: terminal cleanup failed; surviving process groups: ${groups.join(', ')}

What it means

Error "subprocess-e2b: terminal cleanup failed; surviving process groups: ${groups.join(', ')}" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/e2b/subprocess-e2b/src/terminal.ts:431

    }
    if (groups.length === 0 && !this.topLevelExited) {
      await Promise.race([this.done.catch(() => undefined), delay(this.graceMs)])
    }
    if (groups.length > 0 || !this.topLevelExited) {
      this.terminationSignal = 'SIGKILL'
      if (!this.topLevelExited) {
        try {
          await this.handle.kill()
        } catch (error: unknown) {
          if (error instanceof SandboxNotFoundError) return
          throw error
        }
      }
      groups = await awaitSessionEmpty(this.sandbox, this.sessionId, this.controlEnvs, this.graceMs, this.pollMs, true)
      if (!this.topLevelExited) await Promise.race([this.done.catch(() => undefined), delay(this.graceMs)])
    }
    if (groups.length > 0) {
      throw new Error(`subprocess-e2b: terminal cleanup failed; surviving process groups: ${groups.join(', ')}`)
    }
    if (!this.topLevelExited) {
      throw new Error(`subprocess-e2b: terminal cleanup failed; surviving pid: ${this.pid}`)
    }
    try {
      await this.handle.disconnect()
    } catch (error: unknown) {
      if (!(error instanceof SandboxNotFoundError)) throw error
    }
    try {
      await this.sandbox.files.remove(this.stateDir)
    } catch (_adapterPrivateStateRemovalFailure) {
      // The terminal is quiescent; owner teardown bounds private residue.
    }
  }
}

/**

View on GitHub (pinned to b150a551b8)

When it happens

Trigger: Thrown at packages/e2b/subprocess-e2b/src/terminal.ts:431 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/c0208bf5ea310048. Report an issue: GitHub.