opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix: restore skill filtering by agent permissions

Open malhashemi opened this issue 1 week ago • 2 comments

Summary

Restores the ability to filter skills based on agent permission rules, which was broken after the permission system overhaul in PR #6319.

  • Pass agent to ToolRegistry.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 to ToolRegistry.tools()
  • packages/opencode/src/tool/skill.ts: Filter skills using PermissionNext.evaluate()

Closes #6857

malhashemi avatar Jan 06 '26 05:01 malhashemi