{"record":{"id":"98bd97bed61cb2a5","repo":"chenhg5/cc-connect","slug":"config-s-name-is-required","errorCode":null,"errorMessage":"config: %s.name is required","messagePattern":"config: (.+?)\\.name is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/config.go","lineNumber":1029,"sourceCode":"\tcase \"\", \"on\", \"off\":\n\tdefault:\n\t\treturn fmt.Errorf(\"config: attachment_send must be \\\"on\\\" or \\\"off\\\"\")\n\t}\n\tif c.Relay.TimeoutSecs != nil && *c.Relay.TimeoutSecs < 0 {\n\t\treturn fmt.Errorf(\"config: relay.timeout_secs must be >= 0\")\n\t}\n\tswitch strings.ToLower(strings.TrimSpace(c.Relay.Visibility)) {\n\tcase \"\", \"full\", \"summary\", \"none\":\n\tdefault:\n\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)","sourceCodeStart":1011,"sourceCodeEnd":1047,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/config/config.go#L1011-L1047","documentation":"Each [[projects]] entry must have a non-empty name, used as the project identifier in sessions, logs, and error messages. The validator iterates c.Projects and rejects any entry whose Name field is empty, reporting the index via the projects[%d] prefix.","triggerScenarios":"A [[projects]] block exists but its name key is missing, set to an empty string (name = \"\"), or the TOML structure is malformed so the name field never deserializes into the Project struct.","commonSituations":"Copy-pasting a project block and forgetting to fill in name; renaming a project by clearing the value; whitespace-only names are NOT trimmed here — a name of \" \" also passes TOML but note only truly empty \"\" triggers this.","solutions":["Set a non-empty name in the offending [[projects]] block (index shown in the message, e.g. projects[2])","Check that the name key is at the project level, not nested under agent or platforms","Verify the TOML array-of-tables syntax is correct so fields bind to the right entry"],"exampleFix":"// before\n[[projects]]\nname = \"\"\nagent.type = \"claudecode\"\n// after\n[[projects]]\nname = \"my-app\"\nagent.type = \"claudecode\"","handlingStrategy":"validation","validationCode":"for i, p := range cfg.Projects {\n    if strings.TrimSpace(p.Name) == \"\" {\n        return fmt.Errorf(\"projects[%d].name is empty\", i)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Give every project a unique, descriptive name when creating the block","Never leave placeholder empty strings in committed configs","Run config validation before restarts"],"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-14T05:17:10.506Z"}