[PR #13753] fix(read): skip external directory prompt for global AGENTS.md #14802

Open
opened 2026-02-16 18:19:33 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13753

State: open
Merged: No


What does this PR do?

Fixes #13751 by skipping external_directory permission prompts when the target file is already part of InstructionPrompt.systemPaths() (for example ~/.config/opencode/AGENTS.md).

This keeps regular external directory protection for unrelated paths, but avoids interrupting instruction-loading flows for OpenCode-owned/global instruction files that are already trusted as system instructions.

I also added a regression test in test/tool/read.test.ts to verify that reading global AGENTS.md does not request external_directory permission.

How did you verify your code works?

  • Ran focused regression test:
    • bun test test/tool/read.test.ts -t "global AGENTS.md" (from packages/opencode)
  • Push hook typecheck also passed during git push (bun turbo typecheck).
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13753 **State:** open **Merged:** No --- ### What does this PR do? Fixes #13751 by skipping `external_directory` permission prompts when the target file is already part of `InstructionPrompt.systemPaths()` (for example `~/.config/opencode/AGENTS.md`). This keeps regular external directory protection for unrelated paths, but avoids interrupting instruction-loading flows for OpenCode-owned/global instruction files that are already trusted as system instructions. I also added a regression test in `test/tool/read.test.ts` to verify that reading global `AGENTS.md` does not request `external_directory` permission. ### How did you verify your code works? - Ran focused regression test: - `bun test test/tool/read.test.ts -t "global AGENTS.md"` (from `packages/opencode`) - Push hook typecheck also passed during `git push` (`bun turbo typecheck`).
yindo added the pull-request label 2026-02-16 18:19:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14802