Skip to content

fix: Display an error toast upon loading a bad plugins (TUI warnings only)#169

Open
ariane-emory wants to merge 12 commits intodevfrom
fix/bad-plugin-errors
Open

fix: Display an error toast upon loading a bad plugins (TUI warnings only)#169
ariane-emory wants to merge 12 commits intodevfrom
fix/bad-plugin-errors

Conversation

@ariane-emory
Copy link
Owner

@ariane-emory ariane-emory commented Feb 13, 2026

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 does not account for the desktop version.

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
@ariane-emory ariane-emory changed the title Fix/bad plugin errors fix: Display an error toast upon loading a bad plugins Feb 14, 2026
@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 (TUI warnings only) 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