fix(core): skip node_modules when discovering markdown agents (#62571)

This commit is contained in:
Dan Smolsky
2026-11-07 07:12:11 -05:00
committed by GitHub
Unverified
parent 478de99765
commit 6a89e9f287
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -135,7 +135,7 @@ function expandHome(resource: string, home: string) {
function discover(fs: FSUtil.Interface, directory: string) {
return Effect.forEach(legacySources, (source) =>
fs
.scan(source.pattern, { cwd: directory, absolute: true, dot: true, symlink: true })
.scan(source.pattern, { cwd: directory, absolute: true, dot: true, symlink: true, ignore: FSUtil.ignoreGlobs })
.pipe(
Effect.map((files) => files.toSorted().map((filepath) => ({ directory, filepath, primary: source.primary }))),
),
+6
View File
@@ -442,6 +442,11 @@ permissions:
yield* Effect.promise(async () => {
await fs.mkdir(path.join(tmp.path, "agents", "team"), { recursive: true })
await fs.mkdir(path.join(tmp.path, "modes"), { recursive: true })
await fs.mkdir(path.join(tmp.path, "agents", ".opencode", "node_modules", "probe"), { recursive: true })
await fs.writeFile(
path.join(tmp.path, "agents", ".opencode", "node_modules", "probe", "README.md"),
"# Dependency README",
)
await fs.writeFile(
path.join(tmp.path, "agents", "reviewer.md"),
`---
@@ -509,6 +514,7 @@ Use native v2 fields.`,
expect(themed?.color).toBeUndefined()
expect(yield* agents.get(Agent.ID.make("disabled"))).toBeUndefined()
expect(yield* agents.get(Agent.ID.make("empty"))).toBeUndefined()
expect(yield* agents.get(Agent.ID.make(".opencode/node_modules/probe/README"))).toBeUndefined()
expect(yield* agents.get(Agent.ID.make("plan"))).toMatchObject({ system: "Make a plan.", mode: "primary" })
}),
),