chenhg5/cc-connect · error
project %q: multi-workspace mode conflicts with agent work_d
Error message
project %q: multi-workspace mode conflicts with agent work_dir (use base_dir instead)
What it means
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.
Source
Thrown at config/config.go:1047
return fmt.Errorf("config: %s.name is required", prefix)
}
if proj.Agent.Type == "" {
return fmt.Errorf("config: %s.agent.type is required", prefix)
}
if len(proj.Platforms) == 0 && !permissive {
return fmt.Errorf("config: %s needs at least one [[projects.platforms]]", prefix)
}
for j, p := range proj.Platforms {
if p.Type == "" {
return fmt.Errorf("config: %s.platforms[%d].type is required", prefix, j)
}
}
if proj.Mode == "multi-workspace" {
if proj.BaseDir == "" {
return fmt.Errorf("project %q: multi-workspace mode requires base_dir", proj.Name)
}
if _, ok := proj.Agent.Options["work_dir"]; ok {
return fmt.Errorf("project %q: multi-workspace mode conflicts with agent work_dir (use base_dir instead)", proj.Name)
}
}
if proj.ResetOnIdleMins != nil && *proj.ResetOnIdleMins < 0 {
return fmt.Errorf("config: %s.reset_on_idle_mins must be >= 0", prefix)
}
if proj.AgentSessionIdleTimeoutMins != nil && *proj.AgentSessionIdleTimeoutMins < 0 {
return fmt.Errorf("config: %s.agent_session_idle_timeout_mins must be >= 0", prefix)
}
if err := validateRunAsUser(prefix, proj.RunAsUser); err != nil {
return err
}
if err := validateRunAsEnv(prefix, proj.RunAsEnv); err != nil {
return err
}
if err := validateReferenceConfig(prefix, proj.References); err != nil {
return err
}
if err := validateUsersConfig(prefix, proj.Users); err != nil {View on GitHub (pinned to 4000b2338a)
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
Example fix
// before [[projects]] name = "my-app" mode = "multi-workspace" base_dir = "/home/me/workspaces" [projects.agent.options] work_dir = "/home/me/old" // after [[projects]] name = "my-app" mode = "multi-workspace" base_dir = "/home/me/workspaces"
Defensive patterns
Strategy: validation
Validate before calling
if proj.Mode == "multi-workspace" {
if _, ok := proj.Agent.Options["work_dir"]; ok {
return fmt.Errorf("project %q: drop agent.options.work_dir in multi-workspace mode", proj.Name)
}
} Prevention
- 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
When it happens
Trigger: 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"]).
Common situations: 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.
Related errors
- tmux: 'session' option is required (name of the tmux session
- config: relay.visibility must be "full", "summary", or "none
- config: at least one [[projects]] entry is required
- config: %s.name is required
- config: %s.agent.type is required
AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06).
Data as JSON: /api/errors/035b602a29d2cf48.
Report an issue: GitHub.