{"record":{"id":"cc8b72bfbe0d3567","repo":"sipeed/picoclaw","slug":"reload-not-configured","errorCode":null,"errorMessage":"reload not configured","messagePattern":"reload not configured","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/agent/agent_command.go","lineNumber":288,"sourceCode":"\t\t\t}\n\t\t\tif _, exists := al.channelManager.GetChannel(value); !exists && value != \"cli\" {\n\t\t\t\treturn fmt.Errorf(\"channel '%s' not found or not enabled\", value)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\trt.StopActiveTurn = func() (commands.StopResult, error) {\n\t\tif opts == nil {\n\t\t\treturn commands.StopResult{}, fmt.Errorf(\"process options not available\")\n\t\t}\n\t\treturn al.stopActiveTurnForSession(opts.Dispatch.SessionKey)\n\t}\n\tif agent != nil && agent.ContextBuilder != nil {\n\t\trt.ListSkillNames = agent.ContextBuilder.ListSkillNames\n\t}\n\trt.ReloadConfig = func() error {\n\t\tif al.reloadFunc == nil {\n\t\t\treturn fmt.Errorf(\"reload not configured\")\n\t\t}\n\t\treturn al.reloadFunc()\n\t}\n\tif agent != nil {\n\t\tif agent.ContextBuilder != nil {\n\t\t\trt.ListSkillNames = agent.ContextBuilder.ListSkillNames\n\t\t}\n\t\trt.GetModelInfo = func() (string, string) {\n\t\t\treturn agent.Model, resolvedCandidateProvider(agent.Candidates, cfg.Agents.Defaults.Provider)\n\t\t}\n\t\trt.SwitchModel = func(value string) (string, error) {\n\t\t\tvalue = strings.TrimSpace(value)\n\t\t\tmodelCfg, err := resolvedModelConfig(cfg, value, agent.Workspace)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\n\t\t\tnextProvider, _, err := providers.CreateProviderFromConfig(modelCfg)","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/agent/agent_command.go#L270-L306","documentation":"The ReloadConfig hook found al.reloadFunc == nil: no config-reload callback was attached to the agent loop when it was built, so /reload cannot do anything. The reload function is injected by the embedding process; its absence means this runtime instance was not given a way to re-read configuration.","triggerScenarios":"Running /reload in an embedded AgentLoop whose constructor never set reloadFunc; tests instantiating the loop without wiring; a code path that deliberately omits reload support but leaves the command reachable.","commonSituations":"Custom binaries embedding pkg/agent without providing a reload callback; older embedding API that made reloadFunc optional; CI/one-shot invocations where reload is meaningless but the command leaked through.","solutions":["Wire a reload callback (al.reloadFunc) when constructing the agent loop in your embedding","Hide the /reload command in deployments that cannot reload","Restart the process as the manual alternative to reload"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"if al.reloadFunc == nil { /* omit /reload from command help and dispatch */ }","typeGuard":"func reloadReady(al *AgentLoop) bool { return al.reloadFunc != nil }","tryCatchPattern":"err := rt.ReloadConfig()\nif err != nil && strings.Contains(err.Error(), \"reload not configured\") {\n    // unsupported in this embedding: fall back to process restart\n}","preventionTips":["Always wire a reloadFunc when embedding and exposing /reload","Feature-detect: register the command only if the hook exists","Document restart-as-reload for minimal embeddings"],"tags":["runtime","configuration","initialization"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}