vxcontrol/pentagi · warning

failed to get subtask description: %w

Error message

failed to get subtask description: %w

What it means

Thrown in buildSubtasksList (backend/pkg/tools/flow_manager.go:241) when rendering a subtask's Description in verbose mode. Descriptions larger than 2*descriptionLimit (8 KB) are compressed by the LLM summarizer via t.getDescriptionText; this error wraps that summarizer failure. The subtask rows were fetched successfully; only description compression failed while iterating the list.

Source

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

	if len(subtasks) == 0 {
		return "No subtasks found.", nil
	}

	sb := &strings.Builder{}
	if taskID != nil && *taskID > 0 {
		fmt.Fprintf(sb, "Subtasks for task %d:\n\n", *taskID)
	} else {
		fmt.Fprintf(sb, "All subtasks for flow %d:\n\n", t.flowID)
	}
	for _, st := range subtasks {
		fmt.Fprintf(sb, "Subtask ID: %d | Task ID: %d | Status: %s | Title: %s\n",
			st.ID, st.TaskID, st.Status, st.Title)
		if verbose {
			if st.Description != "" {
				description, err := t.getDescriptionText(ctx, st.Description)
				if err != nil {
					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)

View on GitHub (pinned to ea665308ba)

Solutions

  1. Inspect the wrapped summarizer error; restore provider health (key, quota, endpoint) and retry the call.
  2. Use verbose=false so only titles/statuses are printed and the summarizer is never invoked for descriptions.
  3. Patch long subtask descriptions via patch_flow_subtasks to stay under 8 KB.
  4. Fix summarizer configuration or pass nil summarizer to NewFlowStatusTool to fall back to truncateText.

Example fix

// before
description, err := t.getDescriptionText(ctx, st.Description)
if err != nil {
	return "", fmt.Errorf("failed to get subtask description: %w", err)
}
// after: degrade to truncated raw description
rendered, derr := t.getDescriptionText(ctx, st.Description)
if derr != nil {
	rendered = truncateText(st.Description, descriptionLimit) + " (summarization failed)"
}
description = rendered
Defensive patterns

Strategy: fallback

Validate before calling

// check whether any subtask would trigger LLM summarization
if maxSubtaskDescriptionLen(flowID) > 2*descriptionLimit && !summarizerHealthy(ctx) {
	args.Verbose = false // titles/statuses only
}

Try / catch

// Go: degrade to non-verbose subtask listing on summarize failure
out, err := tool.Handle(ctx, "get_flow_status", verboseSubtasksArgs)
if err != nil && strings.Contains(err.Error(), "failed to get subtask description") {
	out, err = tool.Handle(ctx, "get_flow_status", nonVerboseSubtasksArgs)
}

Prevention

When it happens

Trigger: get_flow_status with detail='subtasks' and verbose=true, any subtask having Description > 8 KB, and the summarizer call failing (LLM provider outage, invalid/expired API key, 429 throttling, context cancellation).

Common situations: Developer agent wrote long subtask descriptions exceeding the threshold; summarizer quota exhausted mid-flow; local Ollama summarizer endpoint down; caller's overall LLM request timeout shorter than the summarization latency across many subtasks.

Related errors


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