vxcontrol/pentagi · warning

failed to get task input: %w

Error message

failed to get task input: %w

What it means

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.

Source

Thrown at backend/pkg/tools/flow_manager.go:182

func (t *flowStatusTool) buildTasksList(ctx context.Context, verbose bool) (string, error) {
	tasks, err := t.db.GetFlowTasks(ctx, t.flowID)
	if err != nil {
		return "", fmt.Errorf("failed to get flow tasks: %w", err)
	}

	if len(tasks) == 0 {
		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)

View on GitHub (pinned to ea665308ba)

Solutions

  1. Inspect the wrapped summarizer error; fix provider credentials/quota/endpoint and retry the tool call.
  2. Use verbose=false to list tasks without input text, avoiding the summarizer entirely.
  3. Keep task inputs under 16 KB so getInputText only truncates locally without calling the LLM.
  4. Repair the summarizer config or pass a nil summarizer to NewFlowStatusTool to fall back to truncateText.

Example fix

// before
input, err := t.getInputText(ctx, task.Input)
if err != nil {
	return "", fmt.Errorf("failed to get task input: %w", err)
}
// after: skip the failing input instead of failing the whole list
input, err := t.getInputText(ctx, task.Input)
if err != nil {
	fmt.Fprintf(sb, "  Input:  <unavailable: %v>\n", err)
	continue
}
fmt.Fprintf(sb, "  Input:  %s\n", input)
Defensive patterns

Strategy: fallback

Validate before calling

// ensure inputs are small enough to avoid the LLM path
if len(task.Input) > 2*inputLimit && !summarizerHealthy(ctx) {
	args.Verbose = false // list tasks without inputs
}

Try / catch

// Go: re-issue non-verbose when a per-task input summarize fails
out, err := tool.Handle(ctx, "get_flow_status", verboseTasksArgs)
if err != nil && strings.Contains(err.Error(), "failed to get task input") {
	out, err = tool.Handle(ctx, "get_flow_status", nonVerboseTasksArgs)
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of vxcontrol/pentagi@ea665308ba (2026-09-01). Data as JSON: /api/errors/286b5a1c84bb3893. Report an issue: GitHub.