anomalyco / anomalyco/opencode
Plugin load failures are published to the event bus but never logged
@kitlangton is already working on this.
Since Sep 4, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
publishPluginError in packages/opencode/src/plugin/index.ts is the only sink for the four loadExternal failure stages (install, entry, compatibility, load): it publishes a Session.Event.Error and never touches the logger. Under ACP nothing consumes that event — Subscription.handle in packages/opencode/src/acp/event.ts has no session.error case — so a failed plugin leaves no trace anywhere. opencode exits 0 and serves the session with a reduced tool set.
It is the lone exception in its own function: applyPlugin twenty lines below, internal plugins, config hooks and dispose hooks all report through Effect.logError.
This cost us two sessions answering with all twelve of their Mattermost tools missing, against a production log with zero matches for Failed to install plugin\|Failed to load plugin\|skipped:.
Ask: log spec, stage and message alongside the event publish. Happy to send a PR.
Related: #42379 (open) adds a stderr write; #44367 is the same silence on Desktop; #46587 covers the missing() no-op.
OpenCode version
1.18.25
Steps to reproduce
- Add any npm/git plugin spec to
opencode.jsoncand clear the plugin cache. - Make the install fail:
unshare -r -n opencode acp. - The plugin's tools are absent, exit code is 0, and the log says nothing. The same failure in the TUI does surface an error.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.