vxcontrol/pentagi · warning

failed to summarize summary: %w

Error message

failed to summarize summary: %w

What it means

Thrown in buildSummary (backend/pkg/tools/flow_manager.go:157) after the whole summary string exceeds summaryLimit (32 KB) and t.summarizer is configured: the tool asks the LLM to compress the truncated summary (max 128 KB) and wraps the summarizer's error. The flow data was collected successfully; only the final LLM compression step failed.

Source

Thrown at backend/pkg/tools/flow_manager.go:157

		fmt.Fprintf(sb, "Active subtask: ID=%-6d | %-8s | %s\n", activeST.ID, activeST.Status, activeST.Title)
		if verbose && activeST.Description != "" {
			description, err := t.getDescriptionText(ctx, activeST.Description)
			if err != nil {
				return "", fmt.Errorf("failed to get active subtask description: %w", err)
			}
			fmt.Fprintf(sb, "  Description: %s\n", description)
		}
	}

	if len(tasks) == 0 {
		fmt.Fprintf(sb, "\nNo tasks yet. Flow is waiting for first input.\n")
	}

	summary := sb.String()
	if t.summarizer != nil && len(summary) > summaryLimit {
		summary, err = t.summarizer(ctx, truncateText(summary, summarizationLimit))
		if err != nil {
			return "", fmt.Errorf("failed to summarize summary: %w", err)
		}
	}

	return summary, nil
}

func (t *flowStatusTool) buildTasksList(ctx context.Context, verbose bool) (string, error) {
	tasks, err := t.db.GetFlowTasks(ctx, t.flowID)
	if err != nil {
		return "", fmt.Errorf("failed to get flow tasks: %w", err)
	}

	if len(tasks) == 0 {
		return "No tasks found for this flow.", nil
	}

	sb := &strings.Builder{}
	fmt.Fprintf(sb, "Tasks for flow %d:\n\n", t.flowID)

View on GitHub (pinned to ea665308ba)

Solutions

  1. Check the wrapped summarizer error and LLM provider status/credentials; retry once the provider recovers.
  2. Request the summary non-verbously or use detail='tasks'/'planned' to get a smaller output under the 32 KB limit.
  3. Reduce flow size (finish/clean subtasks) or lower stored input/result sizes so the summary stays under 32 KB.
  4. Verify summarizer configuration (provider, model, timeout) — or disable the summarizer, which returns the truncated raw summary instead.

Example fix

// before
summary, err = t.summarizer(ctx, truncateText(summary, summarizationLimit))
if err != nil {
	return "", fmt.Errorf("failed to summarize summary: %w", err)
}
// after: fall back to the truncated raw summary
rendered, serr := t.summarizer(ctx, truncateText(summary, summarizationLimit))
if serr != nil {
	log.Warn("summary summarization failed, returning truncated summary", "err", serr)
	return truncateText(summary, summaryLimit), nil
}
summary = rendered
Defensive patterns

Strategy: fallback

Validate before calling

// pre-check: skip summarization if the caller cannot afford it
if summarizerQuotaRemaining(ctx) < 1 || len(flowTasks) > largeFlowThreshold {
	args = smallerDetailArgs // use detail='tasks' or non-verbose summary
}

Try / catch

// Go: accept the truncated raw summary as fallback
out, err := tool.Handle(ctx, "get_flow_status", summaryArgs)
if err != nil && strings.Contains(err.Error(), "failed to summarize summary") {
	out = getTruncatedSummaryDirectly(ctx, flowID) // or retry non-verbose
}

Prevention

When it happens

Trigger: get_flow_status with detail='summary' on a flow with many tasks/subtasks plus verbose inputs/descriptions pushing the summary past 32 KB, combined with a summarizer failure — LLM provider error, timeout, rate limit, cancelled context.

Common situations: Large, long-running flows generating huge summaries; LLM quota exhausted mid-run; summarizer provider misconfigured in Settings; local summarizer model (Ollama) offline; caller context deadline hit during the slow summarization call.

Related errors


AI-assisted analysis of vxcontrol/pentagi@ea665308ba (2026-09-01). Data as JSON: /api/errors/843e4de36aca8af8. Report an issue: GitHub.