{"record":{"id":"aa42f00066bac824","repo":"vxcontrol/pentagi","slug":"failed-to-summarize-task-list-w","errorCode":null,"errorMessage":"failed to summarize task list: %w","messagePattern":"failed to summarize task list: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"backend/pkg/tools/flow_manager.go","lineNumber":200,"sourceCode":"\t\t\t\t\treturn \"\", fmt.Errorf(\"failed to get task input: %w\", err)\n\t\t\t\t}\n\t\t\t\tfmt.Fprintf(sb, \"  Input:  %s\\n\", input)\n\t\t\t}\n\t\t\tif task.Result != \"\" {\n\t\t\t\tresult, err := t.getResultText(ctx, task.Result)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn \"\", fmt.Errorf(\"failed to get task 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\ttaskList := sb.String()\n\tif t.summarizer != nil && len(taskList) > taskListLimit {\n\t\ttaskList, err = t.summarizer(ctx, truncateText(taskList, summarizationLimit))\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"failed to summarize task list: %w\", err)\n\t\t}\n\t}\n\n\treturn taskList, nil\n}\n\nfunc (t *flowStatusTool) buildSubtasksList(ctx context.Context, taskID *int64, verbose bool) (string, error) {\n\tvar subtasks []database.Subtask\n\tvar err error\n\n\tif taskID != nil && *taskID > 0 {\n\t\tsubtasks, err = t.db.GetFlowTaskSubtasks(ctx, database.GetFlowTaskSubtasksParams{\n\t\t\tFlowID: t.flowID,\n\t\t\tTaskID: *taskID,\n\t\t})\n\t} else {\n\t\tsubtasks, err = t.db.GetFlowSubtasks(ctx, t.flowID)\n\t}","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/tools/flow_manager.go#L182-L218","documentation":"Thrown in buildTasksList (backend/pkg/tools/flow_manager.go:200) when the assembled task-list string exceeds taskListLimit (32 KB) and the configured summarizer fails while compressing it (input pre-truncated to summarizationLimit, 128 KB). The task data was fully rendered; only the final LLM compression of the list failed.","triggerScenarios":"get_flow_status with detail='tasks' on a flow with many tasks (especially verbose=true with inputs/results), producing >32 KB output, combined with a summarizer failure — provider error, timeout, 429, cancelled context.","commonSituations":"Very long-running flows with dozens of tasks; verbose dumps pushing output past 32 KB; summarizer provider quota exhausted after the whole run; local summarizer model offline; caller context deadline exceeded during compression.","solutions":["Check and fix the summarizer provider (credentials, quota, endpoint) per the wrapped error, then retry.","Reduce detail: call with verbose=false or paginate by filtering tasks, keeping output below 32 KB.","Extend the summarizer timeout or use a model with a larger context window for the 128 KB input.","Disable the summarizer so the raw (already size-bounded by callers) list is returned truncated."],"exampleFix":"// before\ntaskList, err = t.summarizer(ctx, truncateText(taskList, summarizationLimit))\nif err != nil {\n\treturn \"\", fmt.Errorf(\"failed to summarize task list: %w\", err)\n}\n// after: fall back to the non-summarized list\nrendered, serr := t.summarizer(ctx, truncateText(taskList, summarizationLimit))\nif serr != nil {\n\tlog.Warn(\"task list summarization failed\", \"err\", serr)\n\treturn truncateText(taskList, taskListLimit), nil\n}\ntaskList = rendered","handlingStrategy":"fallback","validationCode":"// estimate output size and avoid oversized verbose dumps\nif estimatedTaskListSize(flowID, verbose) > taskListLimit && !summarizerHealthy(ctx) {\n\targs.Verbose = false\n}","typeGuard":null,"tryCatchPattern":"// Go: accept the unsanitized list if compression fails\nout, err := tool.Handle(ctx, \"get_flow_status\", verboseTasksArgs)\nif err != nil && strings.Contains(err.Error(), \"failed to summarize task list\") {\n\tout, err = tool.Handle(ctx, \"get_flow_status\", nonVerboseTasksArgs) // smaller, no LLM\n}","preventionTips":["Avoid verbose=true on very large flows; fetch specific tasks instead.","Choose a summarizer model with sufficient context and latency budget.","Alert on summarizer error rate; disable summarization gracefully when unhealthy.","Archive or prune old tasks to keep task lists below the 32 KB limit."],"tags":["llm","summarization","tool","flow-status","large-payload"],"backgroundTag":"llm-summarization-failed","analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}