vxcontrol/pentagi · error

failed to summarize subtasks list: %w

Error message

failed to summarize subtasks list: %w

What it means

Returned by flowStatusTool.buildSubtasksList when the fully rendered subtasks list exceeds subtasksListLimit and t.summarizer is configured: the whole list (pre-truncated to summarizationLimit) is sent to the summarizer and the summarizer call failed. The error wraps the summarizer's own error; the DB read itself succeeded.

Source

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

					return "", fmt.Errorf("failed to get subtask description: %w", err)
				}
				fmt.Fprintf(sb, "  Description: %s\n", description)
			}
			if st.Result != "" {
				result, err := t.getResultText(ctx, st.Result)
				if err != nil {
					return "", fmt.Errorf("failed to get subtask result: %w", err)
				}
				fmt.Fprintf(sb, "  Result: %s\n", result)
			}
		}
	}

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

	return subtasksList, nil
}

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

	for _, st := range subtasks {
		if st.Status != database.SubtaskStatusRunning && st.Status != database.SubtaskStatusWaiting {
			continue
		}

		// Load the parent task to give the full Task→Subtask chain.

View on GitHub (pinned to ea665308ba)

Solutions

  1. Inspect the wrapped cause (%w) and fix the underlying LLM provider issue (credentials, quota, connectivity).
  2. Retry the tool call — summarizer errors are frequently transient rate limits.
  3. Reduce the size of the source list (use a taskID filter or verbose=false) so the rendered list stays under subtasksListLimit and summarization is skipped.
  4. Tune the subtasksListLimit / summarizationLimit constants, or nil out the summarizer to fall back to plain truncated output.

Example fix

// before
subtasksList, err := t.summarizer(ctx, truncateText(subtasksList, summarizationLimit))
if err != nil {
    return "", fmt.Errorf("failed to summarize subtasks list: %w", err)
}
// after
summarized, serr := t.summarizer(ctx, truncateText(subtasksList, summarizationLimit))
if serr != nil {
    log.Warn("summarizer failed, using truncated list", "err", serr)
    return truncateText(subtasksList, subtasksListLimit), nil // graceful degradation
}
subtasksList = summarized
Defensive patterns

Strategy: fallback

Validate before calling

// Go: estimate list size before summarizing and preflight the summarizer
func shouldSummarize(list string, limit int, s func(context.Context, string) (string, error)) bool {
    return s != nil && len(list) > limit
}
// also verify provider health once at startup with a tiny summarizer round-trip

Type guard

func summarizerAvailable(t *flowStatusTool) bool { return t != nil && t.summarizer != nil }

Try / catch

list, err := buildSubtasksList(ctx, taskID, verbose)
if err != nil && strings.Contains(err.Error(), "failed to summarize subtasks list") {
    log.Warn("summarizer down; falling back to truncated raw list", "err", err)
    list, err = buildSubtasksListTruncated(ctx, taskID) // skip summarization
}

Prevention

When it happens

Trigger: The flow has enough subtasks (with verbose descriptions/results) that the composed string exceeds subtasksListLimit, a summarizer is registered, and the summarizer call fails — LLM provider error, rate limit, auth failure, timeout, or context cancellation.

Common situations: Large flows with dozens/hundreds of subtasks making the list too long; summarizer LLM quota or API key problems; provider outage or slow responses causing context deadline exceeded; overly small subtasksListLimit/summarizationLimit constants causing almost every status call to summarize.

Related errors


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