fix(plugins): expose skill-only packages

This commit is contained in:
Xubin Ren
2026-08-11 12:47:58 +09:00
parent 3198567cef
commit 393e5dbe09
2 changed files with 4 additions and 2 deletions
+1 -2
View File
@@ -962,7 +962,7 @@ def mcp_presets_payload(
plugin_rows = [ plugin_rows = [
_agent_plugin_payload(state) _agent_plugin_payload(state)
for state in discover_agent_plugin_states(config.workspace_path) for state in discover_agent_plugin_states(config.workspace_path)
if state.mcp_servers and f"plugin-{state.plugin.name}" not in existing_names if f"plugin-{state.plugin.name}" not in existing_names
] ]
payload: dict[str, Any] = { payload: dict[str, Any] = {
"presets": [*preset_rows, *custom_rows, *plugin_rows], "presets": [*preset_rows, *custom_rows, *plugin_rows],
@@ -1587,7 +1587,6 @@ async def mcp_presets_settings_action(
if ( if (
name not in plugin_config.tools.mcp_servers name not in plugin_config.tools.mcp_servers
and plugin_state is not None and plugin_state is not None
and plugin_state.mcp_servers
): ):
if action not in {"enable", "disable"}: if action not in {"enable", "disable"}:
raise McpPresetError("Agent Plugins support enable and disable actions only") raise McpPresetError("Agent Plugins support enable and disable actions only")
+3
View File
@@ -150,6 +150,9 @@ def test_agent_plugin_reuses_mcp_catalog_and_runtime_action(
with pytest.raises(McpPresetError, match="enable and disable"): with pytest.raises(McpPresetError, match="enable and disable"):
asyncio.run(plugin_action("remove")) asyncio.run(plugin_action("remove"))
(load_config().workspace_path / "plugins" / "desktop" / "mcp.json").unlink()
assert any(item["name"] == "plugin-desktop" for item in mcp_presets_payload()["presets"])
config_path = tmp_path / "config.json" config_path = tmp_path / "config.json"
config = json.loads(config_path.read_text(encoding="utf-8")) config = json.loads(config_path.read_text(encoding="utf-8"))
config["tools"] = { config["tools"] = {