Clarify SearchDepth scope in fsskills documentation#497
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes an inconsistency in agent/skills/fsskills where the configured SourceOptions.SearchDepth was honored for within-skill file scanning but not for skill-directory discovery, which was previously hardcoded to defaultSearchDepth (2). The change threads the configured depth into the directory-discovery walk so both recursive traversals are depth-bounded consistently.
Changes:
- Pass
s.searchDepthintodiscoverSkillDirectories/searchForSkillsso skill-directory discovery honorsSearchDepth. - Update
SourceOptions.SearchDepthdocumentation to reflect that it now governs both discovery of skill directories and scanning files within a skill. - Add a regression test proving deeper skill directories are discovered only when
SearchDepthis increased.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| agent/skills/fsskills/source.go | Threads configured search depth into skill-directory discovery and updates the SearchDepth doc comment accordingly. |
| agent/skills/fsskills/source_test.go | Adds a test asserting that skill-directory discovery respects SearchDepth (default vs. increased depth). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks for identifying and documenting this behavior. After comparing it with the .NET SDK, the current Go behavior is intentional. Skill-directory discovery is bounded independently at two levels, while Making Could you repurpose this PR to update the Go documentation so the intended scope of |
SearchDepth controls only resource and script discovery within an already-discovered skill directory; skill-directory discovery (locating SKILL.md directories) is bounded independently and intentionally, matching the .NET SDK. This was not obvious from the option's documentation. Document the intended scope on SourceOptions.SearchDepth and on searchForSkills, and add a test asserting that SearchDepth does not widen skill-directory discovery. No behavior change.
b565867 to
d742800
Compare
|
Thanks for the clarification and the .NET comparison — that makes sense. I've repurposed this PR to a documentation-only change: it now documents that |
…depth-directory-discovery
Summary
Following review, this PR is repurposed from a behavior change to a documentation clarification.
SearchDepthcontrols only resource and script discovery within an already-discovered skill directory. Skill-directory discovery (locatingSKILL.mddirectories) is bounded independently and intentionally, matching the .NET SDK. That scope was not explicit in the option's documentation, which is what led to the original misread.Change
SourceOptions.SearchDepthand onsearchForSkills.TestFileSource_SearchDepth_DoesNotAffectSkillDirectoryDiscovery, which asserts that a largeSearchDepthdoes not widen skill-directory discovery — locking in the intended contract.No behavior change; the functional code is identical to
main.Verification
go test -race -shuffle=on ./agent/skills/...— passinggo vet,gofmt,gofumpt— clean