{"record":{"id":"9097d7e7ed1d2620","repo":"deepseek-ai/deepseek-harness","slug":"pty-send-aborted-before-write","errorCode":null,"errorMessage":"PTY send aborted before write","messagePattern":"PTY send aborted before write","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/terminal/terminal-bash/src/session.ts","lineNumber":236,"sourceCode":"      signal?.throwIfAborted()\n      throw error\n    } finally {\n      this.initializing = false\n    }\n  }\n\n  startSend(request: TerminalSendRequest): TerminalSendOperation {\n    if (this.closing) throw new Error('PTY session is closing')\n    if (this.statusValue.kind === 'exited') throw new Error('PTY session has exited')\n    if (this.active !== undefined) {\n      const draining = this.activeWrite !== undefined\n        ? ' or draining provider write'\n        : this.interrupting !== undefined\n          ? ' or draining foreground interrupt'\n          : ''\n      throw new TerminalError(`PTY session already has an active send${draining}`, 'SEND_ACTIVE')\n    }\n    if (request.signal?.aborted === true) throw new Error('PTY send aborted before write')\n\n    const operation = new LocalSendOperation(\n      this.config.maxReadBytes,\n      Date.now(),\n      () => { this.interrupt(operation) },\n    )\n    this.active = operation\n    this.resetReadinessEvidence()\n\n    if (request.signal !== undefined) {\n      const onAbort = (): void => { operation.cancel() }\n      request.signal.addEventListener('abort', onAbort, { once: true })\n      this.activeAbort = () => request.signal?.removeEventListener('abort', onAbort)\n    }\n    this.activeDeadlineTimer = setTimeout(() => {\n      if (this.active === operation) {\n        this.settleActive('timeout', this.activeWrite !== undefined || this.interrupting === operation)\n      }","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/terminal/terminal-bash/src/session.ts#L218-L254","documentation":"Error \"PTY send aborted before write\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/terminal/terminal-bash/src/session.ts:236 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not abort before the write, or retry the send after the abort."],"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"}