{"record":{"id":"8caa622fed1a4954","repo":"vxcontrol/pentagi","slug":"pentester-handler-is-required","errorCode":null,"errorMessage":"pentester handler is required","messagePattern":"pentester handler is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/pkg/tools/tools.go","lineNumber":834,"sourceCode":"func (fte *flowToolsExecutor) GetAssistantExecutor(cfg AssistantExecutorConfig) (ContextToolsExecutor, error) {\n\tif cfg.Adviser == nil {\n\t\treturn nil, fmt.Errorf(\"adviser handler is required\")\n\t}\n\n\tif cfg.Coder == nil {\n\t\treturn nil, fmt.Errorf(\"coder handler is required\")\n\t}\n\n\tif cfg.Installer == nil {\n\t\treturn nil, fmt.Errorf(\"installer handler is required\")\n\t}\n\n\tif cfg.Memorist == nil {\n\t\treturn nil, fmt.Errorf(\"memorist handler is required\")\n\t}\n\n\tif cfg.Pentester == nil {\n\t\treturn nil, fmt.Errorf(\"pentester handler is required\")\n\t}\n\n\tif cfg.Searcher == nil {\n\t\treturn nil, fmt.Errorf(\"searcher handler is required\")\n\t}\n\n\tcontainer, err := fte.db.GetFlowPrimaryContainer(context.Background(), fte.flowID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get container %d: %w\", fte.flowID, err)\n\t}\n\n\tterm := NewTerminalTool(\n\t\tfte.flowID, nil, nil,\n\t\tcontainer.ID,\n\t\tcontainer.LocalID.String,\n\t\tfte.cfg.TenantPrefix(),\n\t\tfte.docker,\n\t\tfte.tlp,","sourceCodeStart":816,"sourceCodeEnd":852,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/tools/tools.go#L816-L852","documentation":"Constructor validation error (backend/pkg/tools/tools.go): the flow tool-set factory was invoked with a nil Pentester handler in its config. Programming/configuration error — all agent handlers must be wired before building the flow's tool executor.","triggerScenarios":"Calling GetAssistantExecutor with cfg.Pentester == nil — the pentester handler was omitted from the config or its construction failed upstream.","commonSituations":"Stripped-down setups that omit the pentester agent; ignored construction errors leading to a nil handler; refactoring that dropped the field.","solutions":["Assign a non-nil Pentester handler in AssistantExecutorConfig.","Verify the pentester handler construction ran and returned non-nil.","Add a pre-call nil check across all required handlers."],"exampleFix":"// before\nexecutor, err := fte.GetAssistantExecutor(AssistantExecutorConfig{\n  Adviser: adviser, Coder: coder, Installer: installer, Memorist: memorist,\n}) // Pentester nil\n// after\nexecutor, err := fte.GetAssistantExecutor(AssistantExecutorConfig{\n  Adviser: adviser, Coder: coder, Installer: installer, Memorist: memorist, Pentester: pentester,\n})","handlingStrategy":"validation","validationCode":"if cfg.Pentester == nil {\n    return errors.New(\"pentester handler missing from AssistantExecutorConfig\")\n}","typeGuard":"func hasPentester(cfg tools.AssistantExecutorConfig) bool {\n    return cfg.Pentester != nil\n}","tryCatchPattern":"executor, err := fte.GetAssistantExecutor(cfg)\nif err != nil {\n    if strings.Contains(err.Error(), \"pentester handler is required\") {\n        return fmt.Errorf(\"wiring bug: pentester handler not built: %w\", err)\n    }\n    return err\n}","preventionTips":["Build the pentester handler unconditionally — it is the core agent.","Check handler constructor errors immediately after each call.","Add a smoke test that constructs the assistant executor with the full handler set."],"tags":["configuration","nil-handler","assistant-executor"],"backgroundTag":"required-handler-missing","analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}