deepseek-ai/deepseek-harness · error · Error

PTY shell exited during startup

Error message

PTY shell exited during startup

What it means

Error "PTY shell exited during startup" thrown in deepseek-ai/deepseek-harness.

Source

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

    // function through the session and wait for the first marker prompt,
    // 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 {

View on GitHub (pinned to b150a551b8)

Solutions

  1. Check the shell binary and its startup environment; capture the PTY output for the exit reason.

When it happens

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

Common situations: See trigger scenarios.


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