Skip to content

fix(buzz-agent): follow symlinks when discovering skill directories#1295

Merged
wpfleger96 merged 2 commits into
mainfrom
paul/symlink-skill-discovery
Jun 25, 2026
Merged

fix(buzz-agent): follow symlinks when discovering skill directories#1295
wpfleger96 merged 2 commits into
mainfrom
paul/symlink-skill-discovery

Conversation

@wpfleger96

Copy link
Copy Markdown
Collaborator

Problem

scan_skill_dir uses DirEntry::file_type() to check whether an entry is a directory. On Unix, file_type() returns FileType::Symlink for symlink entries — is_dir() returns false even when the symlink target is a directory. This silently dropped every symlinked skill directory from discovery.

ai-rules installs its skills as symlinks under ~/.agents/skills/ (e.g. ~/.agents/skills/handoff -> ...ai_rules/config/skills/handoff). All 15 of those skills were invisible to the agent because of this filter.

Fix

Replace DirEntry::file_type() with std::fs::metadata(path) in two places:

  • scan_skill_dir — the top-level filter that decides which entries in a skills dir are skill subdirectories
  • collect_supporting_files_impl — the recursive walker that collects non-SKILL.md files within a skill directory

std::fs::metadata() follows symlinks, so both real directories and symlinked directories pass the is_dir() check.

Test

Adds symlinked_skill_dir_is_discovered to hints_integration.rs: creates a real skill directory, symlinks it into .agents/skills/, and asserts the skill name appears in the system prompt.

npub1fgdl5qqnh3k3f2xkqrvt7cujalhm623x4s7fdjdj5yrtp5fzjl9qrjpucw and others added 2 commits June 25, 2026 16:07
DirEntry::file_type() returns FileType::Symlink for symlink entries —
is_dir() returns false even when the symlink target is a directory.
This silently dropped all symlinked skill dirs from discovery, which
is how ai-rules installs its skills (symlinks under ~/.agents/skills/).

Replace the file_type() calls in scan_skill_dir and
collect_supporting_files_impl with std::fs::metadata() which follows
symlinks, so both real directories and symlinked directories are
included.

Adds a regression test: symlinked_skill_dir_is_discovered.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
cargo fmt expanded the metadata filter closure to multi-line (line
length exceeded rustfmt's limit). Gate the symlinked_skill_dir_is_discovered
integration test with #[cfg(unix)] — std::os::unix::fs::symlink does
not exist on Windows, causing a compile error in the Windows Clippy shard.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
@wpfleger96 wpfleger96 merged commit 8717ddf into main Jun 25, 2026
29 checks passed
@wpfleger96 wpfleger96 deleted the paul/symlink-skill-discovery branch June 25, 2026 20:44
tellaho pushed a commit that referenced this pull request Jun 25, 2026
…ebar

* origin/main:
  fix(sidebar): non-selectable channel names + copy/leave context menu actions (#1260)
  fix(runtime): sweep node wrapper processes hosting managed agent shims (#1296)
  fix(buzz-agent): follow symlinks when discovering skill directories (#1295)
  chore: add grab-emoji.sh to register Slack emoji in Buzz (#1292)
  Fix cross-pod membership notification fanout (#1291)
  fix(buzz-acp): strengthen agent communication rules in base prompt (#1293)
  chore(release): release Buzz Desktop version 0.3.34 (#1289)
  feat(desktop): refresh Agents tab live on inbound relay sync (#1256)
  fix(buzz-acp): inject Codex network allowlist for relay hostname at spawn time (#1287)

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>

# Conflicts:
#	desktop/src-tauri/src/commands/agent_models.rs
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