Skip to content

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

Open
scarf005 wants to merge 2 commits intoanomalyco:devfrom
scarf005:fix/13751/config-dir-permission-prompt
Open

fix(read): skip external directory prompt for global AGENTS.md#13753
scarf005 wants to merge 2 commits intoanomalyco:devfrom
scarf005:fix/13751/config-dir-permission-prompt

Conversation

@scarf005
Copy link
Contributor

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).

@scarf005 scarf005 force-pushed the fix/13751/config-dir-permission-prompt branch from 4b2e20d to 0606c89 Compare March 15, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Permission prompt appears when reading ~/.config/opencode/AGENTS.md

1 participant