fix(coding-agent/core): allowed duplicate delete operations on atom anchor lines

- Adjusted atom mutation conflict validation to skip throwing on repeated delete edits for the same anchor line.
- Added tests confirming duplicate delete edits on one anchor are idempotent and do not trigger conflicts.
- Added coverage ensuring explicit deletes within replace ranges are treated as redundant and ignored.
This commit is contained in:
can1357
2026-05-02 02:42:00 +02:00
parent ac1bacbeab
commit 0698ad3ba3
2 changed files with 21 additions and 0 deletions
@@ -879,6 +879,7 @@ function validateNoConflictingAtomMutations(edits: AtomEdit[]): void {
if (edit.kind !== "set" && edit.kind !== "delete") continue;
const existing = mutatingPerLine.get(edit.anchor.line);
if (existing) {
if (existing === "delete" && edit.kind === "delete") continue;
throw new Error(
`Conflicting ops on anchor line ${edit.anchor.line}: \`${existing}\` and \`${edit.kind}\`. ` +
"At most one mutating op (set/delete) is allowed per anchor.",