opencode
opencode copied to clipboard
fix: restore skill filtering by agent permissions
Summary
Restores the ability to filter skills based on agent permission rules, which was broken after the permission system overhaul in PR #6319.
- Pass
agenttoToolRegistry.tools()when building the tool registry - Filter skills using
PermissionNext.evaluate()before generating the skill tool description - Only show skills that are not explicitly denied by the agent's permission rules
Example Usage
Agents can now control which skills are visible via frontmatter:
permission:
read: allow
skill:
"*": deny
"code-review": allow
"skill-creator": allow
This will only show code-review and skill-creator in that agent's available skills.
Changes
-
packages/opencode/src/session/prompt.ts: Pass agent toToolRegistry.tools() -
packages/opencode/src/tool/skill.ts: Filter skills usingPermissionNext.evaluate()
Closes #6857