diff --git a/internal/config/path_overlap.go b/internal/config/path_overlap.go index a423d9617..c9f3715a3 100644 --- a/internal/config/path_overlap.go +++ b/internal/config/path_overlap.go @@ -158,9 +158,15 @@ func SkillsFolderConflicts(targets map[string]TargetConfig, defaultMode string) } func sameSkillsSettings(a, b ResourceTargetConfig, defaultMode string) bool { - return effectiveMode(a.Mode, defaultMode) == effectiveMode(b.Mode, defaultMode) && - EffectiveTargetNaming(a.TargetNaming) == EffectiveTargetNaming(b.TargetNaming) && - sameSet(a.Include, b.Include) && sameSet(a.Exclude, b.Exclude) + mode := effectiveMode(a.Mode, defaultMode) + if mode != effectiveMode(b.Mode, defaultMode) { + return false + } + // symlink mode links the whole folder to the source, so skill names never apply. + if mode != "symlink" && EffectiveTargetNaming(a.TargetNaming) != EffectiveTargetNaming(b.TargetNaming) { + return false + } + return sameSet(a.Include, b.Include) && sameSet(a.Exclude, b.Exclude) } // effectiveMode mirrors the sync package's mode resolution: the target's own, diff --git a/internal/config/path_overlap_test.go b/internal/config/path_overlap_test.go index e124baf9c..c06082214 100644 --- a/internal/config/path_overlap_test.go +++ b/internal/config/path_overlap_test.go @@ -118,6 +118,16 @@ func TestSkillsFolderConflicts_DifferentMode(t *testing.T) { } } +func TestSkillsFolderConflicts_SymlinkIgnoresTargetNaming(t *testing.T) { + got := SkillsFolderConflicts(map[string]TargetConfig{ + "aflat": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills", Mode: "symlink", TargetNaming: "flat"}}, + "bstd": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills", TargetNaming: "standard"}}, + }, "symlink") + if len(got) != 0 { + t.Errorf("expected no conflict, got %+v", got) + } +} + func TestSkillsFolderConflicts_UnsetEqualsDefault(t *testing.T) { got := SkillsFolderConflicts(map[string]TargetConfig{ "unset": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills"}},