Skip to content

fix: log plugin load failures to stderr - #41818

Closed
YoannDev90 wants to merge 1 commit into
anomalyco:devfrom
YoannDev90:fix/plugin-load-error-logging
Closed

fix: log plugin load failures to stderr#41818
YoannDev90 wants to merge 1 commit into
anomalyco:devfrom
YoannDev90:fix/plugin-load-error-logging

Conversation

@YoannDev90

@YoannDev90 YoannDev90 commented Aug 11, 2026

Copy link
Copy Markdown

Problem

Plugin load errors are only published as a Session.Event.Error (publishPluginError in packages/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:sqlite on the Node plugin host fails to import, and there is zero trace of why in server.log / renderer.log / main.log / opencode.log.

Change

  • Write the plugin error to stderr in publishPluginError, so it lands in the server log (the sidecar pipes stderr to the desktop server log).

Notes

Fix #41817

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

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Aug 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

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.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potentially Related PR Found:

  • PR fix(tui): publish session event when custom tool import fails #37411: fix(tui): publish session event when custom tool import fails - This is related in that it addresses error visibility for tool/plugin failures, though it's TUI-specific. However, it shows a pattern of handling import failures via Session.Event.Error, which is exactly what the current PR is addressing more broadly.

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).

@YoannDev90

Copy link
Copy Markdown
Author

Hmm will fix the PR tomorrow

@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Aug 11, 2026
@github-actions github-actions Bot closed this Aug 11, 2026
@YoannDev90

Copy link
Copy Markdown
Author

2 hour ...

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