{"record":{"id":"68227c9de02d05b7","repo":"deepseek-ai/deepseek-harness","slug":"lsp-header-block-missing-content-length-json-st","errorCode":null,"errorMessage":"LSP header block missing Content-Length: ${JSON.stringify(headerText)}","messagePattern":"LSP header block missing Content-Length: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/lsp/lsp-stdio/src/framing.ts","lineNumber":101,"sourceCode":"      /* 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  }\n}\n\n/** Read the `Content-Length` header value (case-insensitive), rejecting a missing or non-numeric one. */\nfunction parseContentLength(headerText: string): number {\n  for (const line of headerText.split('\\r\\n')) {\n    const colon = line.indexOf(':')\n    if (colon < 0) continue\n    if (line.slice(0, colon).trim().toLowerCase() !== 'content-length') continue\n    const value = Number(line.slice(colon + 1).trim())\n    if (!Number.isInteger(value) || value < 0) {\n      throw new Error(`invalid Content-Length header: ${JSON.stringify(line)}`)\n    }\n    return value\n  }\n  throw new Error(`LSP header block missing Content-Length: ${JSON.stringify(headerText)}`)\n}\n","sourceCodeStart":83,"sourceCodeEnd":103,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/lsp/lsp-stdio/src/framing.ts#L83-L103","documentation":"Error \"LSP header block missing Content-Length: ${JSON.stringify(headerText)}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/lsp/lsp-stdio/src/framing.ts:101 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the LSP server to include a Content-Length header in each message."],"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"}