Skip to content

fix(desktop): create skill links on Windows - #4027

Open
sumit-m wants to merge 1 commit into
block:mainfrom
sumit-m:windows-skill-links
Open

fix(desktop): create skill links on Windows#4027
sumit-m wants to merge 1 commit into
block:mainfrom
sumit-m:windows-skill-links

Conversation

@sumit-m

@sumit-m sumit-m commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Problem

ensure_skill_symlinks is a no-op on non-Unix. The canonical skill is written to
.agents/skills/buzz-cli/SKILL.md, but nothing links to it, so on Windows the
harness skill directories are never created:

$ ls ~/.buzz-dev/.agents/skills/buzz-cli/SKILL.md
SKILL.md                                  <- written
$ ls ~/.buzz-dev/.claude/skills
No such file or directory                 <- never created
$ ls ~/.buzz-dev/.goose/skills
No such file or directory

nest_skill.md is the document that teaches an agent the CLI it uses to publish
every reply. On Windows no agent has ever loaded it.

Fix

ensure_skill_symlinks becomes platform-neutral and uses create_dir_link,
which tries symlink_dir and falls back to a junction — neither Developer Mode
nor elevation required. A new skill_link_target picks the target form:
relative on Unix, absolute on Windows, because junctions store only absolute
targets.

Unix behaviour is unchanged by construction — create_dir_link on Unix is the
same std::os::unix::fs::symlink the previous code called, and the relative
target string is pinned by a test.

A second hole in the same area

refresh_skill_md_if_stale removes the old real .claude/skills/buzz-cli
directory on every platform but re-created the link only under #[cfg(unix)].
On Windows a NEST_SKILL_VERSION bump would have deleted the directory and left
nothing behind. Made platform-neutral in the same commit.

Tests

The three skill-link tests were #[cfg(unix)], so the platform that was broken
had no coverage. They now run everywhere:

  • relative-target assertion stays Unix-only; a new test asserts the absolute
    target on Windows
  • the dangling-link test creates its link and then deletes the target — a
    junction cannot be created against a target that does not exist

Also removes three dead-code warnings that only appeared on Windows
(known_skill_dirs import and function, runtime_metadata::skill_dir).

Notes for review

Overlap with #3547. create_dir_link and remove_dir_link are identical to
the versions in that PR, which has not merged. They are carried here so this
branch compiles standalone. Happy to rebase onto whichever lands first.

Reproducing on Windows needs the dev-tooling PRs. just dev cannot run off
main on Windows — the Tauri beforeDevCommand is exec ./node_modules/.bin/vite
and cmd.exe has no exec (#3534). Verification here ran on main plus #3534,
#3546, #3545 and #3540, with this commit's diff confirmed untouched by that
merge. The fix itself depends on none of them.

Verification

On Windows 11, Developer Mode off, non-elevated process:

  • deleted all three existing links, booted, all three came back as
    LinkType=Junction resolving to .agents/skills/buzz-cli/SKILL.md
  • an agent asked to list its skills named buzz-cli; ~/.claude/skills is empty
    on that box, so the nest link is the only possible source
  • desktop lib suite: 1946 passed, 1 pre-existing unrelated failure

@sumit-m
sumit-m requested a review from a team as a code owner July 31, 2026 23:00
@sumit-m
sumit-m force-pushed the windows-skill-links branch from beff0df to d3e0397 Compare July 31, 2026 23:28
ensure_skill_symlinks was a no-op there, so no agent ever loaded the
buzz-cli skill. Junctions need absolute targets, unlike the Unix relative
symlink, and need neither elevation nor Developer Mode.

Signed-off-by: sumit-m <33051892+sumit-m@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant