earendil-works/pi · error · Error

Operation aborted

Error message

Operation aborted

What it means

Error "Operation aborted" thrown in earendil-works/pi.

Source

Thrown at packages/agent/src/harness/tools/edit.ts:106

}

export function createEditTool<TContext extends ExecutionToolContext = ExecutionToolContext>(): AgentHarnessTool<
	TContext,
	typeof editSchema,
	EditToolDetails | undefined
> {
	return {
		name: "edit",
		label: "edit",
		description:
			"Edit a single file using exact text replacement. Every edits[].oldText must match a unique, non-overlapping region of the original file. If two changes affect the same block or nearby lines, merge them into one edit instead of emitting overlapping edits. Do not include large unchanged regions just to connect distant changes.",
		parameters: editSchema,
		prepareArguments: prepareEditArguments,
		async execute(_toolCallId, input, signal, _onUpdate, { env }) {
			const { path, edits } = validateEditInput(input);
			const absolutePath = await resolveToolPath(env, path, signal);
			return withFileMutationQueue(env, absolutePath, async () => {
				if (signal?.aborted) throw new Error("Operation aborted");
				const info = await env.fileInfo(absolutePath, signal);
				if (!info.ok) throw editAccessError(path, info.error);
				if (info.value.kind !== "file" && info.value.kind !== "symlink") {
					throw new Error(`Could not edit file: ${path}. Path is not a file.`);
				}

				const readResult = await env.readTextFile(absolutePath, signal);
				if (!readResult.ok) throw editAccessError(path, readResult.error);
				if (signal?.aborted) throw new Error("Operation aborted");

				const { bom, text: content } = stripBom(readResult.value);
				const originalEnding = detectLineEnding(content);
				const normalizedContent = normalizeToLF(content);
				const { baseContent, newContent } = applyEditsToNormalizedContent(normalizedContent, edits, path);
				if (signal?.aborted) throw new Error("Operation aborted");

				const finalContent = bom + restoreLineEndings(newContent, originalEnding);
				const writeResult = await env.writeFile(absolutePath, finalContent, signal);

View on GitHub (pinned to 4af9d21d3b)

Solutions

  1. Re-run the edit; the abort left the file unchanged.

When it happens

Trigger: Thrown at packages/agent/src/harness/tools/edit.ts:106 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/b3b62d55d7b2c205. Report an issue: GitHub.