fix: Display an error toast upon loading a bad plugins (TUI warnings only)#169
Open
ariane-emory wants to merge 12 commits intodevfrom
Open
fix: Display an error toast upon loading a bad plugins (TUI warnings only)#169ariane-emory wants to merge 12 commits intodevfrom
ariane-emory wants to merge 12 commits intodevfrom
Conversation
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
…ode into fix/bad-plugin-errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.