{"record":{"id":"a7fd940ab5c1e189","repo":"deepseek-ai/deepseek-harness","slug":"fs-edit-not-found-a7fd94","errorCode":"FS_EDIT_NOT_FOUND","errorMessage":"No replacement was performed, old_str `${oldValue}` did not appear verbatim in ${target.displayPath}.","messagePattern":"No replacement was performed, old_str `(.+?)` did not appear verbatim in (.+?)\\.","errorType":"exception","errorClass":"FsError","httpStatus":null,"severity":"error","filePath":"packages/fs/tool-str-replace-editor/src/index.ts","lineNumber":295,"sourceCode":"  path: string,\n  oldStr: string | undefined,\n  newStr: string | undefined,\n  exec: ToolRunContext,\n): Promise<string> {\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 oldValue = requiredForCommand(oldStr, 'old_str', 'str_replace', false)\n  const newValue = newStr ?? ''\n  const info = await statExisting(ctx, target, 'str_replace', exec)\n  if (info.type !== 'file') {\n    throw new FsError(`cannot edit \"${target.displayPath}\": not a regular file`, 'FS_NOT_REGULAR_FILE')\n  }\n  const before = await ctx.fs.readText(target, exec.signal)\n  const offsets = matchOffsets(before, oldValue)\n  const offset = offsets[0]\n  if (offset === undefined) {\n    throw new FsError(\n      `No replacement was performed, old_str \\`${oldValue}\\` did not appear verbatim in ${target.displayPath}.`,\n      'FS_EDIT_NOT_FOUND',\n    )\n  }\n  if (offsets.length > 1) {\n    const lines = lineNumbersAt(before, offsets)\n    throw new FsError(\n      `No replacement was performed. Multiple occurrences of old_str \\`${oldValue}\\` in lines [${lines.join(', ')}]. Please ensure it is unique`,\n      'FS_AMBIGUOUS_EDIT',\n    )\n  }\n  let outcome\n  try {\n    outcome = await ctx.fs.writeText(\n      target,\n      before.slice(0, offset) + newValue + before.slice(offset + oldValue.length),\n      intent === undefined\n        ? { kind: 'replaceIfVersion', version: info.version }","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/tool-str-replace-editor/src/index.ts#L277-L313","documentation":"Error \"No replacement was performed, old_str `${oldValue}` did not appear verbatim in ${target.displayPath}.\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/tool-str-replace-editor/src/index.ts:295 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"}