{"record":{"id":"f30fc3f00df006d0","repo":"deepseek-ai/deepseek-harness","slug":"subprocess-e2b-terminal-cleanup-failed-surviving-f30fc3","errorCode":null,"errorMessage":"subprocess-e2b: terminal cleanup failed; surviving pid: ${this.pid}","messagePattern":"subprocess-e2b: terminal cleanup failed; surviving pid: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/e2b/subprocess-e2b/src/terminal.ts","lineNumber":434,"sourceCode":"    }\n    if (groups.length > 0 || !this.topLevelExited) {\n      this.terminationSignal = 'SIGKILL'\n      if (!this.topLevelExited) {\n        try {\n          await this.handle.kill()\n        } catch (error: unknown) {\n          if (error instanceof SandboxNotFoundError) return\n          throw error\n        }\n      }\n      groups = await awaitSessionEmpty(this.sandbox, this.sessionId, this.controlEnvs, this.graceMs, this.pollMs, true)\n      if (!this.topLevelExited) await Promise.race([this.done.catch(() => undefined), delay(this.graceMs)])\n    }\n    if (groups.length > 0) {\n      throw new Error(`subprocess-e2b: terminal cleanup failed; surviving process groups: ${groups.join(', ')}`)\n    }\n    if (!this.topLevelExited) {\n      throw new Error(`subprocess-e2b: terminal cleanup failed; surviving pid: ${this.pid}`)\n    }\n    try {\n      await this.handle.disconnect()\n    } catch (error: unknown) {\n      if (!(error instanceof SandboxNotFoundError)) throw error\n    }\n    try {\n      await this.sandbox.files.remove(this.stateDir)\n    } catch (_adapterPrivateStateRemovalFailure) {\n      // The terminal is quiescent; owner teardown bounds private residue.\n    }\n  }\n}\n\n/**\n * Allocate an E2B PTY, replace its bootstrap shell with the requested argv,\n * and return only after the private runner has published readiness.\n * @param runtime - Shared E2B sandbox owner.","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/e2b/subprocess-e2b/src/terminal.ts#L416-L452","documentation":"Error \"subprocess-e2b: terminal cleanup failed; surviving pid: ${this.pid}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/e2b/subprocess-e2b/src/terminal.ts:434 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}