{"record":{"id":"887586acb541eeae","repo":"deepseek-ai/deepseek-harness","slug":"lsp-header-exceeded-max-header-bytes-bytes","errorCode":null,"errorMessage":"LSP header exceeded ${MAX_HEADER_BYTES} bytes","messagePattern":"LSP header exceeded (.+?) bytes","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/lsp/lsp-stdio/src/framing.ts","lineNumber":68,"sourceCode":"    for (;;) {\n      const step = this.next()\n      if (!step.ready) break\n      messages.push(step.message)\n    }\n    return messages\n  }\n\n  /** Parse and consume the next complete message, or report that more bytes are needed. */\n  private next(): { ready: false } | { ready: true; message: unknown } {\n    const separator = this.buffer.indexOf(HEADER_SEPARATOR)\n    if (separator < 0) {\n      if (this.buffer.length > MAX_HEADER_BYTES) {\n        throw new Error(`LSP header exceeded ${MAX_HEADER_BYTES} bytes without a terminator`)\n      }\n      return { ready: false }\n    }\n    if (separator > MAX_HEADER_BYTES) {\n      throw new Error(`LSP header exceeded ${MAX_HEADER_BYTES} bytes`)\n    }\n    const headerText = this.buffer.toString('ascii', 0, separator)\n    const contentLength = parseContentLength(headerText)\n    if (contentLength > this.maxMessageBytes) {\n      throw new Error(`LSP message length ${contentLength} exceeds the ${this.maxMessageBytes}-byte limit`)\n    }\n    const bodyStart = separator + HEADER_SEPARATOR.length\n    const bodyEnd = bodyStart + contentLength\n    if (this.buffer.length < bodyEnd) return { ready: false }\n    const body = this.buffer.toString('utf8', bodyStart, bodyEnd)\n    this.buffer = this.buffer.subarray(bodyEnd)\n    try {\n      return { ready: true, message: JSON.parse(body) }\n    } catch (error) {\n      /* v8 ignore next -- JSON.parse throws a SyntaxError (an Error); the String() fallback is defensive. */\n      throw new Error(`LSP message body was not valid JSON: ${error instanceof Error ? error.message : String(error)}`)\n    }\n  }","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/lsp/lsp-stdio/src/framing.ts#L50-L86","documentation":"Error \"LSP header exceeded ${MAX_HEADER_BYTES} bytes\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/lsp/lsp-stdio/src/framing.ts:68 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the LSP server's header framing; the header block exceeded the byte cap."],"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"}