anomalyco / anomalyco/opencode

Plugin load failures are published to the event bus but never logged

Open
#47,200 0 comments 0 reactions 1 assignee View on GitHub

@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
  1. Add any npm/git plugin spec to opencode.jsonc and clear the plugin cache.
  2. Make the install fail: unshare -r -n opencode acp.
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.