{"record":{"id":"aa90bd5bf83d1f54","repo":"deepseek-ai/deepseek-harness","slug":"pty-shell-did-not-reach-readiness-before-startup-t-aa90bd","errorCode":null,"errorMessage":"PTY shell did not reach readiness before startup timeout","messagePattern":"PTY shell did not reach readiness before startup timeout","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/terminal/terminal-bash/src/session.ts","lineNumber":215,"sourceCode":"    terminal.output.once('error', this.onTerminalError)\n    this.completion = terminal.done.then(\n      outcome => this.onExit(outcome),\n      (error: unknown) => { this.onTransportFailure(error) },\n    )\n  }\n\n  /**\n   * Capture startup output through the same readiness contract as later sends.\n   * @param signal - optional cancellation while the shell reaches its first prompt.\n   * @returns Resolves after startup readiness; rejects on exit or readiness timeout.\n   */\n  async initialize(signal?: AbortSignal): Promise<void> {\n    this.initializing = true\n    try {\n      const operation = this.startSend({ text: '', submit: false, ...signal !== undefined ? { signal } : {} })\n      const result = await operation.done\n      if (result.waitReason === 'session_exit') throw new Error('PTY shell exited during startup')\n      if (result.waitReason === 'timeout') throw new Error('PTY shell did not reach readiness before startup timeout')\n      this.motd = result.viewport\n    } catch (error: unknown) {\n      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          : ''","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/terminal/terminal-bash/src/session.ts#L197-L233","documentation":"Error \"PTY shell did not reach readiness before startup timeout\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/terminal/terminal-bash/src/session.ts:215 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Increase the startup timeout or remove slow shell startup steps."],"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"}