GeezerVison is showing github.com — Withdrawn · Issue #65128 · anomalyco/opencode
Activity
opencodejr commented on Nov 20, 2026
Thanks for the detailed request! In short, you'd like the permission.evaluate hook for external_directory checks to receive the ID of the individual (nested Code Mode) tool call next to the outer execute ID, plus the exact resolved target path or paths. That way a plugin can scope a directory decision without guessing from event order.
What I found in the code matches what you saw:
- The
external_directory check uses the target's directory glob (<dir>/*) as its resource, not the file path. Targets in the same directory are merged into one check, so your a.txt and b.txt reads produce the same resource.
- The hook's input (
PermissionEvaluation) has resources, metadata and source. None of these carries a nested call's own ID or the resolved file paths.
- fix(core): give each Code Mode call its own ID #64324 gave each Code Mode call its own ID but kept permission requests on the
execute call's ID. It lists this as a known limit: a plugin sees the inner ID in tool.execute.before and the execute ID in permission.evaluate.
Because of this, it can't be done in a plugin today; it needs a small addition to the plugin API, such as the call's own ID in source next to the parent ID, and the resolved targets in the check's metadata. Maintainers will consider it.
Related issues and PRs:
changed the title
[-][FEATURE]: Expose nested tool calls and resolved targets in `external_directory` permission hooks[/-] [+]Withdrawn[/+] on Nov 20, 2026
Metadata
Metadata
Development
No branches or pull requestsIssue actions