{"record":{"id":"845bd0bd265aa7d4","repo":"deepseek-ai/deepseek-harness","slug":"terminal-process-has-exited-845bd0","errorCode":null,"errorMessage":"terminal process has exited","messagePattern":"terminal process has exited","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/subprocess/subprocess-local/src/terminal.ts","lineNumber":79,"sourceCode":"    this.pid = terminal.pid\n    this.rootIdentity = inspector.processTree(this.pid).find(member => member.pid === this.pid)\n    this.done = this.outcome.promise\n    this.dataDisposable = terminal.onData((data) => { this.output.write(Buffer.from(data, 'utf8')) })\n    this.exitDisposable = terminal.onExit(({ exitCode, signal: exitSignal }) => {\n      if (this.exited) return\n      this.exited = true\n      this.output.end()\n      this.outcome.resolve({\n        exitCode: exitSignal === undefined || exitSignal === 0 ? exitCode : null,\n        signal: signalName(exitSignal),\n      })\n    })\n  }\n\n  // node-pty writes synchronously; the seam returns a promise for remote transports.\n  // oxlint-disable-next-line typescript/require-await -- Preserve promise rejection semantics at the async provider contract.\n  async write(data: string): Promise<void> {\n    if (this.exited) throw new Error('terminal process has exited')\n    this.terminal.write(data)\n  }\n\n  // Local inspection is synchronous; the seam returns a promise for remote transports.\n  // oxlint-disable-next-line typescript/require-await -- Preserve promise rejection semantics at the async provider contract.\n  async inspectForeground(): Promise<SubprocessTerminalForeground | undefined> {\n    this.descendants()\n    const processGroupId = this.inspector.foregroundPgid(this.pid)\n    if (processGroupId === undefined) return undefined\n    return {\n      processGroupId,\n      inputWaiting: this.inspector.isStdinWaiting(processGroupId),\n    }\n  }\n\n  async signalForeground(signal: SubprocessTerminalSignal): Promise<number> {\n    const foreground = await this.inspectForeground()\n    if (foreground === undefined) {","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/subprocess/subprocess-local/src/terminal.ts#L61-L97","documentation":"Error \"terminal process has exited\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/subprocess/subprocess-local/src/terminal.ts:79 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open a new terminal session; an exited terminal process cannot be reused."],"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"}