vxcontrol/pentagi · error

builtin function %s not found

Error message

builtin function %s not found

What it means

GetCustomExecutor supports pulling in built-in tools by name via cfg.Builtin; each name must exist in the flow executor's fte.definitions registry. If a requested builtin name is unknown, registration aborts with this error naming the missing builtin function.

Source

Thrown at backend/pkg/tools/tools.go:784

	}

	return nil
}

func (fte *flowToolsExecutor) GetCustomExecutor(cfg CustomExecutorConfig) (ContextToolsExecutor, error) {
	if len(cfg.Definitions) != len(cfg.Handlers) {
		return nil, fmt.Errorf("definitions and handlers must have the same length")
	}

	for _, def := range cfg.Definitions {
		if _, ok := cfg.Handlers[def.Name]; !ok {
			return nil, fmt.Errorf("handler for function %s not found", def.Name)
		}
	}

	for _, builtin := range cfg.Builtin {
		if def, ok := fte.definitions[builtin]; !ok {
			return nil, fmt.Errorf("builtin function %s not found", builtin)
		} else {
			cfg.Definitions = append(cfg.Definitions, def)
			cfg.Handlers[builtin] = fte.handlers[builtin]
		}
	}

	barriers := make(map[string]struct{})
	for _, barrier := range cfg.Barriers {
		if _, ok := fte.handlers[barrier]; !ok {
			return nil, fmt.Errorf("barrier function %s not found", barrier)
		}
		barriers[barrier] = struct{}{}
	}

	return &customExecutor{
		userID:      fte.userID,
		flowID:      fte.flowID,
		taskID:      cfg.TaskID,

View on GitHub (pinned to ea665308ba)

Solutions

  1. Replace the reported name in cfg.Builtin with a valid builtin name registered on the flow executor (check fte.definitions / the tools registry for available names).
  2. Fix typos and align names with the current version's tool registry.
  3. Validate the Builtin list against the available definitions at config load time and log available names on mismatch.

Example fix

// before
Builtin: []string{"terminal_exec", "web_serch"}, // typo

// after
Builtin: []string{"terminal_exec", "web_search"},
Defensive patterns

Strategy: validation

Validate before calling

available := tools.AvailableBuiltinNames() // or inspect the executor's definitions
for _, b := range cfg.Builtin {
    if !slices.Contains(available, b) {
        return fmt.Errorf("unknown builtin %q; available: %v", b, available)
    }
}

Type guard

func builtinsKnown(known map[string]tools.FunctionDefinition, names []string) bool {
    for _, n := range names {
        if _, ok := known[n]; !ok {
            return false
        }
    }
    return true
}

Try / catch

executor, err := flowTools.GetCustomExecutor(cfg)
if err != nil && strings.Contains(err.Error(), "builtin function") {
    return fmt.Errorf("stale builtin tool name in config: %w", err)
}

Prevention

When it happens

Trigger: Passing cfg.Builtin containing a tool name that is not one of the executor's registered builtin definitions — e.g. a typo, a tool name from a different PentAGI version, or a tool that is only registered under a different toolset configuration.

Common situations: Hardcoded builtin lists copied from examples that don't match the deployed version's tool registry; renaming a builtin tool and forgetting to update custom executor configs; enabling a builtin that is gated behind a config flag and therefore never registered.

Related errors


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