Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
fix(social): name Social Send's agent tool social_send
trohitg1194705f45d2
diff --git a/server/nodes/social/social_send/__init__.py b/server/nodes/social/social_send/__init__.pyindex 4cd9f0d2..48738578 100644--- a/server/nodes/social/social_send/__init__.py+++ b/server/nodes/social/social_send/__init__.py@@ -395,6 +395,17 @@ class SocialSendNode(ActionNode):annotations = {"destructive": False, "readonly": False, "open_world": True}task_queue = TaskQueue.MESSAGINGusable_as_tool = True+ # Named here because ``component_kind = "agent"`` (chosen for the card+ # layout) otherwise derives the delegation identity+ # ``delegate_to_socialSend``. The agent loop treats every+ # ``delegate_to_*`` call as a delegation that needs a ``task`` argument,+ # so it rejected the model's send arguments on every call.+ tool_name = "social_send"+ tool_description = (+ "Send a message on a connected chat platform (WhatsApp, Telegram, "+ "Discord, Slack, email and others) to a phone number, group, "+ "channel, user or chat."+ )Params = SocialSendParamsOutput = SocialSendOutputdiff --git a/server/tests/fixtures/tool_names_snapshot.json b/server/tests/fixtures/tool_names_snapshot.jsonindex ffb82350..8ecc924b 100644--- a/server/tests/fixtures/tool_names_snapshot.json+++ b/server/tests/fixtures/tool_names_snapshot.json@@ -80,6 +80,7 @@"twitterSend": "twitter_send","twitterSearch": "twitter_search","twitterUser": "twitter_user",+ "socialSend": "social_send","httpRequest": "http_request","msMail": "ms_mail","msCalendar": "ms_calendar",diff --git a/server/tests/test_tool_registry.py b/server/tests/test_tool_registry.pyindex c19a68d0..5a2ec6e7 100644--- a/server/tests/test_tool_registry.py+++ b/server/tests/test_tool_registry.py@@ -106,3 +106,31 @@ def test_tool_name_snapshot(node_type: str, expected_tool_name: str):f"If this rename is intentional, update "f"server/tests/fixtures/tool_names_snapshot.json in the same commit.")+++def test_no_tool_takes_a_delegation_name_unless_it_is_a_delegate():+ """A node usable as a tool carries a ``delegate_to_*`` name only when it+ is a delegation target.++ ``BaseNode`` derives ``delegate_to_<type>`` for every+ ``component_kind="agent"`` class, and the agent loop treats every+ ``delegate_to_*`` call as a delegation that needs a ``task`` argument.+ ``socialSend`` borrows the agent card for its layout and took that+ name, so every send the model made through it was rejected.+ """+ from services.node_registry import get_node_class, registered_node_types+ from services.workspace_capabilities import is_registered_agent++ offenders = sorted(+ node_type+ for node_type in registered_node_types()+ if (cls := get_node_class(node_type)) is not None+ and getattr(cls, "usable_as_tool", False)+ and (getattr(cls, "tool_name", "") or "").startswith("delegate_to_")+ and not is_registered_agent(node_type)+ )+ assert not offenders, (+ f"{offenders} are usable as tools but are named delegate_to_*, so the "+ f"agent loop handles their calls as delegations. Declare tool_name "+ f"and tool_description on the class."+ )