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

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?

Could not run the desktop build locally (no Node/pnpm toolchain in the environment). 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

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