{"record":{"id":"a3976f6903920237","repo":"vxcontrol/pentagi","slug":"failed-to-get-subtask-description-w","errorCode":null,"errorMessage":"failed to get subtask description: %w","messagePattern":"failed to get subtask description: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"backend/pkg/tools/flow_manager.go","lineNumber":241,"sourceCode":"\n\tif len(subtasks) == 0 {\n\t\treturn \"No subtasks found.\", nil\n\t}\n\n\tsb := &strings.Builder{}\n\tif taskID != nil && *taskID > 0 {\n\t\tfmt.Fprintf(sb, \"Subtasks for task %d:\\n\\n\", *taskID)\n\t} else {\n\t\tfmt.Fprintf(sb, \"All subtasks for flow %d:\\n\\n\", t.flowID)\n\t}\n\tfor _, st := range subtasks {\n\t\tfmt.Fprintf(sb, \"Subtask ID: %d | Task ID: %d | Status: %s | Title: %s\\n\",\n\t\t\tst.ID, st.TaskID, st.Status, st.Title)\n\t\tif verbose {\n\t\t\tif st.Description != \"\" {\n\t\t\t\tdescription, err := t.getDescriptionText(ctx, st.Description)\n\t\t\t\tif err != nil {\n\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)","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/tools/flow_manager.go#L223-L259","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Inspect the wrapped summarizer error; restore provider health (key, quota, endpoint) and retry the call.","Use verbose=false so only titles/statuses are printed and the summarizer is never invoked for descriptions.","Patch long subtask descriptions via patch_flow_subtasks to stay under 8 KB.","Fix summarizer configuration or pass nil summarizer to NewFlowStatusTool to fall back to truncateText."],"exampleFix":"// before\ndescription, err := t.getDescriptionText(ctx, st.Description)\nif err != nil {\n\treturn \"\", fmt.Errorf(\"failed to get subtask description: %w\", err)\n}\n// after: degrade to truncated raw description\nrendered, derr := t.getDescriptionText(ctx, st.Description)\nif derr != nil {\n\trendered = truncateText(st.Description, descriptionLimit) + \" (summarization failed)\"\n}\ndescription = rendered","handlingStrategy":"fallback","validationCode":"// check whether any subtask would trigger LLM summarization\nif maxSubtaskDescriptionLen(flowID) > 2*descriptionLimit && !summarizerHealthy(ctx) {\n\targs.Verbose = false // titles/statuses only\n}","typeGuard":null,"tryCatchPattern":"// Go: degrade to non-verbose subtask listing on summarize failure\nout, err := tool.Handle(ctx, \"get_flow_status\", verboseSubtasksArgs)\nif err != nil && strings.Contains(err.Error(), \"failed to get subtask description\") {\n\tout, err = tool.Handle(ctx, \"get_flow_status\", nonVerboseSubtasksArgs)\n}","preventionTips":["Keep subtask descriptions under 8 KB when creating/patching plans.","Monitor summarizer provider health and quota; retry on transient 5xx/429.","Allow enough context deadline for per-subtask summarization across the list.","Fall back to nil summarizer (local truncation) if LLM summarization is not essential."],"tags":["llm","summarization","tool","flow-status"],"backgroundTag":"llm-summarization-failed","analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}