fix(opencode): update skill handling in context and permissions#29738
Open
OpeOginni wants to merge 1 commit into
Open
fix(opencode): update skill handling in context and permissions#29738OpeOginni wants to merge 1 commit into
OpeOginni wants to merge 1 commit into
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.
Issue for this PR
Closes #29727
Closes #21793
Type of change
What does this PR do?
Filter
/skillslist by permissions: Theapp.skillsHTTP endpoint now callsskill.available(defaultAgent)instead ofskill.all(), so the/skillsslash command only shows skills the current agent is allowed to use.Hide the
skilltool when globally disabled:ToolRegistry.tools()now checksPermission.disabled(["skill"], ...)and excludes theskilltool entirely whenskill: "deny"orskill: { "*": "deny" }is configured, preventing the model from seeing or calling it.Check permission before loading skill content: In the
skilltool executor,ctx.ask()now runs beforeskill.require(). This ensures the permission gate is evaluated before reading the skill from the in-memory store.How did you verify your code works?
Now the skill doesnt show up in the registry, the model doesnt have knowledge of the skill from initial prompt, even when forced to use that skill, it gets denyed use of the skill.
Screenshots / recordings
Checklist
One caveat: The /skills HTTP endpoint uses the default agent, not the currently active session agent, because the endpoint is instance-level and doesn't receive agent/session context. So if you switch to a subagent with stricter skill permissions, the /skills dialog might still show skills allowed for the default agent. But when that subagent actually runs, its own permissions will filter the tool description and block execution.