{"record":{"id":"5f1142fac71aa419","repo":"sipeed/picoclaw","slug":"channel-q-has-unknown-type-q","errorCode":null,"errorMessage":"channel %q has unknown type %q","messagePattern":"channel %q has unknown type %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/config_channel.go","lineNumber":742,"sourceCode":"//     so that b.extend contains the actual settings (e.g., PicoSettings)\n//\n// After calling this method, callers can safely use b.extend via Decode()\n// without re-parsing raw Settings.\nfunc InitChannelList(channels ChannelsConfig) error {\n\t// Step 1 & 3: validate type and decode into typed settings\n\tfor name, bc := range channels {\n\t\tif bc == nil {\n\t\t\tdelete(channels, name)\n\t\t\tcontinue\n\t\t}\n\t\t// Ensure channel name is set from the map key\n\t\tbc.SetName(name)\n\t\t// Infer Type from map key if not explicitly set\n\t\tif bc.Type == \"\" {\n\t\t\tbc.Type = name\n\t\t}\n\t\tif !isValidChannelType(bc.Type) {\n\t\t\treturn fmt.Errorf(\"channel %q has unknown type %q\", name, bc.Type)\n\t\t}\n\t\t// Decode into the correct typed settings\n\t\tif target := newChannelSettings(bc.Type); target != nil {\n\t\t\tif err := bc.Decode(target); err != nil {\n\t\t\t\treturn fmt.Errorf(\"channel %q failed to decode settings: %w\", name, err)\n\t\t\t}\n\t\t\t// Apply env overrides for channel-specific fields via struct tags\n\t\t\tif err := env.Parse(target); err != nil {\n\t\t\t\t// Non-fatal: some env vars may not apply\n\t\t\t}\n\t\t\tapplyTelegramStreamingEnvCompat(target)\n\t\t\tif err := validateChannelStreamingConfig(name, target); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\t// Step 2: validate singleton constraints","sourceCodeStart":724,"sourceCodeEnd":760,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/config/config_channel.go#L724-L760","documentation":"Error \"channel %q has unknown type %q\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at pkg/config/config_channel.go:742 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}