fix: log plugin load failures to stderr - #42379
Open
YoannDev90 wants to merge 2 commits into
Open
Conversation
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
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #41817
Type of change
What does this PR do?
Plugin load errors are only published as a
Session.Event.ErrorinpublishPluginError(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 importingbun:sqliteon the Node plugin host (see #41817).Change:
publishPluginErroralso writes the message to stderr, which the desktop sidecar pipes into the server log, so failures are diagnosable.The
bun:sqliteshim 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.stderrAPI; the existing event publish is untouched.Screenshots / recordings
N/A (no UI change).
Checklist