fix bug of abnormal exit for BrowserUseTool

This commit is contained in:
liangxinbing 2025-03-12 20:25:37 +08:00
parent e6e31a2c13
commit 74a4c8bef0

View File

@ -1,3 +1,5 @@
from typing import Any
from pydantic import Field from pydantic import Field
from app.agent.toolcall import ToolCallAgent from app.agent.toolcall import ToolCallAgent
@ -34,3 +36,7 @@ class Manus(ToolCallAgent):
) )
max_steps: int = 20 max_steps: int = 20
async def _handle_special_tool(self, name: str, result: Any, **kwargs):
await self.available_tools.get_tool(BrowserUseTool().name).cleanup()
await super()._handle_special_tool(name, result, **kwargs)