can1357/oh-my-pi · error · Error

Edits to ${path} resulted in no changes being made.

Error message

Edits to ${path} resulted in no changes being made.

What it means

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.

Source

Thrown at packages/coding-agent/src/edit/sloppy.ts:3962

		}

		enforcePlanModeWrite(session, path);

		const rawContent = await readEditFileText(absolutePath, path);
		const { bom, text: fileText } = stripBom(rawContent);
		const originalEnding = detectLineEnding(fileText);
		const normalizedContent = normalizeToLF(fileText);

		const notes: string[] = [];
		let newContent: string;
		try {
			newContent = applySloppy(normalizedContent, normalizeToLF(section.body), { path, notes });
		} catch (error) {
			if (!(error instanceof Error) || !multiFile) throw error;
			throw new Error(`[${path}]: ${error.message}\nNo files were modified — sections apply atomically.`);
		}
		if (newContent === normalizedContent) {
			throw new Error(`Edits to ${path} resulted in no changes being made.`);
		}
		prepared.push({ path, absolutePath, rawContent, bom, originalEnding, normalizedContent, newContent, notes });
	}

	// Phase 2 — write every prepared section; only the last write flushes the LSP batch.
	const perFileResults: EditToolPerFileResult[] = [];
	const contentTexts: string[] = [];
	let singleResult: EditResult | undefined;
	let firstChangedLine: number | undefined;
	for (let index = 0; index < prepared.length; index++) {
		const entry = prepared[index];
		const isLast = index === prepared.length - 1;
		const sectionBatch: LspBatchRequest | undefined = batchRequest
			? { id: batchRequest.id, flush: isLast && batchRequest.flush }
			: undefined;
		const finalContent = await serializeEditFileText(
			entry.absolutePath,
			entry.path,

View on GitHub (pinned to 9690622007)

Solutions

  1. Verify whether the edit was already applied and skip it
  2. Modify the section body so it actually differs from current content
  3. Delete the redundant section from the edit batch
  4. Re-read the file to confirm current content before editing

Example fix

// before: no-op body identical to file
{ heading: '## API', body: existingApiText }
// after: include the intended change
{ heading: '## API', body: existingApiText.replace('oldCall', 'newCall') }
Defensive patterns

Strategy: validation

Validate before calling

const src = await Bun.file(path).text();
if (src.includes(newSectionBody)) throw new Error('section body already present; edit is a no-op');

Type guard

null

Try / catch

try { await editSection(path, body) } catch (e) { if (/no changes being made/.test(e.message)) return; /* already applied */ throw e }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/8d6ef4571721205c. Report an issue: GitHub.