{"record":{"id":"ac6c0c9aa3a42b41","repo":"deepseek-ai/deepseek-harness","slug":"old-string-and-new-string-must-differ","errorCode":null,"errorMessage":"old_string and new_string must differ","messagePattern":"old_string and new_string must differ","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/fs/tool-fs/src/edit.ts","lineNumber":50,"sourceCode":"  file_path: string\n  old_string: string\n  new_string: string\n  replace_all?: boolean\n  sandbox_permissions?: string\n  justification?: string\n}\n\n/**\n * Validate value constraints the schema DSL can't express: a non-blank\n * `file_path`, a non-empty `old_string`, and `old_string !== new_string`\n * (an equal pair would be a guaranteed no-op edit).\n * @param args - the schema-validated raw tool arguments.\n * @returns the camelCased input with `replace_all` defaulted to false.\n */\nexport function parseEditArgs(args: { file_path: string; old_string: string; new_string: string; replace_all?: boolean }): EditInput {\n  if (args.file_path.trim().length === 0) throw new Error('file_path must be a non-empty string')\n  if (args.old_string.length === 0) throw new Error('old_string must be a non-empty string')\n  if (args.old_string === args.new_string) throw new Error('old_string and new_string must differ')\n  return {\n    filePath: args.file_path,\n    oldString: args.old_string,\n    newString: args.new_string,\n    replaceAll: args.replace_all ?? false,\n  }\n}\n\n/**\n * Format an edit success (single-match or replace-all) as a Claude-style model-facing message.\n * @param displayPath - the backend-resolved path shown to the model.\n * @param replaceAll - selects the all-occurrences wording over the single-replacement one.\n * @returns the confirmation sentence the model sees as the tool result.\n */\nexport function formatEditOutput(displayPath: string, replaceAll: boolean): string {\n  return replaceAll\n    ? `The file ${displayPath} has been updated. All occurrences were successfully replaced.`\n    : `The file ${displayPath} has been updated successfully.`","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/tool-fs/src/edit.ts#L32-L68","documentation":"Error \"old_string and new_string must differ\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/tool-fs/src/edit.ts:50 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"}