Skip to content

Plugin config() hook mutations to skills.paths invisible to skill discovery #20940

@sjawhar

Description

@sjawhar

Description

Plugins that register skill directories via their config() hook are invisible to skill discovery. For example, the superpowers plugin adds its skills directory to config.skills.paths inside config(), but Skill.all() never finds them.

Expected Behavior

Skills registered by plugins via config.skills.paths mutation in the config() hook should appear in Skill.all() and be available to agents.

Actual Behavior

Skills registered by plugin config() hooks are not discovered. Only skills from static config (opencode.json) or standard directories (~/.config/opencode/skills/) are found.

Verified: setting skills.paths directly in opencode.json works (65 skills). Plugin config() hook mutation does not (51 skills).

Root Cause

Each service's makeRuntime creates a separate InstanceState scope backed by ScopedCache. When Plugin calls config.get() and a plugin's config() hook mutates cfg.skills.paths, that mutation only affects Plugin's scoped copy. When Skill independently calls config.get(), it gets a separate copy — the mutation is invisible.

Same class of bug as #20026 (plugin providers disappearing after instance dispose).

Steps to reproduce

  1. Install a plugin that registers skills via config() hook (e.g. superpowers@git+https://github.com/obra/superpowers.git#v5.0.7)
  2. Start OpenCode
  3. List available skills — plugin-registered skills are missing

Plugins

superpowers@git+https://github.com/obra/superpowers.git#v5.0.7

OpenCode version

1.3.13

Operating System

Linux (Ubuntu)

Terminal

N/A

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions