fix: log plugin load failures to stderr - #41818
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
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
The following comment was made by an LLM, it may be inaccurate: Potentially Related PR Found:
However, PR #37411 is about publishing the event (which PR #41818 already does), not about logging to stderr for visibility in desktop logs. The current PR (41818) is a different approach focused on stderr logging. Conclusion: No true duplicate PRs found. PR #37411 is related but addresses a different aspect (TUI event publishing vs. desktop stderr logging). |
|
Hmm will fix the PR tomorrow |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
|
2 hour ... |
Problem
Plugin load errors are only published as a
Session.Event.Error(publishPluginErrorinpackages/opencode/src/plugin/index.ts). The desktop renderer does not consume that event, so in the desktop app a plugin that fails to load is invisible — the entry appears in the plugin list, but no error is shown or logged anywhere.Concrete case (see #41817): a plugin importing
bun:sqliteon the Node plugin host fails to import, and there is zero trace of why inserver.log/renderer.log/main.log/opencode.log.Change
publishPluginError, so it lands in the server log (the sidecar pipes stderr to the desktop server log).Notes
bun:sqliteplugins load; that gap is tracked in Desktop app silently fails to load plugins that import "bun:sqlite" #41817.Fix #41817