Plugin system fixes#4679
Merged
Merged
Conversation
Plugins that consist of a .csproj with NuGet package references but no source files are a valid pattern (e.g. wrapper plugins). The previous check rejected these because it required at least one .cs file.
A failed load was blocking subsequent retry attempts when DLLs appeared shortly after the directory was created (e.g. during plugin installation).
Previously, deleting a failed plugin's directory left a stale entry in _failedPlugins because GetPluginIdByDirectory only checks _knownPlugins. Now fires PluginUnloaded so the UI updates accordingly.
Without this, the plugin settings view never re-rendered after a failed load because no event was fired to trigger UsePluginState().
Ensures PluginLoadFailed fires on all genuine load failures so the UI updates. Removes redundant LogPluginLoadFailure, centralizes logging in RecordFailure, and avoids firing the event when the write lock is held.
Previously, deleting a plugin directory would unload it but leave it in _knownPlugins, causing it to appear as "Unloaded" with no way to reload.
… system Fired when a plugin directory is deleted (whether it was loaded, unloaded, or failed). Ensures the UI removes it from all lists without needing a restart.
….yaml Same fix as directory deletion — unloading alone leaves the plugin in _knownPlugins, showing it as "Unloaded" with no way to reload.
Previously, exceptions thrown during Configure (e.g. missing dependency DLLs) would propagate unhandled without recording the failure or firing PluginLoadFailed, leaving the plugin invisible in the UI.
…er startup When enabled, UsePlugins skips the synchronous DiscoverAndLoad during setup and instead loads all plugins in a background task after the server is ready. This significantly improves startup time when source plugins need to be built. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nager test helper
…utes
Plugins can now register endpoints under /ivy/plugins/{slug}/ via a
dedicated API instead of requiring raw UseWebApplication access. Endpoints
are backed by a dynamic data source so they're added/removed with the
plugin lifecycle. Also moves the plugin icon asset route to
/ivy/plugin-icons/ to avoid path collisions with plugin endpoints.
…erface These APIs expose too much of the ASP.NET pipeline to plugins. Plugins should use UseEndpoints for HTTP routes instead. The methods remain on Server for internal first-party use (DesktopWindow, DocsServer).
- Fix whitespace in PluginContext.cs (missing indentation on field and method) - Fix indentation on goto label in PluginLoader.cs - Add 'when' exception filters to exclude OutOfMemoryException and StackOverflowException from plugin isolation catches, satisfying CodeQL cs/generic-catch-clause rule Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Suppress CP0006 (new interface member on IIvyExtendedPluginContext.UseEndpoints) and CP0002 (removed UseWebApplication/UseWebApplicationBuilder from PluginContextBase). Context interfaces are safe to extend per project conventions — plugins call into them, not implement them. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
System.Linq is already included via ImplicitUsings, so the explicit using directive triggers IDE0005 in CI's dotnet format check. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PluginLoadFailed and PluginRemoved are new members on IPluginManager, which is a host-provided interface not implemented by plugins, so this is not a breaking change for deployed plugins. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ention The File icon kind added complexity (route handler, validation, path traversal protection) with zero adopters. Icons for available plugins will now flow through a tendril.json file in the .nupkg, supporting only Named and Url kinds.
Fixes IDE0005 format check failure in CI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
zachwolfe
marked this pull request as ready for review
July 18, 2026 23:04
Collaborator
Staging removedStaging environment has been deleted for this PR. |
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.
Summary