{"record":{"id":"63a67f05953c6d21","repo":"deepseek-ai/deepseek-harness","slug":"fs-not-regular-file-63a67f","errorCode":"FS_NOT_REGULAR_FILE","errorMessage":"The path ${target.displayPath} is a directory and only the `view` command can be used on directories","messagePattern":"The path (.+?) is a directory and only the `view` command can be used on directories","errorType":"exception","errorClass":"FsError","httpStatus":null,"severity":"error","filePath":"packages/fs/tool-str-replace-editor/src/index.ts","lineNumber":115,"sourceCode":"  return ctx.fs.resolve(path, { signal })\n}\n\nasync function statExisting(\n  ctx: Context,\n  target: FsTarget,\n  command: 'view' | 'str_replace' | 'insert',\n  exec: ToolRunContext,\n): Promise<FsInfo> {\n  const info = await ctx.fs.stat(target, exec.signal)\n  if (info === undefined) {\n    ctx.emit('fs/observed', target, { kind: 'absent' }, exec)\n    throw new FsError(\n      `The path ${target.displayPath} does not exist. Please provide a valid path.`,\n      'FS_NOT_FOUND',\n    )\n  }\n  if (info.type === 'directory' && command !== 'view') {\n    throw new FsError(\n      `The path ${target.displayPath} is a directory and only the \\`view\\` command can be used on directories`,\n      'FS_NOT_REGULAR_FILE',\n    )\n  }\n  return info\n}\n\nfunction requiredForCommand(\n  value: string | undefined,\n  parameter: string,\n  command: string,\n  allowEmpty = true,\n): string {\n  if (value === undefined) throw new Error(`Parameter \\`${parameter}\\` is required for command: ${command}`)\n  if (!allowEmpty && value.length === 0) {\n    throw new Error(`Parameter \\`${parameter}\\` is empty for command: ${command}`)\n  }\n  return value","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/tool-str-replace-editor/src/index.ts#L97-L133","documentation":"Error \"The path ${target.displayPath} is a directory and only the `view` command can be used on directories\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/tool-str-replace-editor/src/index.ts:115 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"}