{"record":{"id":"f981386e68234a2e","repo":"chenhg5/cc-connect","slug":"config-s-platforms-d-type-is-required","errorCode":null,"errorMessage":"config: %s.platforms[%d].type is required","messagePattern":"config: (.+?)\\.platforms\\[(.+?)\\]\\.type is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/config.go","lineNumber":1039,"sourceCode":"\t\treturn fmt.Errorf(\"config: relay.visibility must be \\\"full\\\", \\\"summary\\\", or \\\"none\\\"\")\n\t}\n\tif len(c.Projects) == 0 {\n\t\treturn fmt.Errorf(\"config: at least one [[projects]] entry is required\")\n\t}\n\tfor i, proj := range c.Projects {\n\t\tprefix := fmt.Sprintf(\"projects[%d]\", i)\n\t\tif proj.Name == \"\" {\n\t\t\treturn fmt.Errorf(\"config: %s.name is required\", prefix)\n\t\t}\n\t\tif proj.Agent.Type == \"\" {\n\t\t\treturn fmt.Errorf(\"config: %s.agent.type is required\", prefix)\n\t\t}\n\t\tif len(proj.Platforms) == 0 && !permissive {\n\t\t\treturn fmt.Errorf(\"config: %s needs at least one [[projects.platforms]]\", prefix)\n\t\t}\n\t\tfor j, p := range proj.Platforms {\n\t\t\tif p.Type == \"\" {\n\t\t\t\treturn fmt.Errorf(\"config: %s.platforms[%d].type is required\", prefix, j)\n\t\t\t}\n\t\t}\n\t\tif proj.Mode == \"multi-workspace\" {\n\t\t\tif proj.BaseDir == \"\" {\n\t\t\t\treturn fmt.Errorf(\"project %q: multi-workspace mode requires base_dir\", proj.Name)\n\t\t\t}\n\t\t\tif _, ok := proj.Agent.Options[\"work_dir\"]; ok {\n\t\t\t\treturn fmt.Errorf(\"project %q: multi-workspace mode conflicts with agent work_dir (use base_dir instead)\", proj.Name)\n\t\t\t}\n\t\t}\n\t\tif proj.ResetOnIdleMins != nil && *proj.ResetOnIdleMins < 0 {\n\t\t\treturn fmt.Errorf(\"config: %s.reset_on_idle_mins must be >= 0\", prefix)\n\t\t}\n\t\tif proj.AgentSessionIdleTimeoutMins != nil && *proj.AgentSessionIdleTimeoutMins < 0 {\n\t\t\treturn fmt.Errorf(\"config: %s.agent_session_idle_timeout_mins must be >= 0\", prefix)\n\t\t}\n\t\tif err := validateRunAsUser(prefix, proj.RunAsUser); err != nil {\n\t\t\treturn err","sourceCodeStart":1021,"sourceCodeEnd":1057,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/config/config.go#L1021-L1057","documentation":"Each [[projects.platforms]] entry must specify a type identifying which messaging platform adapter to instantiate (e.g. \"feishu\", \"telegram\"). The validator loops over the project's platforms and rejects any entry whose Type field is empty, since the registry lookup would otherwise fail with a less helpful error.","triggerScenarios":"A [[projects.platforms]] table exists under a project but its type key is missing or set to an empty string, e.g. [[projects.platforms]] with only options like token/chat_id but no type = \"...\".","commonSituations":"Copying a platform block and deleting the type line; adding a second platform entry via array syntax and forgetting the type; mis-indented TOML placing type under the wrong table.","solutions":["Add type = \"<platform>\" to the failing platform block (indexes shown in the message, e.g. platforms[0])","Use a compiled-in platform name — check config.example.toml or the plugin_*.go build tags","Ensure each [[projects.platforms]] header starts a fresh block containing its own type key"],"exampleFix":"// before\n[[projects.platforms]]\ntoken = \"x\"\n// after\n[[projects.platforms]]\ntype = \"telegram\"\ntoken = \"x\"","handlingStrategy":"validation","validationCode":"for i, p := range cfg.Projects {\n    for j, pl := range p.Platforms {\n        if pl.Type == \"\" {\n            return fmt.Errorf(\"projects[%d].platforms[%d].type is required\", i, j)\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Put type as the first key of every platform block","Copy platform blocks wholesale including their type line","Grep configs for '[[projects.platforms]]' blocks lacking a type key"],"tags":["config","validation","go"],"backgroundTag":"empty-required-field","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"}