{"record":{"id":"1cbda977c2e80377","repo":"sipeed/picoclaw","slug":"channel-s-not-found-or-not-enabled","errorCode":null,"errorMessage":"channel '%s' not found or not enabled","messagePattern":"channel '(.+?)' not found or not enabled","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/agent/agent_command.go","lineNumber":272,"sourceCode":"\t\tGetEnabledChannels: func() []string {\n\t\t\tif al.channelManager == nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn al.channelManager.GetEnabledChannels()\n\t\t},\n\t\tGetActiveTurn: func() any {\n\t\t\tinfo := al.GetActiveTurn()\n\t\t\tif info == nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn info\n\t\t},\n\t\tSwitchChannel: func(value string) error {\n\t\t\tif al.channelManager == nil {\n\t\t\t\treturn fmt.Errorf(\"channel manager not initialized\")\n\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()","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/agent/agent_command.go#L254-L290","documentation":"SwitchChannel could not find the requested channel via channelManager.GetChannel, and the name is not the special-case \"cli\" channel which is always permitted. Only channels registered and enabled in the channel manager can be switched to.","triggerScenarios":"`/channel telegram` when telegram is not configured/enabled; typo in the channel name; channel disabled in config; channel registered in a different process/session; empty or whitespace name (not \"cli\", not found).","commonSituations":"Trying to switch to a channel whose integration keys/tokens were never set up; channel names differing from docs (e.g. 'telegram' vs 'tg'); attempting switch in an environment where only CLI is active.","solutions":["List enabled channels first (GetEnabledChannels hook / the corresponding list command) and use an exact name","Enable and configure the channel in config (credentials, enabled flag), reload, then switch","Use `/channel cli` to return to the CLI channel — it is always accepted"],"exampleFix":"# before\n/channel teleggram   # typo\n\n# after\n/channels            # list enabled names\n/channel telegram","handlingStrategy":"validation","validationCode":"func channelSelectable(al *AgentLoop, name string) bool {\n    if name == \"cli\" { return true }\n    _, ok := al.channelManager.GetChannel(name)\n    return ok\n}","typeGuard":"func isValidChannel(al *AgentLoop, name string) bool {\n    if name == \"cli\" { return true }\n    _, exists := al.channelManager.GetChannel(name)\n    return exists\n}","tryCatchPattern":null,"preventionTips":["Drive channel pickers from GetEnabledChannels() output","Reserve 'cli' as the only special-cased name","Validate names case-sensitively — matching is exact here"],"tags":["channels","configuration","validation"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}