Skip to content

Self-improving AI Employees for everyone

test(params): align fixtures + file_handler plugin with snake_case schema

trohitge5eeb95584a0
diff --git a/server/nodes/text/file_handler.py b/server/nodes/text/file_handler.py
index e9e783e8..1907e508 100644
--- a/server/nodes/text/file_handler.py
+++ b/server/nodes/text/file_handler.py
@@ -48,8 +48,6 @@ class FileHandlerNode(ActionNode):
type = "fileHandler"
display_name = "File Handler"
subtitle = "Wrap Content Metadata"
- icon = "lucide:Folder"
- color = "#bd93f9"
group = ("text",)
description = "Wrap text content with file-type / file-name metadata"
component_kind = "square"
@@ -68,17 +66,14 @@ class FileHandlerNode(ActionNode):
from core.container import container
text_service = container.text_service()
- # TextService.execute_file_handler uses camelCase keys by
- # historical contract (the result dict it emits is served to
- # the frontend with camelCase field names too). Translate our
- # snake_case Params to the service's expected shape.
+ # Pass schema-canonical snake_case through to the service. The
+ # service's *output* dict still carries camelCase keys
+ # (`fileName` / `fileType`) by historical wire contract -- the
+ # frontend reads them that way -- but parameters in are now
+ # snake_case end-to-end.
response = await text_service.execute_file_handler(
ctx.node_id,
- {
- "fileType": params.file_type,
- "fileName": params.file_name,
- "content": params.content,
- },
+ params.model_dump(),
)
if response.get("success"):
return response.get("result") or response
diff --git a/server/tests/nodes/test_ai_agents.py b/server/tests/nodes/test_ai_agents.py
index 8f2cdf1b..1b212ac6 100644
--- a/server/tests/nodes/test_ai_agents.py
+++ b/server/tests/nodes/test_ai_agents.py
@@ -74,7 +74,7 @@ class TestAIAgent:
async def test_memory_connection_forwarded_with_auto_session(self, harness):
"""simpleMemory wired to input-memory -> memory_data forwarded.
- When the memory node's sessionId is empty, the session falls back to
+ When the memory node's session_id is empty, the session falls back to
the agent's own node_id (documented auto-derivation).
"""
agent_id = "agent-1"
@@ -82,11 +82,11 @@ class TestAIAgent:
harness.database.get_node_parameters = AsyncMock(
return_value={
- "sessionId": "", # triggers auto-derivation
- "windowSize": 7,
- "memoryContent": "# Conversation History\n\n### **Human** (t)\nhi\n",
- "longTermEnabled": True,
- "retrievalCount": 5,
+ "session_id": "", # triggers auto-derivation
+ "window_size": 7,
+ "memory_content": "# Conversation History\n\n### **Human** (t)\nhi\n",
+ "long_term_enabled": True,
+ "retrieval_count": 5,
}
)
@@ -116,7 +116,7 @@ class TestAIAgent:
agent_id = "agent-x"
mem_id = "mem-x"
harness.database.get_node_parameters = AsyncMock(
- return_value={"sessionId": "shared-session", "windowSize": 3, "memoryContent": ""}
+ return_value={"session_id": "shared-session", "window_size": 3, "memory_content": ""}
)
nodes = [_node(agent_id, "aiAgent"), _node(mem_id, "simpleMemory")]
@@ -136,7 +136,7 @@ class TestAIAgent:
tool_id = "calc-1"
harness.database.get_node_parameters = AsyncMock(
- return_value={"toolName": "calculator"}
+ return_value={"tool_name": "calculator"}
)
nodes = [_node(agent_id, "aiAgent"), _node(tool_id, "calculatorTool", "Calc")]
@@ -167,7 +167,7 @@ class TestAIAgent:
harness.database.get_node_parameters = AsyncMock(
return_value={
- "skillsConfig": {
+ "skills_config": {
"python-skill": {"enabled": True, "instructions": "Use python."},
"shell-skill": {"enabled": False, "instructions": "ignored"},
}
diff --git a/server/tests/nodes/test_ai_tools.py b/server/tests/nodes/test_ai_tools.py
index 43ec0b35..04ce4f17 100644
--- a/server/tests/nodes/test_ai_tools.py
+++ b/server/tests/nodes/test_ai_tools.py
@@ -183,7 +183,7 @@ class TestDuckDuckGoSearch:
with patch.dict("sys.modules", {"ddgs": fake_module}):
result = await tools_mod._execute_duckduckgo_search(
{"query": "python"},
- {"provider": "duckduckgo", "maxResults": 2},
+ {"provider": "duckduckgo", "max_results": 2},
)
assert result["query"] == "python"
@@ -211,7 +211,7 @@ class TestDuckDuckGoSearch:
with patch.dict("sys.modules", {"ddgs": fake_module}):
result = await tools_mod._execute_duckduckgo_search(
{"query": "q"},
- {"maxResults": 5},
+ {"max_results": 5},
)
assert result["results"] == [{"title": "only-title", "snippet": "", "url": ""}]