vxcontrol/pentagi · warning

failed to get active task input: %w

Error message

failed to get active task input: %w

What it means

Thrown in buildSummary (backend/pkg/tools/flow_manager.go:133) when rendering the active task's Input field in verbose mode. task.Input is either a literal string or an oversized text that must pass through t.getInputText, which may invoke the LLM summarizer (t.summarizer) for inputs larger than 2*inputLimit (16 KB); the error is the summarizer failure wrapped for context.

Source

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

		if st.Status == database.SubtaskStatusRunning || st.Status == database.SubtaskStatusWaiting {
			activeST = &subtasks[i]
		}
	}

	sb := &strings.Builder{}
	fmt.Fprintf(sb, "Flow ID: %d\n", t.flowID)
	fmt.Fprintf(sb, "Flow status: %s\n", inferFlowStatus(tasks))
	fmt.Fprintf(sb, "Tasks    — total: %d, running: %d, waiting: %d, finished: %d, failed: %d, planned: %d\n",
		len(tasks), taskCounts["running"], taskCounts["waiting"], taskCounts["finished"], taskCounts["failed"], taskCounts["created"])
	fmt.Fprintf(sb, "Subtasks — total: %d, running: %d, waiting: %d, finished: %d, failed: %d, planned: %d\n",
		len(subtasks), stCounts["running"], stCounts["waiting"], stCounts["finished"], stCounts["failed"], stCounts["created"])

	if activeTask != nil {
		fmt.Fprintf(sb, "\nActive task:    ID=%-6d | %-8s | %s\n", activeTask.ID, activeTask.Status, activeTask.Title)
		if verbose && activeTask.Input != "" {
			input, err := t.getInputText(ctx, activeTask.Input)
			if err != nil {
				return "", fmt.Errorf("failed to get active task input: %w", err)
			}
			fmt.Fprintf(sb, "  Input: %s\n", input)
		}
	}
	if activeST != nil {
		fmt.Fprintf(sb, "Active subtask: ID=%-6d | %-8s | %s\n", activeST.ID, activeST.Status, activeST.Title)
		if verbose && activeST.Description != "" {
			description, err := t.getDescriptionText(ctx, activeST.Description)
			if err != nil {
				return "", fmt.Errorf("failed to get active subtask description: %w", err)
			}
			fmt.Fprintf(sb, "  Description: %s\n", description)
		}
	}

	if len(tasks) == 0 {
		fmt.Fprintf(sb, "\nNo tasks yet. Flow is waiting for first input.\n")
	}

View on GitHub (pinned to ea665308ba)

Solutions

  1. Read the wrapped cause (%w) — it is a summarizer/LLM failure; check the provider credentials, quota, and endpoint in the settings/.env.
  2. Retry the tool call once the LLM provider is healthy, or use verbose=false which skips the input summarization path entirely.
  3. Reduce task input size (submit_flow_input with shorter input) so len(input) <= 2*inputLimit and the summarizer is never invoked.
  4. Fix or disable the summarizer (nil summarizer falls back to plain truncation via truncateText).

Example fix

// before (fails hard when summarizer errors)
input, err := t.getInputText(ctx, activeTask.Input)
if err != nil {
	return "", fmt.Errorf("failed to get active task input: %w", err)
}
// after: degrade gracefully to truncated text
input, err := t.getInputText(ctx, activeTask.Input)
if err != nil {
	input = truncateText(activeTask.Input, inputLimit) + " (summarization failed)"
}
Defensive patterns

Strategy: fallback

Validate before calling

// check summarizer health before issuing a verbose call
if len(activeTaskInput) > 2*inputLimit && summarizer != nil {
	if err := pingSummarizer(ctx); err != nil {
		verbose = false // skip LLM compression path
	}
}

Try / catch

// Go: treat summarizer failure as non-fatal
out, err := tool.Handle(ctx, "get_flow_status", verboseArgs)
if err != nil && strings.Contains(err.Error(), "failed to get active task input") {
	out, err = tool.Handle(ctx, "get_flow_status", nonVerboseArgs) // fallback
}

Prevention

When it happens

Trigger: get_flow_status with detail='summary' and verbose=true, where the running/waiting task's Input exceeds 16 KB and t.summarizer is non-nil, and the summarizer call fails (LLM provider error, rate limit, context cancelled, provider not configured/misconfigured).

Common situations: LLM API key expired or quota exhausted so the summarize call 401/429s; summarizer configured with a provider whose model rejects the 128 KB truncated input; caller context deadline cancelled mid-summarization; Ollama/local provider endpoint unreachable.

Related errors


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