From 11da6ad8293b46a041508f1fff6a7f2e1f2b3209 Mon Sep 17 00:00:00 2001 From: sharath <29162020+tnfssc@users.noreply.github.com> Date: Mon, 26 May 2025 20:32:49 +0000 Subject: [PATCH] fix(tools): invalid xml issues and unnecessary validation --- backend/agent/tools/sb_shell_tool.py | 8 ++++---- backend/agentpress/response_processor.py | 11 +---------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/backend/agent/tools/sb_shell_tool.py b/backend/agent/tools/sb_shell_tool.py index 8fd82caa..b02ca7c9 100644 --- a/backend/agent/tools/sb_shell_tool.py +++ b/backend/agent/tools/sb_shell_tool.py @@ -253,10 +253,10 @@ class SandboxShellTool(SandboxToolsBase): ], example=''' - + - + ''' ) async def check_command_output( @@ -317,7 +317,7 @@ class SandboxShellTool(SandboxToolsBase): ], example=''' - + ''' ) async def terminate_command( @@ -359,7 +359,7 @@ class SandboxShellTool(SandboxToolsBase): mappings=[], example=''' - + ''' ) async def list_commands(self) -> ToolResult: diff --git a/backend/agentpress/response_processor.py b/backend/agentpress/response_processor.py index 9cbc4dd8..457e20ba 100644 --- a/backend/agentpress/response_processor.py +++ b/backend/agentpress/response_processor.py @@ -1061,16 +1061,7 @@ class ResponseProcessor: logger.error(f"Error processing mapping {mapping}: {e}") self.trace.event(name="error_processing_mapping", level="ERROR", status_message=(f"Error processing mapping {mapping}: {e}")) continue - - # Validate required parameters - missing = [mapping.param_name for mapping in schema.mappings if mapping.required and mapping.param_name not in params] - if missing: - logger.error(f"Missing required parameters: {missing}") - logger.error(f"Current params: {params}") - logger.error(f"XML chunk: {xml_chunk}") - self.trace.event(name="missing_required_parameters", level="ERROR", status_message=(f"Missing required parameters: {missing}"), metadata={"current_params": params, "xml_chunk": xml_chunk}) - return None - + # Create tool call with clear separation between function_name and xml_tag_name tool_call = { "function_name": function_name, # The actual method to call (e.g., create_file)