{"record":{"id":"a5da6e032899674d","repo":"vxcontrol/pentagi","slug":"adviser-handler-is-required","errorCode":null,"errorMessage":"adviser handler is required","messagePattern":"adviser handler is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/pkg/tools/tools.go","lineNumber":818,"sourceCode":"\t\tuserID:      fte.userID,\n\t\tflowID:      fte.flowID,\n\t\ttaskID:      cfg.TaskID,\n\t\tsubtaskID:   cfg.SubtaskID,\n\t\tmlp:         fte.mlp,\n\t\ttclp:        fte.tclp,\n\t\tvslp:        fte.vslp,\n\t\tdb:          fte.db,\n\t\tstore:       fte.store,\n\t\tdefinitions: cfg.Definitions,\n\t\thandlers:    cfg.Handlers,\n\t\tbarriers:    barriers,\n\t\tsummarizer:  cfg.Summarizer,\n\t}, nil\n}\n\nfunc (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","sourceCodeStart":800,"sourceCodeEnd":836,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/tools/tools.go#L800-L836","documentation":"GetAssistantExecutor requires all agent handler fields of AssistantExecutorConfig to be non-nil, starting with Adviser. The Adviser handler backs the LLM 'advise' tool used by the assistant executor; without it the executor would panic or fail at call time, so construction fails fast with this error.","triggerScenarios":"Calling GetAssistantExecutor with a struct literal or a programmatically built AssistantExecutorConfig whose Adviser field is nil — e.g. skipping Adviser when wiring only a subset of agent handlers.","commonSituations":"Partial wiring of handlers in provider setup code; a config struct built conditionally where the Adviser assignment is skipped; copy-pasting an executor config from a path that does not supply Adviser.","solutions":["Supply a non-nil Adviser handler in AssistantExecutorConfig before calling GetAssistantExecutor.","Verify the handler-construction function that builds Adviser is actually called and its error checked.","Check upstream config (env/DB prompt settings) that gates whether the adviser handler is created."],"exampleFix":"// before\nexecutor, err := fte.GetAssistantExecutor(AssistantExecutorConfig{\n  Coder: coder,\n}) // Adviser nil\n// after\nexecutor, err := fte.GetAssistantExecutor(AssistantExecutorConfig{\n  Adviser: adviser,\n  Coder:   coder,\n})","handlingStrategy":"validation","validationCode":"if cfg.Adviser == nil || cfg.Coder == nil || cfg.Installer == nil || cfg.Memorist == nil || cfg.Pentester == nil || cfg.Searcher == nil {\n    return errors.New(\"assistant executor config incomplete\")\n}","typeGuard":"func validAssistantConfig(cfg tools.AssistantExecutorConfig) bool {\n    return cfg.Adviser != nil\n}","tryCatchPattern":"executor, err := fte.GetAssistantExecutor(cfg)\nif err != nil {\n    if strings.Contains(err.Error(), \"handler is required\") {\n        // log which fields were nil; fail fast before agent start\n    }\n    return err\n}","preventionTips":["Build all agent handlers in one constructor and pass them together.","Check every handler construction error immediately; never ignore a nil result.","Use a single config struct literal so all fields are visible at the call site."],"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"}