{"record":{"id":"054a1fbdc8055df6","repo":"vxcontrol/pentagi","slug":"coder-handler-is-required","errorCode":null,"errorMessage":"coder handler is required","messagePattern":"coder handler is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/pkg/tools/tools.go","lineNumber":822,"sourceCode":"\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\n\tif cfg.Searcher == nil {\n\t\treturn nil, fmt.Errorf(\"searcher handler is required\")\n\t}\n","sourceCodeStart":804,"sourceCodeEnd":840,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/tools/tools.go#L804-L840","documentation":"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.","triggerScenarios":"Calling GetAssistantExecutor with cfg.Coder == nil — e.g. constructing the config without assigning the coder handler, or the coder handler construction failed silently upstream.","commonSituations":"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.","solutions":["Assign a valid Coder handler in AssistantExecutorConfig.","Ensure the code that creates the coder handler ran successfully and returned non-nil.","Add a pre-call check that all required handler fields are set."],"exampleFix":"// before\nexecutor, err := fte.GetAssistantExecutor(AssistantExecutorConfig{\n  Adviser: adviser,\n}) // Coder nil\n// after\nexecutor, err := fte.GetAssistantExecutor(AssistantExecutorConfig{\n  Adviser: adviser,\n  Coder:   coder,\n})","handlingStrategy":"validation","validationCode":"if cfg.Coder == nil {\n    return errors.New(\"coder handler missing from AssistantExecutorConfig\")\n}","typeGuard":"func hasCoder(cfg tools.AssistantExecutorConfig) bool {\n    return cfg.Coder != nil\n}","tryCatchPattern":"executor, err := fte.GetAssistantExecutor(cfg)\nif err != nil {\n    if strings.Contains(err.Error(), \"coder handler is required\") {\n        return fmt.Errorf(\"wiring bug: coder handler not built: %w\", err)\n    }\n    return err\n}","preventionTips":["Assign every handler field explicitly in the config literal.","Add a unit test asserting GetAssistantExecutor succeeds with your standard handler set.","Ensure coder handler construction errors are checked before building the config."],"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"}