{"record":{"id":"7036ea19dd770354","repo":"deepseek-ai/deepseek-harness","slug":"source-filepath-exceeds-the-maxdocumentbyte","errorCode":null,"errorMessage":"source \"${filePath}\" exceeds the ${maxDocumentBytes}-byte limit; reading stopped after ${bytes} bytes","messagePattern":"source \"(.+?)\" exceeds the (.+?)-byte limit; reading stopped after (.+?) bytes","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/lsp/lsp-stdio/src/host.ts","lineNumber":111,"sourceCode":"  }\n  const chunks: string[] = []\n  let bytes = 0\n  try {\n    // XXX(lsp-source-replacement): Revisit stable-handle identity only if a real query observes\n    // replacement between canonical containment and the provider opening this stream.\n    const stream = await fs.streamText(target, signal)\n    for await (const chunk of stream) {\n      throwIfAborted(signal)\n      bytes += Buffer.byteLength(chunk)\n      if (bytes > maxDocumentBytes) break\n      chunks.push(chunk)\n    }\n  } catch (error: unknown) {\n    throwIfAborted(signal)\n    throw new Error(`source \"${filePath}\" could not be read: ${messageOf(error)}`, { cause: error })\n  }\n  if (bytes > maxDocumentBytes) {\n    throw new Error(\n      `source \"${filePath}\" exceeds the ${maxDocumentBytes}-byte limit; reading stopped after ${bytes} bytes`,\n    )\n  }\n  throwIfAborted(signal)\n  return {\n    fileUrl: fs.fileUrl(target),\n    text: chunks.join(''),\n  }\n}\n\nfunction messageOf(error: unknown): string {\n  return error instanceof Error ? error.message : String(error)\n}\n","sourceCodeStart":93,"sourceCodeEnd":125,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/lsp/lsp-stdio/src/host.ts#L93-L125","documentation":"Error \"source \"${filePath}\" exceeds the ${maxDocumentBytes}-byte limit; reading stopped after ${bytes} bytes\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/lsp/lsp-stdio/src/host.ts:111 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Raise maxDocumentBytes, or query a smaller file or a narrower range."],"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"}