Merge pull request #520 from tnfssc/sharath/suna-280-make-sure-agent-continues-on-wrong-parse-add-a-result

This commit is contained in:
Sharath 2025-05-27 02:22:08 +05:30 committed by GitHub
commit 59f8f80c7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 14 deletions

View File

@ -253,10 +253,10 @@ class SandboxShellTool(SandboxToolsBase):
],
example='''
<!-- Example 1: Check output without killing session -->
<check-command-output session_name="dev_server"/>
<check-command-output session_name="dev_server"></check-command-output>
<!-- Example 2: Check final output and kill session -->
<check-command-output session_name="build_process" kill_session="true"/>
<check-command-output session_name="build_process" kill_session="true"></check-command-output>
'''
)
async def check_command_output(
@ -317,7 +317,7 @@ class SandboxShellTool(SandboxToolsBase):
],
example='''
<!-- Example: Terminate a running server -->
<terminate-command session_name="dev_server"/>
<terminate-command session_name="dev_server"></terminate-command>
'''
)
async def terminate_command(
@ -359,7 +359,7 @@ class SandboxShellTool(SandboxToolsBase):
mappings=[],
example='''
<!-- Example: List all running commands -->
<list-commands/>
<list-commands></list-commands>
'''
)
async def list_commands(self) -> ToolResult:

View File

@ -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)