UAT: No per-plugin configuration file support — PluginDescriptor and PluginManager lack per-plugin config loading #5716

Open
opened 2026-04-09 08:47:40 +00:00 by HAL9000 · 0 comments
Owner

Bug Report

Feature Area: Plugin Architecture — Plugin Configuration
Priority: Backlog (non-critical for MVP, but needed for production plugin ecosystem)

What Was Tested

Analyzed src/cleveragents/infrastructure/plugins/types.py, src/cleveragents/infrastructure/plugins/manager.py, and src/cleveragents/config/settings.py for per-plugin configuration support.

Expected Behavior (from spec)

The spec (§Extensibility, §Custom Index Backends) shows that custom implementations are configured via config.toml with per-component sections:

[index.text]
backend = "custom"
custom_module = "my_extensions.elasticsearch_backend"
custom_class = "ElasticsearchTextIndex"

[index.text.custom_options]
hosts = ["http://localhost:9200"]
index_prefix = "cleveragents"

This pattern implies that each plugin should be able to receive its own configuration section. The PluginManager.register_from_config() method accepts a custom_options dict, but there is no mechanism for plugins to declare their configuration schema or for the system to load per-plugin config files.

Actual Behavior

The plugin system has no per-plugin configuration support:

  1. No plugin config schema declaration: PluginDescriptor has no field for declaring what configuration keys a plugin accepts.
  2. No per-plugin config file loading: There is no ~/.config/cleveragents/plugins/<name>.toml or similar per-plugin config file mechanism.
  3. No config validation: The custom_options dict in register_from_config() is passed as-is with no schema validation.
  4. No config injection: When a plugin is activated via activate_plugin(), no configuration is passed to the plugin instance.
# manager.py — activate_plugin() creates instance with no-arg constructor:
instance = cls()  # ← No config passed to plugin

Code Location

  • src/cleveragents/infrastructure/plugins/types.pyPluginDescriptor (no config schema field)
  • src/cleveragents/infrastructure/plugins/manager.pyactivate_plugin() (line 255: instance = cls())
  • src/cleveragents/infrastructure/plugins/manager.pyregister_from_config() (lines 315–367)
  • src/cleveragents/config/settings.py — no [plugins] section

Impact

Plugin authors cannot:

  1. Declare what configuration their plugin requires
  2. Receive configuration at activation time
  3. Use per-plugin config files for sensitive settings (API keys, endpoints)
  4. Validate configuration before plugin activation

Steps to Reproduce

  1. Inspect PluginDescriptor — no config_schema field
  2. Inspect activate_plugin()instance = cls() with no config
  3. Check settings.py — no [plugins] section

Suggested Fix

  1. Add config_schema field to PluginDescriptor:
config_schema: dict[str, Any] = Field(
    default_factory=dict,
    description="JSON Schema for plugin configuration"
)
  1. Modify activate_plugin() to pass config to plugin:
config = self._load_plugin_config(name)
instance = cls(config=config) if config else cls()
  1. Add [plugins.<name>] section support to config.toml loading.

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Bug Report **Feature Area**: Plugin Architecture — Plugin Configuration **Priority**: Backlog (non-critical for MVP, but needed for production plugin ecosystem) ### What Was Tested Analyzed `src/cleveragents/infrastructure/plugins/types.py`, `src/cleveragents/infrastructure/plugins/manager.py`, and `src/cleveragents/config/settings.py` for per-plugin configuration support. ### Expected Behavior (from spec) The spec (§Extensibility, §Custom Index Backends) shows that custom implementations are configured via `config.toml` with per-component sections: ```toml [index.text] backend = "custom" custom_module = "my_extensions.elasticsearch_backend" custom_class = "ElasticsearchTextIndex" [index.text.custom_options] hosts = ["http://localhost:9200"] index_prefix = "cleveragents" ``` This pattern implies that each plugin should be able to receive its own configuration section. The `PluginManager.register_from_config()` method accepts a `custom_options` dict, but there is no mechanism for plugins to declare their configuration schema or for the system to load per-plugin config files. ### Actual Behavior The plugin system has no per-plugin configuration support: 1. **No plugin config schema declaration**: `PluginDescriptor` has no field for declaring what configuration keys a plugin accepts. 2. **No per-plugin config file loading**: There is no `~/.config/cleveragents/plugins/<name>.toml` or similar per-plugin config file mechanism. 3. **No config validation**: The `custom_options` dict in `register_from_config()` is passed as-is with no schema validation. 4. **No config injection**: When a plugin is activated via `activate_plugin()`, no configuration is passed to the plugin instance. ```python # manager.py — activate_plugin() creates instance with no-arg constructor: instance = cls() # ← No config passed to plugin ``` ### Code Location - `src/cleveragents/infrastructure/plugins/types.py` — `PluginDescriptor` (no config schema field) - `src/cleveragents/infrastructure/plugins/manager.py` — `activate_plugin()` (line 255: `instance = cls()`) - `src/cleveragents/infrastructure/plugins/manager.py` — `register_from_config()` (lines 315–367) - `src/cleveragents/config/settings.py` — no `[plugins]` section ### Impact Plugin authors cannot: 1. Declare what configuration their plugin requires 2. Receive configuration at activation time 3. Use per-plugin config files for sensitive settings (API keys, endpoints) 4. Validate configuration before plugin activation ### Steps to Reproduce 1. Inspect `PluginDescriptor` — no `config_schema` field 2. Inspect `activate_plugin()` — `instance = cls()` with no config 3. Check `settings.py` — no `[plugins]` section ### Suggested Fix 1. Add `config_schema` field to `PluginDescriptor`: ```python config_schema: dict[str, Any] = Field( default_factory=dict, description="JSON Schema for plugin configuration" ) ``` 2. Modify `activate_plugin()` to pass config to plugin: ```python config = self._load_plugin_config(name) instance = cls(config=config) if config else cls() ``` 3. Add `[plugins.<name>]` section support to `config.toml` loading. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#5716
No description provided.