Add SupportsPlugins() capability detection and validation for agentic engines#14516
Add SupportsPlugins() capability detection and validation for agentic engines#14516
Conversation
- Added SupportsPlugins() to CapabilityProvider interface - Added supportsPlugins field to BaseEngine struct - Implemented SupportsPlugins() method in BaseEngine - Updated CopilotEngine to set supportsPlugins: true - Other engines (Claude, Codex, Custom) default to false - Added tests to verify only Copilot supports plugins Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot if the engine does not support a plugin, show error when trying to use plugin |
- Added validatePluginSupport() function in engine_validation.go - Validates plugins are only used with engines that support them - Currently only copilot engine supports plugins - Shows clear error message with actionable fixes when unsupported - Added comprehensive test coverage for validation - Integrated validation in compiler_orchestrator_tools.go Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added validation in commit 1b58416. When plugins are specified with an engine that doesn't support them (currently only copilot supports plugins), the compiler now shows a clear error message: The validation prevents compilation and lists all plugins that cannot be installed, making it clear to users what needs to be fixed. |
There was a problem hiding this comment.
Pull request overview
Adds an explicit engine capability flag for plugin installation and enforces it during workflow compilation so plugins can’t be used with engines that don’t support installing them.
Changes:
- Extended engine capability detection with
SupportsPlugins()and added a default implementation onBaseEngine. - Added compile-time validation to reject workflows that specify
pluginswith engines that reportSupportsPlugins() == false. - Added unit tests for plugin-support validation and engine capability detection; updated docs table entry.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/engine_validation_test.go | Adds tests covering plugin-support validation behavior and error message content. |
| pkg/workflow/engine_validation.go | Introduces validatePluginSupport() to fail compilation when plugins are used with unsupported engines. |
| pkg/workflow/copilot_engine_test.go | Adds assertions that Copilot supports plugins and other engines do not. |
| pkg/workflow/copilot_engine.go | Marks Copilot engine as supportsPlugins: true. |
| pkg/workflow/compiler_orchestrator_tools.go | Runs plugin-support validation during tools/markdown processing. |
| pkg/workflow/agentic_engine.go | Extends CapabilityProvider + BaseEngine with SupportsPlugins() capability plumbing. |
| docs/src/content/docs/agent-factory-status.mdx | Adds “Dependabot Burner” to the agent-factory status table. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Build error message listing the plugins that were specified | ||
| pluginsList := strings.Join(pluginInfo.Plugins, ", ") | ||
|
|
||
| return fmt.Errorf("engine '%s' does not support plugins. The following plugins cannot be installed: %s\n\nOnly the 'copilot' engine currently supports plugin installation.\n\nTo fix this, either:\n1. Remove the 'plugins' field from your workflow\n2. Change to an engine that supports plugins (e.g., engine: copilot)\n\nSee: %s", |
There was a problem hiding this comment.
validatePluginSupport currently hard-codes that only the 'copilot' engine supports plugin installation and returns an error for any other engine with plugins. This conflicts with the existing behavior where Claude and Codex engines still generate plugin installation steps (e.g., in their GetInstallationSteps implementations), and there are tests/workflows that compile plugins with those engines. Please align the codebase in one direction: either (a) mark Claude/Codex as SupportsPlugins=true and update the error message to list supported engines dynamically, or (b) remove/disable plugin-install step generation (and related tests/docs) for Claude/Codex so validation matches actual support.
| return fmt.Errorf("engine '%s' does not support plugins. The following plugins cannot be installed: %s\n\nOnly the 'copilot' engine currently supports plugin installation.\n\nTo fix this, either:\n1. Remove the 'plugins' field from your workflow\n2. Change to an engine that supports plugins (e.g., engine: copilot)\n\nSee: %s", | |
| return fmt.Errorf("engine '%s' does not support plugins. The following plugins cannot be installed: %s\n\nTo fix this, either:\n1. Remove the 'plugins' field from your workflow\n2. Change to an engine that supports plugins (see the documentation for supported engines)\n\nSee: %s", |
| func TestOtherEnginesNoPluginSupport(t *testing.T) { | ||
| // Test that only Copilot engine supports plugins | ||
| engines := []CodingAgentEngine{ | ||
| NewClaudeEngine(), | ||
| NewCodexEngine(), | ||
| NewCustomEngine(), | ||
| } | ||
|
|
||
| for _, engine := range engines { | ||
| if engine.SupportsPlugins() { | ||
| t.Errorf("Expected engine '%s' to not support plugins, but it does", engine.GetID()) | ||
| } | ||
| } |
There was a problem hiding this comment.
This new test codifies that Claude/Codex/Custom engines do not support plugins, but other parts of the workflow package currently generate plugin installation steps for Claude and Codex. If plugins are truly Copilot-only, those engine implementations (and any tests expecting plugin installs for them) should be updated/removed; otherwise this test should be updated to reflect actual supported engines.
| { | ||
| name: "plugins with claude engine (not supported)", | ||
| pluginInfo: &PluginInfo{ | ||
| Plugins: []string{"org/plugin1"}, | ||
| }, | ||
| engineID: "claude", | ||
| expectError: true, | ||
| errorMsg: "does not support plugins", | ||
| }, | ||
| { | ||
| name: "plugins with codex engine (not supported)", | ||
| pluginInfo: &PluginInfo{ | ||
| Plugins: []string{"org/plugin1", "org/plugin2"}, | ||
| }, | ||
| engineID: "codex", | ||
| expectError: true, | ||
| errorMsg: "does not support plugins", | ||
| }, | ||
| { | ||
| name: "plugins with custom engine (not supported)", | ||
| pluginInfo: &PluginInfo{ | ||
| Plugins: []string{"org/plugin1"}, | ||
| }, | ||
| engineID: "custom", | ||
| expectError: true, | ||
| errorMsg: "does not support plugins", | ||
| }, |
There was a problem hiding this comment.
These tests assume plugins are only supported for the 'copilot' engine. That assumption currently conflicts with existing plugin compilation/import tests and engine installation logic that include 'claude plugin install' / 'codex plugin install' steps. Please reconcile: either update SupportsPlugins defaults for those engines and adjust validation/tests, or remove non-copilot plugin installation support everywhere so this validation behavior is consistent.
| // SupportsFirewall returns true if this engine supports network firewalling/sandboxing | ||
| // When true, the engine can enforce network restrictions defined in the workflow | ||
| SupportsFirewall() bool | ||
|
|
||
| // SupportsPlugins returns true if this engine supports plugin installation | ||
| // When true, plugins can be installed using the engine's plugin install command | ||
| SupportsPlugins() bool |
There was a problem hiding this comment.
The interface hierarchy comment block above lists CapabilityProvider methods but doesn't mention SupportsPlugins, even though it is now part of the interface. Please update that documentation list to keep the file-level architecture docs accurate.
Plugin installation is engine-specific and not universally supported. Currently only Copilot CLI supports the
plugin installcommand.Changes
SupportsPlugins() booltoCapabilityProviderinterfacesupportsPluginsfield toBaseEnginewith getter methodsupportsPlugins: truefor Copilot engine only (Claude, Codex, Custom default tofalse)validatePluginSupport()function that prevents compilation when plugins are specified with engines that don't support themUsage
Validation Example
When plugins are specified with an unsupported engine, compilation fails with:
The implementation follows the existing Interface Segregation Principle pattern used for other capabilities (
SupportsFirewall,SupportsHTTPTransport, etc.).Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.