mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-07 16:17:25 +03:00
fix(core): skip node_modules when discovering markdown agents (#62571)
This commit is contained in:
committed by
GitHub
Unverified
parent
478de99765
commit
6a89e9f287
@@ -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 }))),
|
||||
),
|
||||
|
||||
@@ -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" })
|
||||
}),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user