{"record":{"id":"1f89d89b7b16b82e","repo":"deepseek-ai/deepseek-harness","slug":"fs-not-found-1f89d8","errorCode":"FS_NOT_FOUND","errorMessage":"offset ${request.offset} is out of range for \"${displayPath}\" (${acc.totalLines} lines)","messagePattern":"offset (.+?) is out of range for \"(.+?)\" \\((.+?) lines\\)","errorType":"exception","errorClass":"FsError","httpStatus":null,"severity":"error","filePath":"packages/fs/tool-fs/src/read-render.ts","lineNumber":97,"sourceCode":"  if (acc.truncatedByBytes || acc.totalLines < request.offset || acc.lines.length >= request.limit) return\n\n  const text = truncateLine(rawLine, request.maxLineLength)\n  const bytes = lineByteSize(text, acc.lines.length)\n  if (acc.outputBytes + bytes > request.maxBytes) {\n    acc.truncatedByBytes = true\n    return\n  }\n  acc.outputBytes += bytes\n  acc.lines.push({ number: acc.totalLines, text })\n}\n\nfunction stripCarriageReturn(line: string): string {\n  return line.endsWith('\\r') ? line.slice(0, -1) : line\n}\n\nfunction finish(acc: WindowAccumulator, request: ReadWindow, displayPath: string): WindowResult {\n  if (!acc.truncatedByBytes && request.offset > acc.totalLines && !(acc.totalLines === 0 && request.offset === 1)) {\n    throw new FsError(`offset ${request.offset} is out of range for \"${displayPath}\" (${acc.totalLines} lines)`, 'FS_NOT_FOUND')\n  }\n  return { lines: acc.lines, totalLines: acc.totalLines, truncatedByBytes: acc.truncatedByBytes }\n}\n\n/**\n * Build one window from streamed or whole-file chunks, enforcing line and byte caps while still\n * scanning to an exact total line count, and throwing `FS_NOT_FOUND` when the requested offset is\n * past EOF.\n * @param chunks - decoded text chunks in file order; chunk boundaries carry no meaning.\n * @param request - the resolved window; the caller has already applied its defaults and caps.\n * @param displayPath - the caller-facing path used in the offset-out-of-range error.\n * @returns the numbered window lines, the total line count seen, and the byte-cap truncation flag.\n */\nexport async function buildWindow(\n  chunks: AsyncIterable<string> | Iterable<string>,\n  request: ReadWindow,\n  displayPath: string,\n): Promise<WindowResult> {","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/tool-fs/src/read-render.ts#L79-L115","documentation":"Error \"offset ${request.offset} is out of range for \"${displayPath}\" (${acc.totalLines} lines)\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/tool-fs/src/read-render.ts:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"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"}