Repository navigation
Follow symlinked project skills that stay inside the repository - #3857
Closed
bjorn-supernomic wants to merge 1 commit into
Closed
bjorn-supernomic wants to merge 1 commit into
bjorn-supernomic wants to merge 1 commit into
Conversation
A project skill root refused every symlinked entry, so a checked-in catalog of links (.claude/skills/x -> ../../.agents/skills/x) produced no project skills for that provider while Claude Code loaded the same links. Apply the boundary that roots already honour to entries: a linked skill directory or SKILL.md is followed when its real path stays inside the workspace, and a link out of the repository stays hidden. Fixes get-bb#3856 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Contributor
|
Thanks @bjorn-supernomic for the PR. This repo needs approval before a PR. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ) and explain what you want to open a PR for and why. A maintainer then adds you to the allow list. This PR now closes on its own. Reopen it or open a new one after approval. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
canFollowSkillSymlinkinapps/host-daemon/src/command-discovery.tsreturned true only for user-origin roots, so the flat project skill scan refused every symlinked entry: a checked-in catalog of links such as.claude/skills/nerd -> ../../.agents/skills/nerdyielded zeroprovider-projectskills for Claude Code and Pi, while Codex still listed them through the real directories it also scans. Nothing was logged. Project roots already carry aboundaryPaththat the recursive shape enforces for a linked root, anddocs/provider-plugin-api.mdstates that containment rule, but entries under a root never got the same treatment. Issue: #3856.What changed
apps/host-daemon/src/command-discovery.ts:canFollowSkillSymlinknow takes the link path. User roots keep their unconditional follow. A project root follows a linked skill directory orSKILL.mdonly when its real path stays inside the root'sboundaryPath(workspace for a plain root, repository root for an ancestor-walking or resolved root). A root without a boundary, or a link that escapes it, is still refused. Thelinkedflag on discovered records is unchanged.docs/provider-plugin-api.md: one clause beside the existing root rule so the entry-level rule is documented.HOST_DAEMON_PROTOCOL_VERSIONis untouched. The commands walker (walkMarkdownTree, Project slash commands are invisible when .claude/commands/*.md are symlinks #2602) and the~/.bb/skillsscanner (bb skill list ignores symlinked skills (root symlink and per-skill symlink both invisible, no warning) #3238) are separate code paths and are not changed here.How you verified
command-discovery.test.ts: a relative directory link and aSKILL.mdfile link inside the workspace are both discovered withorigin: "project". It fails on the parent commit (expected undefined to deeply equal { name: 'nerd', … }) and passes here. The existing "does not follow project-origin symlinked skill directories or skill files" test, whose targets live outside the workspace, still passes, as does the user-origin test.pnpm exec vitest run src/command-discovery.test.tsinapps/host-daemon: 27 passed.pnpm exec turbo run typecheck --filter=@bb/host-daemon: passed.pnpm exec oxfmt --checkon the two changed source files: clean.provider-project/codex: 106,provider-project/claude-code: 0,provider-project/pi: 0inbb skill list --jsonon bb 0.43.1, whileclaude -p --output-format stream-json --verbosein the same checkout advertised every linked skill inslash_commands.Fixes #3856
🤖 Generated with Claude Code