{{ message }}
fix(core): allow reads of permitted skill resources - #47554
Open
kitlangton wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why
Loading an installed skill succeeds, but reading a supporting file from that skill can immediately stop for an unrelated external-directory approval. This happens with discovered skill directories outside the project, including a symlinked
~/.opencode/skilldirectory: skill loading checks the skill ID, while the subsequentreadchecks the filesystem boundary independently.What Changes
The read tool recognizes supporting paths beneath registered directory-based
SKILL.mdskills whose skill permission evaluates toallow. It supplies an allowance for that read's external-directory assertion, then applies the ordinary read permission.references/policy.mdreadorexternal_directorydenial.envfileaskordenyPermission flow
The allowance lasts for one
Permission.assertcall. Configured denials are checked first, and permission evaluation hooks still run. This overrides anexternal_directory: askdecision for the recognized read, but does not save an approval or grant subsequent edit/shell access to that directory.Demo
skill-resource-before-after.mp4
Before:
cd504dc66a. After:e63c147ac3. The same OpenCode Drive 2.1.0 fixture loads a skill from a symlinked external source, then invokes the real read tool on its supporting policy. Only the provider responses are simulated. The before run records anexternal_directoryrequest from the reference read; the after run records none. Both runs verify the real tool's returned file content (the before request is approved only after its recording checkpoint).Matched four-second checkpoints, sequentially presented at native 1000×640 resolution to keep terminal text legible. No acceleration.
Scope
This fixes read access to registered directory-skill resources without adding global directory rules or persisted permissions. It follows the existing lexical path policy; symlink canonicalization and skill-activation history are outside this change.
Verification
From
packages/core:external_directoryrequest before the fix..envread approval, unrelated paths, and non-persistence of the read allowance.git diff --checkpassed. Scoped oxlint reported no errors (existing warnings only).