tool dedup

This commit is contained in:
Shannon Sands 2026-02-02 15:28:10 +10:00
parent 8dccd6569e
commit 4939130485
18 changed files with 376 additions and 4288 deletions

View file

@ -11,7 +11,6 @@ from __future__ import annotations
from typing import Optional
from .base import Tool, ToolResult, ToolSchema
from .basic_tools import BashTool
class TerminalStatefulTool(Tool):
@ -39,7 +38,8 @@ class TerminalStatefulTool(Tool):
return True, None
async def execute(self, command: str, timeout: Optional[int] = None) -> ToolResult:
# Fallback direct execution (not stateful) when used outside ToolExecutor.
bash = BashTool(timeout=float(timeout) if timeout else 30.0)
return await bash.execute(command=command)
_ = (command, timeout)
return ToolResult(
success=False,
error="terminal_stateful must be executed via ToolExecutor inside the sandbox",
)