pi-mono/packages/coding-agent/src
Aliou Diallo a9a1a62b14
fix(coding-agent): prevent global AGENTS.md from being loaded twice (#239)
When cwd is `~/.pi/agent/` or a subdirectory, the global AGENTS.md file
was included twice in the system prompt.

`loadProjectContextFiles()` loads context files in two steps:
1. Explicitly loads from `getAgentDir()` (`~/.pi/agent/`)
2. Walks from cwd up to root, collecting all AGENTS.md/CLAUDE.md files

There was no deduplication. When cwd is at or below `~/.pi/agent/`, the
ancestor walk includes that directory again.

Fix: track seen paths with a Set and skip duplicates.
2025-12-19 15:24:49 +01:00
..
cli fix(coding-agent): detect image MIME via file-type (#205) 2025-12-17 17:11:56 +01:00
core fix(coding-agent): prevent global AGENTS.md from being loaded twice (#239) 2025-12-19 15:24:49 +01:00
modes Refactor subagent tool, fix custom tool discovery, fix JSON mode stdout flush 2025-12-19 04:54:02 +01:00
utils fix(coding-agent): detect image MIME via file-type (#205) 2025-12-17 17:11:56 +01:00
cli.ts Remove old implementation files (main.ts, cli.ts, tui-renderer.ts), rename new files 2025-12-09 01:21:28 +01:00
config.ts Add hooks system with pi.send() for external message injection 2025-12-10 00:50:30 +01:00
index.ts Forward onUpdate callback through hook wrapper (#238) 2025-12-19 15:23:41 +01:00
main.ts Refactor subagent tool, fix custom tool discovery, fix JSON mode stdout flush 2025-12-19 04:54:02 +01:00