{"record":{"id":"022e26caf27d187a","repo":"chenhg5/cc-connect","slug":"project-q-multi-workspace-mode-requires-base-dir","errorCode":null,"errorMessage":"project %q: multi-workspace mode requires base_dir","messagePattern":"project %q: multi-workspace mode requires base_dir","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/config.go","lineNumber":1044,"sourceCode":"\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\n\t\t}\n\t\tif err := validateRunAsEnv(prefix, proj.RunAsEnv); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := validateReferenceConfig(prefix, proj.References); err != nil {","sourceCodeStart":1026,"sourceCodeEnd":1062,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/config/config.go#L1026-L1062","documentation":"When a project's mode is \"multi-workspace\", it must define base_dir — the root directory under which per-workspace directories are created. Because multi-workspace mode derives working directories dynamically, a missing base_dir leaves the engine with no location to operate in, so validation fails.","triggerScenarios":"Setting mode = \"multi-workspace\" on a [[projects]] entry while leaving base_dir unset or empty, then loading the config.","commonSituations":"Switching a project from single-workspace to multi-workspace mode without adding the required base_dir; copying a multi-workspace example but omitting the path; environments where the base_dir line was environment-specific and removed.","solutions":["Add base_dir = \"/absolute/path/to/workspaces\" to the multi-workspace project","Remove mode = \"multi-workspace\" if you intended a single fixed working directory (use agent work_dir instead)","Ensure base_dir points to an existing or creatable directory"],"exampleFix":"// before\n[[projects]]\nname = \"my-app\"\nmode = \"multi-workspace\"\n// after\n[[projects]]\nname = \"my-app\"\nmode = \"multi-workspace\"\nbase_dir = \"/home/me/workspaces\"","handlingStrategy":"validation","validationCode":"if proj.Mode == \"multi-workspace\" && strings.TrimSpace(proj.BaseDir) == \"\" {\n    return fmt.Errorf(\"multi-workspace project %q needs base_dir\", proj.Name)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat mode and base_dir as an inseparable pair","Use absolute paths for base_dir","Review diffs when switching a project's mode"],"tags":["config","validation","go","filesystem"],"backgroundTag":"missing-required-config-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"}