{"record":{"id":"a1fbbc2659514679","repo":"deepseek-ai/deepseek-harness","slug":"parameter-insert-line-is-required-for-command-i","errorCode":null,"errorMessage":"Parameter `insert_line` is required for command: insert","messagePattern":"Parameter `insert_line` is required for command: insert","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/fs/tool-str-replace-editor/src/index.ts","lineNumber":333,"sourceCode":"      exec.signal,\n      sandboxPolicy,\n    )\n  } catch (error: unknown) {\n    throw policy.mapError(error, sandboxPolicy)\n  }\n  ctx.emit('fs/observed', target, { kind: 'present', version: outcome.version }, exec)\n  return `The file ${target.displayPath} has been edited successfully.`\n}\n\nasync function insertInFile(\n  ctx: Context,\n  policy: MutationPolicy,\n  path: string,\n  insertLine: number | undefined,\n  newStr: string | undefined,\n  exec: ToolRunContext,\n): Promise<string> {\n  if (insertLine === undefined) throw new Error('Parameter `insert_line` is required for command: insert')\n  const value = requiredForCommand(newStr, 'new_str', 'insert')\n  const sandboxPolicy = policy.resolve(exec)\n  const target = await resolveTarget(ctx, path, exec.signal)\n  const intent = await ctx.waterfall('fs/edit-intent', target, exec, () => undefined)\n  const info = await statExisting(ctx, target, 'insert', exec)\n  if (info.type !== 'file') {\n    throw new FsError(`cannot insert into \"${target.displayPath}\": not a regular file`, 'FS_NOT_REGULAR_FILE')\n  }\n  const before = await ctx.fs.readText(target, exec.signal)\n  const lines = before.split('\\n')\n  if (!Number.isInteger(insertLine) || insertLine < 0 || insertLine > lines.length) {\n    throw new Error(\n      `Invalid \\`insert_line\\` parameter: ${insertLine}. It should be within the range of lines of the file: [0, ${lines.length}]`,\n    )\n  }\n  const after = [\n    ...lines.slice(0, insertLine),\n    ...value.split('\\n'),","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/tool-str-replace-editor/src/index.ts#L315-L351","documentation":"Error \"Parameter `insert_line` is required for command: insert\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/tool-str-replace-editor/src/index.ts:333 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"}