vxcontrol/pentagi · error

coder handler is required

Error message

coder handler is required

What it means

GetAssistantExecutor validates every agent handler in AssistantExecutorConfig; Coder must be non-nil because it backs the 'coder' tool used to write code in the sandbox. A nil Coder aborts executor construction with this error.

Source

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

		mlp:         fte.mlp,
		tclp:        fte.tclp,
		vslp:        fte.vslp,
		db:          fte.db,
		store:       fte.store,
		definitions: cfg.Definitions,
		handlers:    cfg.Handlers,
		barriers:    barriers,
		summarizer:  cfg.Summarizer,
	}, nil
}

func (fte *flowToolsExecutor) GetAssistantExecutor(cfg AssistantExecutorConfig) (ContextToolsExecutor, error) {
	if cfg.Adviser == nil {
		return nil, fmt.Errorf("adviser handler is required")
	}

	if cfg.Coder == nil {
		return nil, fmt.Errorf("coder handler is required")
	}

	if cfg.Installer == nil {
		return nil, fmt.Errorf("installer handler is required")
	}

	if cfg.Memorist == nil {
		return nil, fmt.Errorf("memorist handler is required")
	}

	if cfg.Pentester == nil {
		return nil, fmt.Errorf("pentester handler is required")
	}

	if cfg.Searcher == nil {
		return nil, fmt.Errorf("searcher handler is required")
	}

View on GitHub (pinned to ea665308ba)

Solutions

  1. Assign a valid Coder handler in AssistantExecutorConfig.
  2. Ensure the code that creates the coder handler ran successfully and returned non-nil.
  3. Add a pre-call check that all required handler fields are set.

Example fix

// before
executor, err := fte.GetAssistantExecutor(AssistantExecutorConfig{
  Adviser: adviser,
}) // Coder nil
// after
executor, err := fte.GetAssistantExecutor(AssistantExecutorConfig{
  Adviser: adviser,
  Coder:   coder,
})
Defensive patterns

Strategy: validation

Validate before calling

if cfg.Coder == nil {
    return errors.New("coder handler missing from AssistantExecutorConfig")
}

Type guard

func hasCoder(cfg tools.AssistantExecutorConfig) bool {
    return cfg.Coder != nil
}

Try / catch

executor, err := fte.GetAssistantExecutor(cfg)
if err != nil {
    if strings.Contains(err.Error(), "coder handler is required") {
        return fmt.Errorf("wiring bug: coder handler not built: %w", err)
    }
    return err
}

Prevention

When it happens

Trigger: Calling GetAssistantExecutor with cfg.Coder == nil — e.g. constructing the config without assigning the coder handler, or the coder handler construction failed silently upstream.

Common situations: Wiring only some agents in custom flow setups; a nil handler due to an earlier initialization error that was ignored; refactoring that dropped the Coder field assignment.

Related errors


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