Skip to content

fix: Display an error toast upon loading a bad plugins (with desktop warnings)#171

Open
ariane-emory wants to merge 11 commits intodevfrom
fix/bad-plugin-errors-with-desktop
Open

fix: Display an error toast upon loading a bad plugins (with desktop warnings)#171
ariane-emory wants to merge 11 commits intodevfrom
fix/bad-plugin-errors-with-desktop

Conversation

@ariane-emory
Copy link
Owner

What does this PR do?

Upon loading a bad plugin (for instance a plugin that contains syntax errors or a plugin path that doesn't exist) instead of hanging indefinitely with a blank screen, OpenCode will load successfully but will display an error toast indicating what plugins failed to load and why.

NOTE: This variant includes warnings in the desktop version as well.

Resolves anomalyco#13461.

How did you verify your code works?

Manual A/B testing, bun typecheck, bun test.

When a plugin file has a syntax error (e.g., unterminated string literal),
catch the build error and display it to the user via the Session.Event.Error
bus instead of crashing with a black screen.

Fixes anomalyco#13461
Add ResolveMessage error handling to formatPluginBuildError() to display
a clear 'File not found' error when a plugin path doesn't exist.

Previously, missing plugin files would fail silently. Now the error is
published to the Session.Event.Error bus and shown to the user.
- Add startupErrors array to store plugin load errors
- Add /config/startup-errors endpoint to retrieve stored errors
- Update TUI to fetch and display startup errors via toast
- Regenerate TypeScript SDK with new endpoint

Errors that occur during plugin loading are now stored and displayed
to the user when the TUI finishes loading, fixing the issue where
plugin errors were silently ignored due to event timing.
When multiple plugins fail to load, show a single toast with all errors
instead of showing each error separately (which would only display the last
one since toasts replace each other).

- Single error: shows error message directly
- Multiple errors: shows 'Plugin Errors' title with combined messages
Add startupErrors endpoint call to bootstrapDirectory to fetch and display
plugin loading errors that occurred before the event stream connected.

Shows a toast with all plugin errors, using pluralized title and
appropriate duration based on error count.
@ariane-emory ariane-emory changed the title fix: Display an error toast upon loading a bad plugins fix: Display an error toast upon loading a bad plugins (with desktop warnings) Feb 14, 2026
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.

Plugin syntax/build errors cause black screen with no user-facing error message

1 participant