{"record":{"id":"286b5a1c84bb3893","repo":"vxcontrol/pentagi","slug":"failed-to-get-task-input-w","errorCode":null,"errorMessage":"failed to get task input: %w","messagePattern":"failed to get task input: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"backend/pkg/tools/flow_manager.go","lineNumber":182,"sourceCode":"func (t *flowStatusTool) buildTasksList(ctx context.Context, verbose bool) (string, error) {\n\ttasks, err := t.db.GetFlowTasks(ctx, t.flowID)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to get flow tasks: %w\", err)\n\t}\n\n\tif len(tasks) == 0 {\n\t\treturn \"No tasks found for this flow.\", nil\n\t}\n\n\tsb := &strings.Builder{}\n\tfmt.Fprintf(sb, \"Tasks for flow %d:\\n\\n\", t.flowID)\n\tfor _, task := range tasks {\n\t\tfmt.Fprintf(sb, \"Task ID: %d | Status: %s | Title: %s\\n\", task.ID, task.Status, task.Title)\n\t\tif verbose {\n\t\t\tif task.Input != \"\" {\n\t\t\t\tinput, err := t.getInputText(ctx, task.Input)\n\t\t\t\tif err != nil {\n\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)","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/tools/flow_manager.go#L164-L200","documentation":"Thrown in buildTasksList (backend/pkg/tools/flow_manager.go:182) when rendering each task's Input in verbose mode. The input goes through t.getInputText, which routes inputs larger than 2*inputLimit (16 KB) through the LLM summarizer (t.summarizer); this error wraps that summarizer failure. Unlike error 741, it fires per task while iterating the whole task list.","triggerScenarios":"get_flow_status with detail='tasks' and verbose=true, any task in the flow having Input > 16 KB, and the summarizer call failing (provider outage, invalid API key, 429 rate limit, context deadline exceeded).","commonSituations":"First oversized input in a long flow hits an expired LLM key; summarizer provider throttles under parallel agent traffic; caller (LLM framework) cancels the context mid-summarization; local Ollama summarizer endpoint down.","solutions":["Inspect the wrapped summarizer error; fix provider credentials/quota/endpoint and retry the tool call.","Use verbose=false to list tasks without input text, avoiding the summarizer entirely.","Keep task inputs under 16 KB so getInputText only truncates locally without calling the LLM.","Repair the summarizer config or pass a nil summarizer to NewFlowStatusTool to fall back to truncateText."],"exampleFix":"// before\ninput, err := t.getInputText(ctx, task.Input)\nif err != nil {\n\treturn \"\", fmt.Errorf(\"failed to get task input: %w\", err)\n}\n// after: skip the failing input instead of failing the whole list\ninput, err := t.getInputText(ctx, task.Input)\nif err != nil {\n\tfmt.Fprintf(sb, \"  Input:  <unavailable: %v>\\n\", err)\n\tcontinue\n}\nfmt.Fprintf(sb, \"  Input:  %s\\n\", input)","handlingStrategy":"fallback","validationCode":"// ensure inputs are small enough to avoid the LLM path\nif len(task.Input) > 2*inputLimit && !summarizerHealthy(ctx) {\n\targs.Verbose = false // list tasks without inputs\n}","typeGuard":null,"tryCatchPattern":"// Go: re-issue non-verbose when a per-task input summarize fails\nout, err := tool.Handle(ctx, \"get_flow_status\", verboseTasksArgs)\nif err != nil && strings.Contains(err.Error(), \"failed to get task input\") {\n\tout, err = tool.Handle(ctx, \"get_flow_status\", nonVerboseTasksArgs)\n}","preventionTips":["Bound submit_flow_input sizes so stored task inputs stay under 16 KB.","Keep summarizer provider credentials valid and monitor quota usage.","Wrap verbose tool calls in a context with enough budget for sequential LLM summarizations.","Prefer non-verbose task listing for status checks; use verbose only when needed."],"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-08T15:18:49.778Z"}