Skip to content

feat: dynamically resolve AGENTS.md files from subdirectories as agent explores them#10678

Merged
rekram1-node merged 7 commits into
devfrom
add-dynamic-agents-resolving
Jan 26, 2026
Merged

feat: dynamically resolve AGENTS.md files from subdirectories as agent explores them#10678
rekram1-node merged 7 commits into
devfrom
add-dynamic-agents-resolving

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

No description provided.

@rekram1-node

Copy link
Copy Markdown
Collaborator Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

lgtm

@rekram1-node

Copy link
Copy Markdown
Collaborator Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

lgtm

@rekram1-node rekram1-node merged commit 39a73d4 into dev Jan 26, 2026
5 checks passed
@xHeaven

xHeaven commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

@rekram1-node if an agent reads several files in one go in a directory that has AGENTS.md files, it'll load them multiple times because deduping only considers instructions that were loaded by previous completed tool calls in ctx.messages. If there are multiple read calls in the same assistant step, each read gets the same ctx.messages.
This only happens when the agent goes into directories that it hasn't explored yet.

Visual:

root
├── frontend
│   ├── file1
│   ├── file2
│   ├── file3
│   └── AGENTS.md
├── backend
│   ├── file1
│   ├── file2
│   ├── file3
│   └── AGENTS.md
└── AGENTS.md
User: read 3 files in the backend directory
Agent: sure dude, lemme check

✱ Glob "backend/*" (4 matches)
→ Read backend/file1
↳ Loaded backend/AGENTS.md
→ Read backend/file2
↳ Loaded backend/AGENTS.md
→ Read backend/file3
↳ Loaded backend/AGENTS.md

User: read those files again
Agent: i've done it already but ok

✱ Glob "backend/*" (4 matches)
→ Read backend/file1
→ Read backend/file2
→ Read backend/file3

xenonwellz pushed a commit to xenonwellz/opencode that referenced this pull request Jan 28, 2026
Colin4k1024 pushed a commit to Colin4k1024/opencode that referenced this pull request Feb 10, 2026
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
Rwanbt pushed a commit to Rwanbt/opencode that referenced this pull request May 5, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
avion23 pushed a commit to avion23/opencode that referenced this pull request Jun 10, 2026
Rwanbt pushed a commit to Rwanbt/opencode that referenced this pull request Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants