earendil-works/pi · error · Error
No changes made to . The replacements produced identical…
Error message
No changes made to ${path}. The replacements produced identical content. What it means
Multi-edit no-op error at the end of applyEditsToNormalizedContent: after applying the full edits array, the composed newContent equals the original content. The plural 'replacements' variant signals the batch as a whole produced no net change; the file is left unmodified and the caller is warned the edit set may be copying existing text or targeting text that was never there.
Solutions
- The replacements are identical to the originals; change the new text so it differs.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/agent/src/harness/tools/edit-diff.ts:359 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24).
Data as JSON: /api/errors/f7c806f416326420.
Report an issue: GitHub.
Appendix: source
Thrown at packages/agent/src/harness/tools/edit-diff.ts:359
matchedEdits.sort((a, b) => a.matchIndex - b.matchIndex);
for (let i = 1; i < matchedEdits.length; i++) {
const previous = matchedEdits[i - 1];
const current = matchedEdits[i];
if (previous.matchIndex + previous.matchLength > current.matchIndex) {
throw new Error(
`edits[${previous.editIndex}] and edits[${current.editIndex}] overlap in ${path}. Merge them into one edit or target disjoint regions.`,
);
}
}
const baseContent = normalizedContent;
const newContent = usedFuzzyMatch
? applyReplacementsPreservingUnchangedLines(normalizedContent, replacementBaseContent, matchedEdits)
: applyReplacements(replacementBaseContent, matchedEdits);
if (baseContent === newContent) {
throw getNoChangeError(path, normalizedEdits.length);
}
return { baseContent, newContent };
}
/** Generate a standard unified patch. */
export function generateUnifiedPatch(path: string, oldContent: string, newContent: string, contextLines = 4): string {
return Diff.createTwoFilesPatch(path, path, oldContent, newContent, undefined, undefined, {
context: contextLines,
headerOptions: Diff.FILE_HEADERS_ONLY,
});
}
/**
* Generate a display-oriented diff string with line numbers and context.
* Returns both the diff string and the first changed line number (in the new file).
*/
export function generateDiffString(View on GitHub (pinned to 4af9d21d3b)