earendil-works/pi · error · CompactionError

summarization_failed

summarization_failed

Error message

Summarization failed: ${response.errorMessage || "Unknown error"}

What it means

Error "Summarization failed: ${response.errorMessage || "Unknown error"}" thrown in earendil-works/pi.

Source

Thrown at packages/agent/src/harness/compaction/compaction.ts:582

	const completionOptions =
		model.reasoning && thinkingLevel && thinkingLevel !== "off"
			? { maxTokens, signal, reasoning: thinkingLevel }
			: { maxTokens, signal };

	const response = await completeSimpleWithRetries(
		models,
		model,
		{ systemPrompt: SUMMARIZATION_SYSTEM_PROMPT, messages: summarizationMessages },
		completionOptions,
		retry,
		callbacks,
	);
	if (response.stopReason === "aborted") {
		return err(new CompactionError("aborted", response.errorMessage || "Summarization aborted"));
	}
	if (response.stopReason === "error") {
		return err(
			new CompactionError(
				"summarization_failed",
				`Summarization failed: ${response.errorMessage || "Unknown error"}`,
			),
		);
	}

	const textContent = contentText(response.content);

	return ok({ text: textContent, usage: response.usage });
}

/** Prepared inputs for a compaction run. */
export interface CompactionPreparation {
	/** Messages summarized into the history summary. */
	messagesToSummarize: AgentMessage[];
	/** Prefix messages summarized separately when compaction splits a turn. */
	turnPrefixMessages: AgentMessage[];

View on GitHub (pinned to 4af9d21d3b)

Solutions

  1. Summarization failed; check the provider error message and retry.

When it happens

Trigger: Thrown at packages/agent/src/harness/compaction/compaction.ts:582 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/1ad7dff9b9db811e. Report an issue: GitHub.