{"record":{"id":"035b602a29d2cf48","repo":"chenhg5/cc-connect","slug":"project-q-multi-workspace-mode-conflicts-with-ag","errorCode":null,"errorMessage":"project %q: multi-workspace mode conflicts with agent work_dir (use base_dir instead)","messagePattern":"project %q: multi-workspace mode conflicts with agent work_dir \\(use base_dir instead\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/config.go","lineNumber":1047,"sourceCode":"\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 {\n\t\t\treturn err\n\t\t}\n\t\tif err := validateUsersConfig(prefix, proj.Users); err != nil {","sourceCodeStart":1029,"sourceCodeEnd":1065,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/config/config.go#L1029-L1065","documentation":"In multi-workspace mode the working directory is derived from base_dir per session, so explicitly pinning agent.options.work_dir contradicts it. The validator rejects a project that sets mode = \"multi-workspace\" while its Agent.Options map contains a \"work_dir\" key.","triggerScenarios":"A [[projects]] entry has mode = \"multi-workspace\" AND [projects.agent.options] contains work_dir = \"...\" (the key's value is irrelevant — even an empty work_dir triggers the check via _, ok := opts[\"work_dir\"]).","commonSituations":"Migrating a single-workspace project to multi-workspace without deleting the old work_dir option; merging two project configs; cargo-culting options from another project.","solutions":["Delete the work_dir entry from [projects.agent.options], keeping base_dir","Or remove mode = \"multi-workspace\" and keep work_dir for a single fixed workspace","Re-validate after the change"],"exampleFix":"// before\n[[projects]]\nname = \"my-app\"\nmode = \"multi-workspace\"\nbase_dir = \"/home/me/workspaces\"\n[projects.agent.options]\nwork_dir = \"/home/me/old\"\n// after\n[[projects]]\nname = \"my-app\"\nmode = \"multi-workspace\"\nbase_dir = \"/home/me/workspaces\"","handlingStrategy":"validation","validationCode":"if proj.Mode == \"multi-workspace\" {\n    if _, ok := proj.Agent.Options[\"work_dir\"]; ok {\n        return fmt.Errorf(\"project %q: drop agent.options.work_dir in multi-workspace mode\", proj.Name)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When migrating to multi-workspace, delete legacy work_dir options","Keep base_dir as the single source of working-directory truth","Grep for 'work_dir' when mode = \"multi-workspace\" is present"],"tags":["config","validation","go"],"backgroundTag":"conflicting-config-options","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"}