Skip to content

fix: log plugin load failures to stderr - #42379

Open
YoannDev90 wants to merge 2 commits into
anomalyco:devfrom
YoannDev90:fix/plugin-load-error-logging
Open

fix: log plugin load failures to stderr#42379
YoannDev90 wants to merge 2 commits into
anomalyco:devfrom
YoannDev90:fix/plugin-load-error-logging

Conversation

@YoannDev90

@YoannDev90 YoannDev90 commented Aug 13, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #41817

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Plugin load errors are only published as a Session.Event.Error in publishPluginError (packages/opencode/src/plugin/index.ts). The desktop renderer does not consume that event, so a plugin that fails to load in the desktop app is invisible: the entry appears in the plugin list, nothing is logged, and no tools register. Example: plugins importing bun:sqlite on the Node plugin host (see #41817).

Change: publishPluginError also writes the message to stderr, which the desktop sidecar pipes into the server log, so failures are diagnosable.

The bun:sqlite shim itself is tracked separately in #41817.

How did you verify your code works?

The change is a one-line addition to the existing error path, using the Node process.stderr API; the existing event publish is untouched.

Screenshots / recordings

N/A (no UI change).

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Plugin load errors are only published as a Session.Event.Error, which
the desktop renderer does not consume. Desktop users saw plugin entries
in the list without any indication that loading failed (e.g. plugins
importing "bun:sqlite" on the Node host). Write the error to stderr so
it lands in the server log.

Addresses anomalyco#41817
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Aug 13, 2026
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Aug 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop app silently fails to load plugins that import "bun:sqlite"

1 participant