Skip to content

file path globs aren't properly parsed in the config instructions field #11317

@elliotsegler

Description

@elliotsegler

Description

When specifying instructions files (to be merged with agent instructions), if you use glob patterns like ** the files are silently dropped from being loaded.

When debugging on a dev instance, you notice that the Bun Glob is uses path.basename(instruction) as the matching pattern, and sets the cwd to path.dirname(instruction).

For paths like my/path/**/*.md the path.basename would be *.md which is the unwanted pattern (i.e a subset of what the user wants) and the dirname would be my/path/** which is always invalid.

Plugins

none

OpenCode version

v1.1.43

Steps to reproduce

Create an opencode config with something like the following

{
  "$schema": "https://opencode.ai/config.json",
  "instructions": ["~/.config/opencode/rules/**/*.md"],
}

Create some instructions at ~/.config/opencode/rules/general-guidelines.md and ~/.config/opencode/rules/test/other-guidelines.md

Start an agent session and ask it to tell you about it's rules (or intercept the payload to the LLM)

tell me about the rules/instructions you must follow and where you recieved those instructions from

The agent will repeat back instructions from the system prompt and any AGENTS.md or CLAUDE.md if you have one and have claude compatibility enabled. The instructions from the files with the globs will be missing.

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwindows

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions