You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Directory plugins load in filesystem order, and one plugin's hook error silently skips the rest #45367
Two related problems in how directory plugins are loaded:
Glob.scan in packages/opencode/src/config/plugin.ts returns plugin/*.ts in filesystem order, so plugin/00_base.ts and plugin/10_override.ts can initialize in either order — and that order can differ between two machines with the same checkout. Anything order-dependent (one plugin registering a default another overrides) becomes a coin flip.
In packages/opencode/src/plugin/index.ts, trigger() runs each plugin's hook via Effect.promise, so the first hook that throws aborts the loop and every later plugin's hook for that trigger is skipped, silently. One broken plugin disables the others for accumulating hooks like chat.params / chat.headers.
Blocking hooks (tool.execute.before, permission.ask, command.execute.before) are a deliberate exception — a throw there is how a plugin denies the action, so those should keep propagating on first throw.
Steps to reproduce
Put two plugins in plugin/, both implementing chat.params
Make the first one throw
The second plugin's hook never runs, and nothing is logged
Expected
Deterministic (sorted) load order, and a throwing non-blocking hook logged and skipped without taking the other plugins down with it.
Activity
github-actions commentedon Aug 26, 2026
This issue might be a duplicate of (or closely related to) existing issues. Please check:
Plugin.triggerusesEffect.promiseinplugin/index.tswith no error isolation, so a misbehaving hook silently disrupts other hooks. That issue focuses on hung/stalled hooks; Directory plugins load in filesystem order, and one plugin's hook error silently skips the rest #45367 focuses on throwing hooks — same code path, same fix area.yanglinfang commentedon Sep 2, 2026
Closing — recent opencode versions work well enough for our local-model setup that this isn't worth pursuing. Withdrawing the associated PR too.