deepseek-ai/deepseek-harness · error · Error

LSP header exceeded ${MAX_HEADER_BYTES} bytes without a term

Error message

LSP header exceeded ${MAX_HEADER_BYTES} bytes without a terminator

What it means

Error "LSP header exceeded ${MAX_HEADER_BYTES} bytes without a terminator" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/lsp/lsp-stdio/src/framing.ts:63

   * @throws Error when a header is malformed or a body exceeds `maxMessageBytes`.
   */
  push(chunk: Buffer): unknown[] {
    this.buffer = this.buffer.length === 0 ? chunk : Buffer.concat([this.buffer, chunk])
    const messages: unknown[] = []
    for (;;) {
      const step = this.next()
      if (!step.ready) break
      messages.push(step.message)
    }
    return messages
  }

  /** Parse and consume the next complete message, or report that more bytes are needed. */
  private next(): { ready: false } | { ready: true; message: unknown } {
    const separator = this.buffer.indexOf(HEADER_SEPARATOR)
    if (separator < 0) {
      if (this.buffer.length > MAX_HEADER_BYTES) {
        throw new Error(`LSP header exceeded ${MAX_HEADER_BYTES} bytes without a terminator`)
      }
      return { ready: false }
    }
    if (separator > MAX_HEADER_BYTES) {
      throw new Error(`LSP header exceeded ${MAX_HEADER_BYTES} bytes`)
    }
    const headerText = this.buffer.toString('ascii', 0, separator)
    const contentLength = parseContentLength(headerText)
    if (contentLength > this.maxMessageBytes) {
      throw new Error(`LSP message length ${contentLength} exceeds the ${this.maxMessageBytes}-byte limit`)
    }
    const bodyStart = separator + HEADER_SEPARATOR.length
    const bodyEnd = bodyStart + contentLength
    if (this.buffer.length < bodyEnd) return { ready: false }
    const body = this.buffer.toString('utf8', bodyStart, bodyEnd)
    this.buffer = this.buffer.subarray(bodyEnd)
    try {
      return { ready: true, message: JSON.parse(body) }

View on GitHub (pinned to b150a551b8)

Solutions

  1. Fix the LSP server's header framing; the header block exceeded the byte cap without a terminator.

When it happens

Trigger: Thrown at packages/lsp/lsp-stdio/src/framing.ts:63 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/039ea9867ea414f2. Report an issue: GitHub.