Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix: allow an empty Agent tools selection (#39695)
Jony89ceba027ecb
diff --git a/api/core/plugin/entities/parameters.py b/api/core/plugin/entities/parameters.pyindex 4c0abe4ed4a..b0f0c6e98e1 100644--- a/api/core/plugin/entities/parameters.py+++ b/api/core/plugin/entities/parameters.py@@ -202,7 +202,10 @@ def init_frontend_parameter(rule: PluginParameter, type: StrEnum, value: Any):init frontend parameter by rule"""parameter_value = value- if not parameter_value and parameter_value != 0:+ is_empty_tools_selection = (+ type == PluginParameterType.TOOLS_SELECTOR and isinstance(parameter_value, list) and not parameter_value+ )+ if not is_empty_tools_selection and not parameter_value and parameter_value != 0:# get default valueparameter_value = rule.defaultif not parameter_value and rule.required:diff --git a/api/tests/unit_tests/core/agent/strategy/test_plugin.py b/api/tests/unit_tests/core/agent/strategy/test_plugin.pyindex 15c441e5876..55d4ffcb263 100644--- a/api/tests/unit_tests/core/agent/strategy/test_plugin.py+++ b/api/tests/unit_tests/core/agent/strategy/test_plugin.py@@ -5,7 +5,9 @@ from unittest.mock import MagicMockimport pytestfrom pytest_mock import MockerFixture+from core.agent.plugin_entities import AgentStrategyParameterfrom core.agent.strategy.plugin import PluginAgentStrategy+from core.tools.entities.common_entities import I18nObject# ============================================================# Fixtures@@ -103,6 +105,17 @@ class TestInitializeParameters:mock_declaration.parameters[0].init_frontend_parameter.assert_called_once_with("value1")mock_declaration.parameters[1].init_frontend_parameter.assert_called_once_with(None)+ def test_initialize_parameters_allows_empty_tools_selection(self, strategy: PluginAgentStrategy) -> None:+ tools_parameter = AgentStrategyParameter(+ name="tools",+ label=I18nObject(en_US="Tools"),+ required=True,+ type=AgentStrategyParameter.AgentStrategyParameterType.TOOLS_SELECTOR,+ )+ strategy.declaration.parameters = [tools_parameter]++ assert strategy.initialize_parameters({"tools": []}) == {"tools": []}+@pytest.mark.parametrize("input_params",[diff --git a/api/tests/unit_tests/core/plugin/test_plugin_entities.py b/api/tests/unit_tests/core/plugin/test_plugin_entities.pyindex 0a532646abb..acc0d0be6fa 100644--- a/api/tests/unit_tests/core/plugin/test_plugin_entities.py+++ b/api/tests/unit_tests/core/plugin/test_plugin_entities.py@@ -265,6 +265,11 @@ class TestPluginParameterEntities:with pytest.raises(ValueError, match="not found in tool config"):init_frontend_parameter(required_rule, PluginParameterType.STRING, None)+ tools_rule = PluginParameter(name="tools", label=self._label(), required=True, default=None)+ assert init_frontend_parameter(tools_rule, PluginParameterType.TOOLS_SELECTOR, []) == []+ with pytest.raises(ValueError, match="not found in tool config"):+ init_frontend_parameter(tools_rule, PluginParameterType.TOOLS_SELECTOR, None)+class TestPluginDaemonEntities:def test_credential_type_helpers(self):