{"record":{"id":"27601c1bc50cb9a9","repo":"deepseek-ai/deepseek-harness","slug":"deepseek-harness-runtime-client-is-closed","errorCode":null,"errorMessage":"DeepSeek Harness runtime client is closed","messagePattern":"DeepSeek Harness runtime client is closed","errorType":"exception","errorClass":"TransportClosedError","httpStatus":null,"severity":"error","filePath":"packages/sdk/client/src/client.ts","lineNumber":204,"sourceCode":"  private transport: JsonRpcLineTransport | undefined\n  private readonly stderrTail: string[] = []\n  private readonly subscriptions = new Map<string, NotificationSubscriptionImpl>()\n  private readonly sessionParents = new Map<string, string>()\n  private subscriptionSerial = 0\n  private exitCode: number | null | undefined\n  private spawnError: Error | undefined\n  private streamsSettled: Promise<void> = Promise.resolve()\n  private closeTask: Promise<void> | undefined\n\n  /** @param options - launch spec, complete child environment, and timeouts. */\n  constructor(readonly options: HarnessClientOptions) {}\n\n  /**\n   * Spawn the runtime subprocess and start reading frames. Idempotent while\n   * the process is live; rejects reuse after {@link close}.\n   */\n  start(): void {\n    if (this.closeTask !== undefined) throw new TransportClosedError('DeepSeek Harness runtime client is closed')\n    if (this.child !== undefined) return\n    const child = spawn(this.options.command, this.options.args ?? [], {\n      cwd: this.options.cwd,\n      env: this.options.env ?? process.env,\n      stdio: ['pipe', 'pipe', 'pipe'],\n    })\n    this.child = child\n    child.once('error', (error) => {\n      this.spawnError = error\n      // A spawn failure destroys the pipes without an input 'end' edge, so the\n      // transport's pending requests must be failed here.\n      this.transport?.close()\n      this.failSubscriptions(this.closedError('DeepSeek Harness runtime failed to start'))\n    })\n    // Writes racing the runtime's death EPIPE on stdin; the exit edge below is\n    // the real signal, so the stream-level error only needs to be non-fatal.\n    // The timing of that race is not deterministically reproducible.\n    /* v8 ignore next */","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/sdk/client/src/client.ts#L186-L222","documentation":"Error \"DeepSeek Harness runtime client is closed\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/sdk/client/src/client.ts:204 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create a new client instance; a closed client 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"}