{"record":{"id":"8632edb24c393318","repo":"chenhg5/cc-connect","slug":"unknown-platform-q-available-v","errorCode":null,"errorMessage":"unknown platform %q, available: %v","messagePattern":"unknown platform %q, available: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/registry.go","lineNumber":31,"sourceCode":"\tagentFactories    = make(map[string]AgentFactory)\n)\n\nfunc RegisterPlatform(name string, factory PlatformFactory) {\n\tplatformFactories[name] = factory\n}\n\nfunc RegisterAgent(name string, factory AgentFactory) {\n\tagentFactories[name] = factory\n}\n\nfunc CreatePlatform(name string, opts map[string]any) (Platform, error) {\n\tf, ok := platformFactories[name]\n\tif !ok {\n\t\tavailable := make([]string, 0, len(platformFactories))\n\t\tfor k := range platformFactories {\n\t\t\tavailable = append(available, k)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"unknown platform %q, available: %v\", name, available)\n\t}\n\treturn f(opts)\n}\n\nfunc ListRegisteredAgents() []string {\n\tnames := make([]string, 0, len(agentFactories))\n\tfor k := range agentFactories {\n\t\tnames = append(names, k)\n\t}\n\treturn names\n}\n\nfunc ListRegisteredPlatforms() []string {\n\tnames := make([]string, 0, len(platformFactories))\n\tfor k := range platformFactories {\n\t\tnames = append(names, k)\n\t}\n\treturn names","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/core/registry.go#L13-L49","documentation":"CreatePlatform looks up a platform factory registered via core.RegisterPlatform; if the requested name has no factory it returns this error listing all currently registered platform names, so the caller can see valid options.","triggerScenarios":"Passing a name to CreatePlatform that was never registered — e.g. building with `no_*` build tags that excluded the platform, a typo in config.toml's [platform] name, or calling CreatePlatform before the platform package's init() ran.","commonSituations":"config.toml names a platform like 'whatsapp' that doesn't exist; binary compiled with EXCLUDE/no_feishu tags but config still requests feishu; importing only some plugin_*.go files; case mismatch ('Feishu' vs 'feishu').","solutions":["Check the 'available: [...]' list in the error and correct the name in config.toml to an exact registered name","Rebuild without the excluding build tag (or via make without EXCLUDE=...) so the platform package is compiled in","Import the platform's plugin file (cmd/cc-connect/plugin_platform_*.go) so its init() registers the factory"],"exampleFix":"// before (config.toml)\nname = \"Feishu\"\n// after\nname = \"feishu\"","handlingStrategy":"validation","validationCode":"names := core.ListRegisteredPlatforms()\nif !slices.Contains(names, cfgPlatformName) {\n    return fmt.Errorf(\"platform %q not registered; available: %v\", cfgPlatformName, names)\n}","typeGuard":null,"tryCatchPattern":"p, err := core.CreatePlatform(name, opts)\nif err != nil {\n    var avail string\n    if strings.Contains(err.Error(), \"unknown platform\") {\n        fmt.Sscanf(err.Error(), \"unknown platform %*q, available: %s\", &avail)\n    }\n    return fmt.Errorf(\"fix [platform] name in config; %v\", avail)\n}","preventionTips":["Copy platform names from config.example.toml verbatim","After changing build tags (EXCLUDE/no_*), re-check the config against the compiled-in platforms","Call core.ListRegisteredPlatforms() at startup and fail fast with a friendly message"],"tags":["go","registry","configuration"],"backgroundTag":"invalid-config-value","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}