{"record":{"id":"276a8865fdd6adbe","repo":"vxcontrol/pentagi","slug":"failed-to-summarize-subtasks-list-w","errorCode":null,"errorMessage":"failed to summarize subtasks list: %w","messagePattern":"failed to summarize subtasks list: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/pkg/tools/flow_manager.go","lineNumber":259,"sourceCode":"\t\t\t\t\treturn \"\", fmt.Errorf(\"failed to get subtask description: %w\", err)\n\t\t\t\t}\n\t\t\t\tfmt.Fprintf(sb, \"  Description: %s\\n\", description)\n\t\t\t}\n\t\t\tif st.Result != \"\" {\n\t\t\t\tresult, err := t.getResultText(ctx, st.Result)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \"\", fmt.Errorf(\"failed to get subtask result: %w\", err)\n\t\t\t\t}\n\t\t\t\tfmt.Fprintf(sb, \"  Result: %s\\n\", result)\n\t\t\t}\n\t\t}\n\t}\n\n\tsubtasksList := sb.String()\n\tif t.summarizer != nil && len(subtasksList) > subtasksListLimit {\n\t\tsubtasksList, err = t.summarizer(ctx, truncateText(subtasksList, summarizationLimit))\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"failed to summarize subtasks list: %w\", err)\n\t\t}\n\t}\n\n\treturn subtasksList, nil\n}\n\nfunc (t *flowStatusTool) buildRunningInfo(ctx context.Context, verbose bool) (string, error) {\n\tsubtasks, err := t.db.GetFlowSubtasks(ctx, t.flowID)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to get subtasks: %w\", err)\n\t}\n\n\tfor _, st := range subtasks {\n\t\tif st.Status != database.SubtaskStatusRunning && st.Status != database.SubtaskStatusWaiting {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Load the parent task to give the full Task→Subtask chain.","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/tools/flow_manager.go#L241-L277","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the wrapped cause (%w) and fix the underlying LLM provider issue (credentials, quota, connectivity).","Retry the tool call — summarizer errors are frequently transient rate limits.","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.","Tune the subtasksListLimit / summarizationLimit constants, or nil out the summarizer to fall back to plain truncated output."],"exampleFix":"// before\nsubtasksList, err := t.summarizer(ctx, truncateText(subtasksList, summarizationLimit))\nif err != nil {\n    return \"\", fmt.Errorf(\"failed to summarize subtasks list: %w\", err)\n}\n// after\nsummarized, serr := t.summarizer(ctx, truncateText(subtasksList, summarizationLimit))\nif serr != nil {\n    log.Warn(\"summarizer failed, using truncated list\", \"err\", serr)\n    return truncateText(subtasksList, subtasksListLimit), nil // graceful degradation\n}\nsubtasksList = summarized","handlingStrategy":"fallback","validationCode":"// Go: estimate list size before summarizing and preflight the summarizer\nfunc shouldSummarize(list string, limit int, s func(context.Context, string) (string, error)) bool {\n    return s != nil && len(list) > limit\n}\n// also verify provider health once at startup with a tiny summarizer round-trip","typeGuard":"func summarizerAvailable(t *flowStatusTool) bool { return t != nil && t.summarizer != nil }","tryCatchPattern":"list, err := buildSubtasksList(ctx, taskID, verbose)\nif err != nil && strings.Contains(err.Error(), \"failed to summarize subtasks list\") {\n    log.Warn(\"summarizer down; falling back to truncated raw list\", \"err\", err)\n    list, err = buildSubtasksListTruncated(ctx, taskID) // skip summarization\n}","preventionTips":["Monitor summarizer provider health (auth, quota, latency) with periodic probes.","Tune subtasksListLimit/summarizationLimit so typical flows don't force summarization on every call.","Implement graceful degradation: truncated raw output instead of hard failure.","Filter subtasks by taskID or run non-verbose to keep rendered lists small."],"tags":["go","llm","summarization","flow-status"],"backgroundTag":"llm-summarizer-call-failed","analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}