{"record":{"id":"b743a4047d0788d2","repo":"deepseek-ai/deepseek-harness","slug":"invalid-view-range-viewrange-join-i-b743a4","errorCode":null,"errorMessage":"Invalid `view_range`: [${viewRange.join(', ')}]. Its second element `${finalLine}` should be larger or equal than its first `${initialLine}`","messagePattern":"Invalid `view_range`: \\[(.+?)\\]\\. Its second element `(.+?)` should be larger or equal than its first `(.+?)`","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/fs/tool-str-replace-editor/src/index.ts","lineNumber":170,"sourceCode":"      || requestedFinalLine === undefined\n      || !viewRange.every(Number.isInteger)\n    ) {\n      throw new Error('Invalid `view_range`. It should be a list of two integers.')\n    }\n    initialLine = requestedInitialLine\n    finalLine = requestedFinalLine\n    if (initialLine < 1 || initialLine > allLines.length) {\n      throw new Error(\n        `Invalid \\`view_range\\`: [${viewRange.join(', ')}]. Its first element \\`${initialLine}\\` should be within the range of lines of the file: [1, ${allLines.length}]`,\n      )\n    }\n    if (finalLine > allLines.length) {\n      throw new Error(\n        `Invalid \\`view_range\\`: [${viewRange.join(', ')}]. Its second element \\`${finalLine}\\` should be smaller than the number of lines in the file: \\`${allLines.length}\\``,\n      )\n    }\n    if (finalLine !== -1 && finalLine < initialLine) {\n      throw new Error(\n        `Invalid \\`view_range\\`: [${viewRange.join(', ')}]. Its second element \\`${finalLine}\\` should be larger or equal than its first \\`${initialLine}\\``,\n      )\n    }\n    lines = finalLine === -1\n      ? allLines.slice(initialLine - 1)\n      : allLines.slice(initialLine - 1, finalLine)\n    prompt += ` with view_range=[${initialLine}, ${finalLine}]`\n  }\n  const numbered = lines\n    .map((line, index) => `${String(initialLine + index).padStart(6, ' ')}  ${line}`)\n    .join('\\n')\n  return maybeTruncate(`${prompt}:\\n${numbered}\\n`, maxOutputChars)\n}\n\nasync function listDirectory(\n  ctx: Context,\n  target: FsTarget,\n  maxOutputChars: number,","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/tool-str-replace-editor/src/index.ts#L152-L188","documentation":"Error \"Invalid `view_range`: [${viewRange.join(', ')}]. Its second element `${finalLine}` should be larger or equal than its first `${initialLine}`\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/tool-str-replace-editor/src/index.ts:170 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"}