{"record":{"id":"bc1fb31dfe1b3453","repo":"deepseek-ai/deepseek-harness","slug":"fs-ambiguous-edit-bc1fb3","errorCode":"FS_AMBIGUOUS_EDIT","errorMessage":"old_string matched ${replacements} times in \"${displayPath}\"; provide a more specific old_string or set replace_all to true","messagePattern":"old_string matched (.+?) times in \"(.+?)\"; provide a more specific old_string or set replace_all to true","errorType":"exception","errorClass":"FsError","httpStatus":null,"severity":"error","filePath":"packages/fs/fs-local/src/fsio.ts","lineNumber":776,"sourceCode":" */\nexport function applyLiteralEdit(\n  content: string,\n  oldString: string,\n  newString: string,\n  replaceAll: boolean,\n  displayPath: string,\n): { content: string; replacements: number } {\n  const oldNorm = normalizeLineEndings(oldString)\n  if (oldNorm.length === 0) {\n    throw new FsError('old_string must be a non-empty string', 'FS_EDIT_NOT_FOUND')\n  }\n  const newNorm = normalizeLineEndings(newString)\n  const replacements = countOccurrences(content, oldNorm)\n  if (replacements === 0) {\n    throw new FsError(`old_string was not found in \"${displayPath}\"`, 'FS_EDIT_NOT_FOUND')\n  }\n  if (!replaceAll && replacements > 1) {\n    throw new FsError(`old_string matched ${replacements} times in \"${displayPath}\"; provide a more specific old_string or set replace_all to true`, 'FS_AMBIGUOUS_EDIT')\n  }\n  return { content: content.split(oldNorm).join(newNorm), replacements }\n}\n\nexport { normalizeLineEndings, restoreLineEndings }\n","sourceCodeStart":758,"sourceCodeEnd":782,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/fs-local/src/fsio.ts#L758-L782","documentation":"Error \"old_string matched ${replacements} times in \"${displayPath}\"; provide a more specific old_string or set replace_all to true\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/fs-local/src/fsio.ts:776 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"}