fix(models): exclude skill dirs from agent discovery#16
Open
ricardoalt1515 wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds configurable directory-skipping to agent discovery (notably to ignore .agents/skills) and introduces tests to validate discovery behavior with nested directories.
Changes:
- Add
AgentDiscoveryOptions.skipDirectoryNamesand thread it through sync/async recursive discovery. - Update discoverable agent listing to skip
skillsdirectories under.agents. - Add Node test coverage for skipping
.agents/skillswhile still scanning other subdirectories.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| tests/gentle-ai.test.ts | Adds tests that validate agent discovery behavior when skipping skills directories. |
| extensions/gentle-ai.ts | Introduces discovery options, applies them to recursive traversal, and exports testing hooks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| test("agent discovery can skip .agents skills directories", () => { | ||
| const root = join(tmpdir(), `gentle-pi-agents-${Date.now()}`); |
Comment on lines
+55
to
+56
| test("agent discovery still scans non-skill subdirectories", () => { | ||
| const root = join(tmpdir(), `gentle-pi-nested-agents-${Date.now()}`); |
| join(cwd, ".pi", "npm", "node_modules", "pi-subagents", "agents"), | ||
| join(homedir(), ".local", "lib", "node_modules", "pi-subagents", "agents"), | ||
| ]; | ||
| const dotAgentsOptions = { skipDirectoryNames: ["skills"] }; |
| [join(homedir(), ".agents"), "user"], | ||
| [join(cwd, ".agents"), "project"], | ||
| [join(cwd, ".pi", "agents"), "project"], | ||
| const dotAgentsOptions = { skipDirectoryNames: ["skills"] }; |
Comment on lines
+519
to
+522
| async function listAgentFilesRecursiveAsync( | ||
| dir: string, | ||
| options: AgentDiscoveryOptions = {}, | ||
| ): Promise<string[]> { |
Comment on lines
+1258
to
+1261
| export const __testing = { | ||
| listAgentsFromDir, | ||
| listAgentFilesRecursive, | ||
| }; |
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.
Fixes #15
Summary
skillssubdirectories while discovering model-routable agents from.agentsroots.SKILL.mdand reference markdown files under.agents/skills.Test plan
node --experimental-strip-types --test tests/gentle-ai.test.tsnode --experimental-strip-types --test tests/*.test.tsnpm run test:harnessNote: I used direct Node/npm commands locally because
pnpmis not installed in my shell. CI still uses the repository'spnpmworkflow.