Repository navigation
fix(sync): flag shared skills folders whose mode or naming differ - #499
Conversation
Two targets writing one skills folder with different target_naming or mode undo each other on every sync (flat links vs standard names, merge vs copy), but only include/exclude were compared, so sync and doctor fell back to the generic shared-path hint. Compare the effective mode and target naming too, so an unset value equals the default it resolves to. The global default mode is not carried on the target, so SkillsFolderConflicts takes it from its three callers. The warning now says "different settings" instead of "different filters". Fixes #498
The warning now reads "different settings", but the explanatory prose around it in the doctor and common-errors pages still described the conflict as include/exclude filters only. Name mode and target_naming there as well, in English and the four translated doc sets.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06a0d36536
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return sameSet(a.Include, b.Include) && sameSet(a.Exclude, b.Exclude) | ||
| func sameSkillsSettings(a, b ResourceTargetConfig, defaultMode string) bool { | ||
| return effectiveMode(a.Mode, defaultMode) == effectiveMode(b.Mode, defaultMode) && | ||
| EffectiveTargetNaming(a.TargetNaming) == EffectiveTargetNaming(b.TargetNaming) && |
There was a problem hiding this comment.
Ignore target naming when both targets use symlink mode
When two targets sharing a path both resolve to symlink mode but specify different target_naming values, this comparison reports a folder conflict and the CLI/dashboard recommends disabling one target. In symlink mode, SyncSkillTarget delegates to SyncTarget, which links the entire target path to the source and never uses TargetNaming, so these settings cannot undo each other; compare naming only for modes where individual skill names are material.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 588d29c. sameSkillsSettings now compares target naming only when the shared mode isn't symlink, since symlink mode links the whole folder and never uses skill names. Covered by TestSkillsFolderConflicts_SymlinkIgnoresTargetNaming (one target with explicit symlink, the other inheriting it from the global default).
Codex review on #499: two targets on one folder that both resolve to symlink mode were reported as a conflict when their target_naming differed. Symlink mode links the whole folder to the source and never uses per-skill names, so the naming cannot make them undo each other. Compare naming only when the shared mode is not symlink.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 588d29c79d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Resolution: disable one of the overlapping targets, or set a distinct path with `skillshare target <name> --path <dir>`. | ||
|
|
||
| When the targets sharing a path have different `include` or `exclude` filters, each sync adds what one target wants and prunes what another filters out, so the folder never settles and `sync` keeps showing the same pending changes. Doctor marks these and suggests turning skills off for all but one target (`universal` when it is one of them) instead of removing a target: | ||
| When the targets sharing a path have different `include` or `exclude` filters, `mode`, or `target_naming`, each sync adds what one target wants and prunes what another filters out, so the folder never settles and `sync` keeps showing the same pending changes. Doctor marks these and suggests turning skills off for all but one target (`universal` when it is one of them) instead of removing a target: |
There was a problem hiding this comment.
Exempt symlink naming from the conflict docs
When both shared targets resolve to symlink, differing target_naming values do not produce a conflict: the fresh evidence in this revision is the mode != "symlink" guard in internal/config/path_overlap.go:165-169, because symlink mode links the whole source folder. This sentence, along with the mirrored sync, troubleshooting, and localized documentation, still claims that any target_naming difference leaves the folder unsettled and triggers a warning, which can lead users to disable a valid target; qualify the naming rule for non-symlink modes.
AGENTS.md reference: AGENTS.md:L15-L15
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 7e6649f. The doctor, sync and troubleshooting pages, their ko/ja/zh-Hant/zh-Hans translations, and the SkillsFolderConflicts doc comment now say target naming only matters outside symlink mode. Docs-only; the behavior is covered by TestSkillsFolderConflicts_SymlinkIgnoresTargetNaming from 588d29c.
Codex review on #499: after 588d29c the conflict check skips target_naming when the shared mode is symlink, but the doctor, sync and troubleshooting pages (and their translations) still said any naming difference makes shared targets undo each other. That could lead users to turn off a valid symlink target, so qualify the rule.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e6649f2c5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ### `sync` keeps showing the same changes {#sync-keeps-showing-the-same-changes} | ||
|
|
||
| **Cause:** Two targets sync skills into the same folder with different `include` or `exclude` filters. Each sync adds what one target wants and removes what the other filters out, so the folder never settles. `sync` names them: | ||
| **Cause:** Two targets sync skills into the same folder with different `include` or `exclude` filters, `mode`, or `target_naming` (naming only matters outside `symlink` mode, which links the whole folder). Each sync adds what one target wants and removes what the other filters out, so the folder never settles. `sync` names them: |
There was a problem hiding this comment.
Correct the filter-only troubleshooting advice
When the warning is caused solely by different mode or target_naming values, the later advice that giving both targets the same filters resolves it is false, and this paragraph's explanation about one target removing what the other filters out does not describe that case either. Update the English and mirrored localized troubleshooting text to say that every relevant setting must agree (or one target must stop syncing), otherwise users following the advertised alternative will keep seeing the same conflict.
AGENTS.md reference: AGENTS.md:L15-L15
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 549d4d8. The troubleshooting cause now says each sync undoes the other target's work (adding or removing filtered skills, renaming entries, or switching links and copies), the alternative fix says the targets need the same filters, mode and target naming, and the doctor page uses the same wording. Applied to English and the ko/ja/zh-Hant/zh-Hans pages. Docs-only.
Codex review on #499: the troubleshooting and doctor pages explained the conflict as one target adding what the other filters out, and offered "give both targets the same filters" as a fix. When the conflict comes from mode or target naming, that fix does nothing and the explanation doesn't match what happens (entries renamed, links swapped for copies). Describe the conflict as each sync undoing the other's work and say all three settings must agree, in English and the four translations.
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
A /simplify pass on #499 found the symlink exception too narrow: symlink mode links the whole folder to the source and reads neither target naming nor include/exclude, yet two symlink targets with different filters were still reported as undoing each other. State the rule once (same symlink mode means same folder contents) instead of exempting only naming, and resolve the mode with cmp.Or like sync's isSymlinkMode rather than a local copy of the sync package's resolver. Docs now say none of these settings matter in symlink mode.
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The target page needs to know which other targets write to the same skills folder to warn when an unsaved mode or naming change would make their syncs undo each other. Re-implementing the server's folder normalisation (home expansion, path cleaning) in TypeScript would drift from config.SkillsFolderConflicts, so the targets API now returns skillsSharedWith, built from the same skillsFolder helper.
The notice said two targets sync into one folder "with different settings" but not which ones, so users could not tell what to change (mode, naming or filters) to keep both. Under the existing sentence and stop buttons it now lists only the settings that differ as a small grid, keep target first, with a link to the target page to change them. Symlink targets show n/a for naming and filters, matching the server rule that those settings do not apply there. The names-as-links sentence is shared with the target page's reader notes.
…older Changing sync mode or naming on a target whose skills folder another target also writes silently set up the conflict that the Sync page only reported after saving. The target page now compares the draft with each sharing target and, under the control that causes it, says the other target's value and offers "Use <value> like <target>". Nothing shows when both resolve to symlink or the draft matches. The symlink mode copy now also says naming does not apply there.
Code review of the target-page warning found the new targets API field only had a unit test on the config helper. The handler is what the UI reads, so check that it names targets writing the same skills folder and leaves out one that writes elsewhere. Release-As: 0.25.4
…unkids/skillshare into runkids/fix-498-shared-folder-conflict
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e3437a0a8a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const modeClash = agent ? undefined : sharing.find((o) => o.mode !== draft.mode); | ||
| // Symlink links the whole folder, so naming only matters once the modes agree on something else. | ||
| const namingClash = modeClash ? undefined : sharing.find((o) => o.targetNaming !== draft.naming); |
There was a problem hiding this comment.
Keep warning when shared filters still differ
When shared targets have the same mode and naming but different include or exclude values—or after the user uses this page to resolve an initial mode mismatch—both clash checks return undefined, so the target page implies that the conflict is resolved even though SkillsFolderConflicts will still report it and subsequent syncs can prune one another's entries. Compare the draft filters with every shared target and surface the mismatch alongside the filter controls.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in dd3cc06. The target page now compares the draft include/exclude with every target sharing the skills folder (skipped in symlink mode and while a mode clash is already shown) and puts a note under the filters with a button that copies the other target's filters. Covered by the new "warns under the filters when only they differ" test in TargetDetailPage.test.tsx; vitest 638/638, eslint, tsc, pnpm build and make check pass.
Codex review on #499: when two targets on one skills folder agreed on mode and naming but had different include/exclude, the target page showed no note, so it looked settled while the Sync page still reported the conflict and each sync kept pruning the other's entries. Compare the draft filters with every target sharing the folder (outside symlink mode, which ignores them) and offer to copy the other target's filters.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd3cc06e2b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Resolution: disable one of the overlapping targets, or set a distinct path with `skillshare target <name> --path <dir>`. | ||
|
|
||
| When the targets sharing a path have different `include` or `exclude` filters, each sync adds what one target wants and prunes what another filters out, so the folder never settles and `sync` keeps showing the same pending changes. Doctor marks these and suggests turning skills off for all but one target (`universal` when it is one of them) instead of removing a target: | ||
| When the targets sharing a path have different `include` or `exclude` filters, `mode`, or `target_naming` (none of these matter in `symlink` mode, which links the whole folder), each sync redoes the folder the way one target wants and undoes the other's work, so the folder never settles and `sync` keeps showing the same pending changes. Doctor marks these and suggests turning skills off for all but one target (`universal` when it is one of them) instead of removing a target: |
There was a problem hiding this comment.
Limit the symlink exemption to per-skill settings
When one target uses symlink and the other uses merge or copy, their mode difference still produces a conflict: sameSkillsSettings compares the effective modes before applying the symlink exemption. The fresh evidence after the prior documentation fix is this new all-inclusive parenthetical, which says that mode also does not matter and may lead users to disregard a warning; clarify here and in the mirrored sync, troubleshooting, and localized pages that only filters and target naming are irrelevant when both targets use symlink mode.
AGENTS.md reference: AGENTS.md:L15-L15
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 697af5c. The doctor, sync and troubleshooting pages and their ko/ja/zh-Hant/zh-Hans copies now say filters and naming don't matter when both targets use symlink mode, so a symlink target next to a merge or copy one still reads as a conflict. Docs-only; docs-check passes.
Codex review on #499: the conflict pages said "none of these matter in symlink mode", which reads as if a symlink target and a merge or copy target on one folder were fine too. Mode still conflicts there; only filters and naming stop mattering when both targets use symlink.
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Two targets that sync skills into one folder with different
target_namingormodeundo each other on every sync, but only include/exclude differences counted as a conflict, sosyncanddoctorshowed the generic shared-path hint instead of the "each sync undoes the other" warning.sameSkillsSettings(internal/config/path_overlap.go) now also compares the effective mode and target naming, so an unset value equals the default it resolves to and isn't reported.SkillsFolderConflictstakes it from its three callers (sync hint, doctor, dashboard sync/diff).symlinkmode never conflict: symlink links the whole folder to the source and reads neither target naming nor include/exclude. This also stops the existing false warning for symlink targets that differ only in filters (from Codex review, then widened in a /simplify pass).Dashboard
skillsSharedWith, built from the same folder normalisation as the conflict check, so the UI doesn't re-implement it.This PR carries
Release-As: 0.25.4(in eabe5fb), so the next release is 0.25.4.Type
proposals/only — see CONTRIBUTING.md)Linked Issue
Closes #498
Checklist
make check) — for code changesVerification
/simplifyand a two-axis code review (standards, spec) on the branch; fixes are in 8a24ff9, no open findings.internal/config/path_overlap_test.go(naming differs, mode differs, unset vs explicit default) failed before the fix and pass after.make checkpasses in the devcontainer image.SyncPage.test.tsx.pnpm build; screenshots checked against the approved design (Clean light).