deepseek-ai/deepseek-harness · error · Error

PTY shell did not reach readiness before startup timeout

Error message

PTY shell did not reach readiness before startup timeout

What it means

Error "PTY shell did not reach readiness before startup timeout" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/terminal/terminal-bash/src/index.ts:136

    // which is also the readiness contract of the bash initialize path. The
    // first send also pins UTF-8 output (the shared pwsh-local preamble)
    // before anything runs: the session decode path treats PTY bytes as
    // UTF-8, and an un-pinned console writes its host code page for
    // non-ASCII output. The banner-to-prompt gap can outlast the silence
    // bound, so the wait loops over follow-up sends until the controlled
    // prompt is actually visible (in the viewport or the retained scrollback
    // when it landed between sends), bounded by the send deadline.
    let viewport = ''
    for (;;) {
      const first = viewport.length === 0
      const operation = session.startSend({
        text: first ? ENCODING_PREAMBLE + PWSH_PROMPT_SETUP : '',
        submit: first,
        ...signal !== undefined ? { signal } : {},
      })
      const result = await operation.done
      if (result.waitReason === 'session_exit') throw new Error('PTY shell exited during startup')
      if (result.waitReason === 'timeout') throw new Error('PTY shell did not reach readiness before startup timeout')
      viewport = result.viewport
      const scrollback = session.read({ offset: 0, count: 20 }).text
      if (viewport.includes(CONTROLLED_PROMPT) || scrollback.includes(CONTROLLED_PROMPT)) break
    }
    session.motd = viewport
  }
  if (signal === undefined) {
    await start()
    return
  }
  const aborted = Promise.withResolvers<never>()
  const onAbort = (): void => { aborted.reject(signal.reason) }
  signal.addEventListener('abort', onAbort, { once: true })
  try {
    signal.throwIfAborted()
    await Promise.race([start(), aborted.promise])
  } finally {
    signal.removeEventListener('abort', onAbort)

View on GitHub (pinned to b150a551b8)

Solutions

  1. Increase the startup timeout or fix what slows shell readiness (profile scripts, slow mounts).

When it happens

Trigger: Thrown at packages/terminal/terminal-bash/src/index.ts:136 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/cd7170f72a4bd938. Report an issue: GitHub.