{"record":{"id":"8d6ef4571721205c","repo":"can1357/oh-my-pi","slug":"edits-to-path-resulted-in-no-changes-being-made-8d6ef4","errorCode":null,"errorMessage":"Edits to ${path} resulted in no changes being made.","messagePattern":"Edits to (.+?) resulted in no changes being made\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/edit/sloppy.ts","lineNumber":3962,"sourceCode":"\t\t}\n\n\t\tenforcePlanModeWrite(session, path);\n\n\t\tconst rawContent = await readEditFileText(absolutePath, path);\n\t\tconst { bom, text: fileText } = stripBom(rawContent);\n\t\tconst originalEnding = detectLineEnding(fileText);\n\t\tconst normalizedContent = normalizeToLF(fileText);\n\n\t\tconst notes: string[] = [];\n\t\tlet newContent: string;\n\t\ttry {\n\t\t\tnewContent = applySloppy(normalizedContent, normalizeToLF(section.body), { path, notes });\n\t\t} catch (error) {\n\t\t\tif (!(error instanceof Error) || !multiFile) throw error;\n\t\t\tthrow new Error(`[${path}]: ${error.message}\\nNo files were modified — sections apply atomically.`);\n\t\t}\n\t\tif (newContent === normalizedContent) {\n\t\t\tthrow new Error(`Edits to ${path} resulted in no changes being made.`);\n\t\t}\n\t\tprepared.push({ path, absolutePath, rawContent, bom, originalEnding, normalizedContent, newContent, notes });\n\t}\n\n\t// Phase 2 — write every prepared section; only the last write flushes the LSP batch.\n\tconst perFileResults: EditToolPerFileResult[] = [];\n\tconst contentTexts: string[] = [];\n\tlet singleResult: EditResult | undefined;\n\tlet firstChangedLine: number | undefined;\n\tfor (let index = 0; index < prepared.length; index++) {\n\t\tconst entry = prepared[index];\n\t\tconst isLast = index === prepared.length - 1;\n\t\tconst sectionBatch: LspBatchRequest | undefined = batchRequest\n\t\t\t? { id: batchRequest.id, flush: isLast && batchRequest.flush }\n\t\t\t: undefined;\n\t\tconst finalContent = await serializeEditFileText(\n\t\t\tentry.absolutePath,\n\t\t\tentry.path,","sourceCodeStart":3944,"sourceCodeEnd":3980,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/edit/sloppy.ts#L3944-L3980","documentation":"The tool requires each applied section to actually change the file. If applySloppy() returns content identical to the input, it means the section body matched what was already in the file, so the edit is a no-op and is rejected rather than silently succeeding.","triggerScenarios":"Submitting a section whose body is byte-identical (after LF normalization) to the existing section content in the target file — e.g. re-applying an edit that was already made, or echoing the file back unchanged.","commonSituations":"Model retries an edit after a partial success; agent regenerates the same content; user runs the same edit command twice; whitespace-only differences eliminated by LF normalization.","solutions":["Verify whether the edit was already applied and skip it","Modify the section body so it actually differs from current content","Delete the redundant section from the edit batch","Re-read the file to confirm current content before editing"],"exampleFix":"// before: no-op body identical to file\n{ heading: '## API', body: existingApiText }\n// after: include the intended change\n{ heading: '## API', body: existingApiText.replace('oldCall', 'newCall') }","handlingStrategy":"validation","validationCode":"const src = await Bun.file(path).text();\nif (src.includes(newSectionBody)) throw new Error('section body already present; edit is a no-op');","typeGuard":"null","tryCatchPattern":"try { await editSection(path, body) } catch (e) { if (/no changes being made/.test(e.message)) return; /* already applied */ throw e }","preventionTips":["Diff intended body against current content before submitting","Skip sections that were already applied in a prior run","Normalize line endings before comparing","Never echo file content back as an 'edit'"],"tags":["edit-tool","no-op","idempotency"],"backgroundTag":"edit-resulted-in-no-changes","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}