[PR #7042] fix: restore skill filtering by agent permissions #12220

Closed
opened 2026-02-16 18:17:08 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/7042

State: closed
Merged: Yes


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

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7042 **State:** closed **Merged:** Yes --- ## 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: ```yaml 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
yindo added the pull-request label 2026-02-16 18:17:08 -05:00
yindo closed this issue 2026-02-16 18:17:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12220