{"record":{"id":"669ba88096feba5f","repo":"deepseek-ai/deepseek-harness","slug":"the-view-range-parameter-is-not-allowed-when-pa","errorCode":null,"errorMessage":"The `view_range` parameter is not allowed when `path` points to a directory.","messagePattern":"The `view_range` parameter is not allowed when `path` points to a directory\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/fs/tool-str-replace-editor/src/index.ts","lineNumber":227,"sourceCode":"    const rightPath = right.slice(right.indexOf('\\t') + 1)\n    return codepointCompare(leftPath, rightPath)\n  })\n  const listing = maybeTruncate(rows.join('\\n') + '\\n', maxOutputChars)\n  return `Here're the files and directories up to 2 levels deep in ${target.displayPath}, excluding hidden items, node_modules, and Python cache directories:\\n${listing}\\n`\n}\n\nasync function viewPath(\n  ctx: Context,\n  path: string,\n  viewRange: number[] | undefined,\n  maxOutputChars: number,\n  exec: ToolRunContext,\n): Promise<string> {\n  const target = await resolveTarget(ctx, path, exec.signal)\n  const info = await statExisting(ctx, target, 'view', exec)\n  if (info.type === 'directory') {\n    if (viewRange !== undefined) {\n      throw new Error('The `view_range` parameter is not allowed when `path` points to a directory.')\n    }\n    return listDirectory(ctx, target, maxOutputChars, exec)\n  }\n  if (info.type !== 'file') {\n    throw new FsError(`cannot view \"${target.displayPath}\": not a regular file or directory`, 'FS_NOT_REGULAR_FILE')\n  }\n  const content = await ctx.fs.readText(target, exec.signal)\n  ctx.emit('fs/observed', target, { kind: 'present', version: info.version }, exec)\n  return formatFileView(target.displayPath, content, maxOutputChars, viewRange)\n}\n\nasync function createFile(\n  ctx: Context,\n  policy: MutationPolicy,\n  path: string,\n  fileText: string | undefined,\n  exec: ToolRunContext,\n): Promise<string> {","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/tool-str-replace-editor/src/index.ts#L209-L245","documentation":"Error \"The `view_range` parameter is not allowed when `path` points to a directory.\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/tool-str-replace-editor/src/index.ts:227 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"}