vxcontrol/pentagi · warning
failed to get task result: %w
Error message
failed to get task result: %w
What it means
Thrown in buildTasksList (backend/pkg/tools/flow_manager.go:189) when rendering each task's Result in verbose mode. Results larger than 2*resultLimit (16 KB) are compressed by the LLM summarizer via t.getResultText; this error wraps that summarizer failure. The task rows are already fetched; only result text compression failed.
Source
Thrown at backend/pkg/tools/flow_manager.go:189
return "No tasks found for this flow.", nil
}
sb := &strings.Builder{}
fmt.Fprintf(sb, "Tasks for flow %d:\n\n", t.flowID)
for _, task := range tasks {
fmt.Fprintf(sb, "Task ID: %d | Status: %s | Title: %s\n", task.ID, task.Status, task.Title)
if verbose {
if task.Input != "" {
input, err := t.getInputText(ctx, task.Input)
if err != nil {
return "", fmt.Errorf("failed to get task input: %w", err)
}
fmt.Fprintf(sb, " Input: %s\n", input)
}
if task.Result != "" {
result, err := t.getResultText(ctx, task.Result)
if err != nil {
return "", fmt.Errorf("failed to get task result: %w", err)
}
fmt.Fprintf(sb, " Result: %s\n", result)
}
}
}
taskList := sb.String()
if t.summarizer != nil && len(taskList) > taskListLimit {
taskList, err = t.summarizer(ctx, truncateText(taskList, summarizationLimit))
if err != nil {
return "", fmt.Errorf("failed to summarize task list: %w", err)
}
}
return taskList, nil
}
func (t *flowStatusTool) buildSubtasksList(ctx context.Context, taskID *int64, verbose bool) (string, error) {View on GitHub (pinned to ea665308ba)
Solutions
- Check the wrapped summarizer error and provider health (key, quota, endpoint); retry after fixing.
- Use verbose=false to skip result rendering, or query individual results via other tools.
- Cap tool output sizes in the Executor so stored results stay below 16 KB and bypass summarization.
- Fix summarizer configuration or disable it (nil) so getResultText falls back to plain truncation.
Example fix
// before
result, err := t.getResultText(ctx, task.Result)
if err != nil {
return "", fmt.Errorf("failed to get task result: %w", err)
}
// after: degrade to truncated raw result
rendered, rerr := t.getResultText(ctx, task.Result)
if rerr != nil {
rendered = truncateText(task.Result, resultLimit) + " (summarization failed)"
}
result = rendered Defensive patterns
Strategy: fallback
Validate before calling
// avoid the summarizer when results are within the local-truncation bound
if len(task.Result) <= 2*resultLimit {
verbose = true // safe, no LLM call
} else if !summarizerHealthy(ctx) {
verbose = false
} Try / catch
// Go: fall back to truncated results on summarize failure
out, err := tool.Handle(ctx, "get_flow_status", verboseTasksArgs)
if err != nil && strings.Contains(err.Error(), "failed to get task result") {
out, err = tool.Handle(ctx, "get_flow_status", nonVerboseTasksArgs)
} Prevention
- Cap executor tool output size so stored results stay under 16 KB.
- Ensure the summarizer model context window fits the 128 KB truncation limit.
- Rotate/validate LLM keys before long-running flows; watch for 429s.
- Disable the summarizer if raw truncated results are acceptable.
When it happens
Trigger: get_flow_status with detail='tasks' and verbose=true, a finished task whose Result exceeds 16 KB, and the summarizer errors (LLM provider failure, rate limit, context cancellation, oversized input for the summarizer model).
Common situations: Executor agent produced very large tool outputs stored as task results; summarizer provider key rotated/expired mid-run; summarizer context window too small for the 128 KB truncated result; caller timeout shorter than summarizer latency.
Related errors
- failed to get active task input: %w
- failed to get active subtask description: %w
- failed to summarize summary: %w
- failed to get task input: %w
- failed to summarize task list: %w
AI-assisted analysis of vxcontrol/pentagi@ea665308ba (2026-09-01).
Data as JSON: /api/errors/920f3f5581dc8a8e.
Report an issue: GitHub.