{"record":{"id":"a1f238f57a8df5a4","repo":"deepseek-ai/deepseek-harness","slug":"terminal-cleanup-failed-surviving-pids-survivo","errorCode":null,"errorMessage":"terminal cleanup failed; surviving pids: ${survivors.map(member => member.pid).join(', ')}","messagePattern":"terminal cleanup failed; surviving pids: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/subprocess/subprocess-local/src/terminal.ts","lineNumber":296,"sourceCode":"    if (!shellGone() && this.rootIdentity !== undefined) {\n      this.inspector.signalProcess(this.rootIdentity, 'SIGKILL')\n      await this.waitForWindowsShellExit()\n    }\n    if (!shellGone()) throw new Error(`terminal cleanup failed; surviving pid: ${this.pid}`)\n  }\n\n  private async waitForWindowsShellExit(): Promise<void> {\n    const until = Date.now() + this.graceMs\n    while (!this.exited && Date.now() < until) {\n      if (this.rootIdentity !== undefined && !this.inspector.isAlive(this.rootIdentity)) return\n      await delay(Math.min(25, Math.max(1, until - Date.now())))\n    }\n  }\n\n  private async closeOnce(): Promise<void> {\n    let survivors = await this.stopDescendants()\n    if (survivors.length > 0) {\n      throw new Error(`terminal cleanup failed; surviving pids: ${survivors.map(member => member.pid).join(', ')}`)\n    }\n    await this.stopShell()\n    survivors = await this.stopDescendants()\n    if (survivors.length > 0) {\n      throw new Error(`terminal cleanup failed; surviving pids: ${survivors.map(member => member.pid).join(', ')}`)\n    }\n    this.settleExitIfGone()\n    this.dataDisposable.dispose()\n    this.exitDisposable.dispose()\n  }\n\n  private settleExitIfGone(): void {\n    // An externally taskkilled Windows shell may never fire node-pty's exit\n    // notification (its console-list agent fails without a parent console),\n    // which would leave `done` — and every consumer awaiting it — unsettled\n    // forever. Teardown has just verified the shell's absence through the\n    // inspector, so a missing exit event is itself the outcome.\n    if (this.platform !== 'win32') return","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/subprocess/subprocess-local/src/terminal.ts#L278-L314","documentation":"Error \"terminal cleanup failed; surviving pids: ${survivors.map(member => member.pid).join(', ')}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/subprocess/subprocess-local/src/terminal.ts:296 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Kill the listed surviving pids manually and check why they ignored termination."],"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"}