Skip to content

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

Merged
rekram1-node merged 7 commits intodevfrom
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 intodevfrom
add-dynamic-agents-resolving

Conversation

@rekram1-node
Copy link
Collaborator

No description provided.

@rekram1-node
Copy link
Collaborator Author

/review

@github-actions
Copy link
Contributor

lgtm

@rekram1-node
Copy link
Collaborator Author

/review

@github-actions
Copy link
Contributor

lgtm

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

xHeaven commented Jan 28, 2026

@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

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