feat: Fix required tools being terminal (#3010)
This commit is contained in:
@@ -141,9 +141,7 @@ class ToolRulesSolver(BaseModel):
|
||||
|
||||
def is_terminal_tool(self, tool_name: str) -> bool:
|
||||
"""Check if the tool is defined as a terminal tool in the terminal tool rules or required-before-exit tool rules."""
|
||||
return any(rule.tool_name == tool_name for rule in self.terminal_tool_rules) or any(
|
||||
rule.tool_name == tool_name for rule in self.required_before_exit_tool_rules
|
||||
)
|
||||
return any(rule.tool_name == tool_name for rule in self.terminal_tool_rules)
|
||||
|
||||
def has_children_tools(self, tool_name):
|
||||
"""Check if the tool has children tools"""
|
||||
|
||||
@@ -967,7 +967,7 @@ async def test_required_tools_called_during_normal_flow(server, disable_e2b_api_
|
||||
tools = [save_data_tool]
|
||||
tool_rules = [
|
||||
InitToolRule(tool_name="save_data"),
|
||||
RequiredBeforeExitToolRule(tool_name="send_message"),
|
||||
RequiredBeforeExitToolRule(tool_name="save_data"),
|
||||
TerminalToolRule(tool_name="send_message"),
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user