Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/prompts/update-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Review these key files for accuracy:

- Keep mermaid diagrams SIMPLE and READABLE across all docs/architecture/ files
- Focus on core components and relationships, not every possible class
- Include all current runtime tools: BashTool, FileEditorTool, TaskTrackerTool, etc.
- Include all current runtime tools: TerminalTool, FileEditorTool, TaskTrackerTool, etc.
- Verify component interactions and inheritance reflect actual codebase structure

#### Tool Documentation
Expand All @@ -56,7 +56,7 @@ Verify documentation across docs/architecture/ files for:
- `LLM`, message types, provider support (docs/architecture/llm.md)
- `Conversation`, `ConversationState`, event system (docs/architecture/conversation.md)
- All built-in tools: `FinishTool`, `ThinkTool`
- All runtime tools: `BashTool`, `FileEditorTool`, `TaskTrackerTool`
- All runtime tools: `TerminalTool`, `FileEditorTool`, `TaskTrackerTool`

### 4. Verification Steps

Expand Down
4 changes: 2 additions & 2 deletions examples/01_standalone_sdk/01_hello_world.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import os

from openhands.sdk import LLM, Agent, Conversation, Tool
from openhands.tools.execute_bash import BashTool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.task_tracker import TaskTrackerTool
from openhands.tools.terminal import TerminalTool


llm = LLM(
Expand All @@ -14,7 +14,7 @@
agent = Agent(
llm=llm,
tools=[
Tool(name=BashTool.name),
Tool(name=TerminalTool.name),
Tool(name=FileEditorTool.name),
Tool(name=TaskTrackerTool.name),
],
Expand Down
12 changes: 6 additions & 6 deletions examples/01_standalone_sdk/02_custom_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
ToolExecutor,
register_tool,
)
from openhands.tools.execute_bash import (
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.terminal import (
BashExecutor,
BashTool,
ExecuteBashAction,
TerminalTool,
)
from openhands.tools.file_editor import FileEditorTool


logger = get_logger(__name__)
Expand Down Expand Up @@ -168,11 +168,11 @@ def create(


def _make_bash_and_grep_tools(conv_state) -> list[ToolDefinition]:
"""Create execute_bash and custom grep tools sharing one executor."""
"""Create terminal and custom grep tools sharing one executor."""

bash_executor = BashExecutor(working_dir=conv_state.workspace.working_dir)
# bash_tool = execute_bash_tool.set_executor(executor=bash_executor)
bash_tool = BashTool.create(conv_state, executor=bash_executor)[0]
# bash_tool = terminal_tool.set_executor(executor=bash_executor)
bash_tool = TerminalTool.create(conv_state, executor=bash_executor)[0]

# Use the GrepTool.create() method with shared bash_executor
grep_tool = GrepTool.create(conv_state, bash_executor=bash_executor)[0]
Expand Down
4 changes: 2 additions & 2 deletions examples/01_standalone_sdk/03_activate_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
Skill,
)
from openhands.sdk.tool import Tool
from openhands.tools.execute_bash import BashTool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.terminal import TerminalTool


logger = get_logger(__name__)
Expand All @@ -38,7 +38,7 @@
cwd = os.getcwd()
tools = [
Tool(
name=BashTool.name,
name=TerminalTool.name,
),
Tool(name=FileEditorTool.name),
]
Expand Down
4 changes: 2 additions & 2 deletions examples/01_standalone_sdk/05_use_llm_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
get_logger,
)
from openhands.sdk.tool import Tool
from openhands.tools.execute_bash import BashTool
from openhands.tools.terminal import TerminalTool


logger = get_logger(__name__)
Expand Down Expand Up @@ -42,7 +42,7 @@

# Tools
cwd = os.getcwd()
tools = [Tool(name=BashTool.name)]
tools = [Tool(name=TerminalTool.name)]

# Agent
agent = Agent(llm=llm, tools=tools)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
get_logger,
)
from openhands.sdk.tool import Tool
from openhands.tools.execute_bash import BashTool
from openhands.tools.terminal import TerminalTool


logger = get_logger(__name__)
Expand All @@ -32,7 +32,7 @@
cwd = os.getcwd()
tools = [
Tool(
name=BashTool.name,
name=TerminalTool.name,
params={"no_change_timeout_seconds": 3},
)
]
Expand Down
4 changes: 2 additions & 2 deletions examples/01_standalone_sdk/07_mcp_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
)
from openhands.sdk.security.llm_analyzer import LLMSecurityAnalyzer
from openhands.sdk.tool import Tool
from openhands.tools.execute_bash import BashTool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.terminal import TerminalTool


logger = get_logger(__name__)
Expand All @@ -32,7 +32,7 @@

cwd = os.getcwd()
tools = [
Tool(name=BashTool.name),
Tool(name=TerminalTool.name),
Tool(name=FileEditorTool.name),
]

Expand Down
4 changes: 2 additions & 2 deletions examples/01_standalone_sdk/08_mcp_with_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
get_logger,
)
from openhands.sdk.tool import Tool
from openhands.tools.execute_bash import BashTool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.terminal import TerminalTool


logger = get_logger(__name__)
Expand All @@ -32,7 +32,7 @@
cwd = os.getcwd()
tools = [
Tool(
name=BashTool.name,
name=TerminalTool.name,
),
Tool(name=FileEditorTool.name),
]
Expand Down
4 changes: 2 additions & 2 deletions examples/01_standalone_sdk/09_pause_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
Conversation,
)
from openhands.sdk.tool import Tool
from openhands.tools.execute_bash import BashTool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.terminal import TerminalTool


# Configure LLM
Expand All @@ -29,7 +29,7 @@
# Tools
tools = [
Tool(
name=BashTool.name,
name=TerminalTool.name,
),
Tool(name=FileEditorTool.name),
]
Expand Down
4 changes: 2 additions & 2 deletions examples/01_standalone_sdk/10_persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
get_logger,
)
from openhands.sdk.tool import Tool
from openhands.tools.execute_bash import BashTool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.terminal import TerminalTool


logger = get_logger(__name__)
Expand All @@ -33,7 +33,7 @@
# Tools
cwd = os.getcwd()
tools = [
Tool(name=BashTool.name),
Tool(name=TerminalTool.name),
Tool(name=FileEditorTool.name),
]

Expand Down
4 changes: 2 additions & 2 deletions examples/01_standalone_sdk/11_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
from openhands.sdk.conversation.types import ConversationCallbackType
from openhands.sdk.tool import Tool
from openhands.sdk.utils.async_utils import AsyncCallbackWrapper
from openhands.tools.execute_bash import BashTool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.task_tracker import TaskTrackerTool
from openhands.tools.terminal import TerminalTool


logger = get_logger(__name__)
Expand All @@ -43,7 +43,7 @@
cwd = os.getcwd()
tools = [
Tool(
name=BashTool.name,
name=TerminalTool.name,
),
Tool(name=FileEditorTool.name),
Tool(name=TaskTrackerTool.name),
Expand Down
4 changes: 2 additions & 2 deletions examples/01_standalone_sdk/12_custom_secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
)
from openhands.sdk.conversation.secret_source import SecretSource
from openhands.sdk.tool import Tool
from openhands.tools.execute_bash import BashTool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.terminal import TerminalTool


# Configure LLM
Expand All @@ -27,7 +27,7 @@

# Tools
tools = [
Tool(name=BashTool.name),
Tool(name=TerminalTool.name),
Tool(name=FileEditorTool.name),
]

Expand Down
4 changes: 2 additions & 2 deletions examples/01_standalone_sdk/13_get_llm_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
get_logger,
)
from openhands.sdk.tool import Tool
from openhands.tools.execute_bash import BashTool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.terminal import TerminalTool


logger = get_logger(__name__)
Expand All @@ -31,7 +31,7 @@

cwd = os.getcwd()
tools = [
Tool(name=BashTool.name),
Tool(name=TerminalTool.name),
Tool(name=FileEditorTool.name),
]

Expand Down
4 changes: 2 additions & 2 deletions examples/01_standalone_sdk/14_context_condenser.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
)
from openhands.sdk.context.condenser import LLMSummarizingCondenser
from openhands.sdk.tool import Tool
from openhands.tools.execute_bash import BashTool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.task_tracker import TaskTrackerTool
from openhands.tools.terminal import TerminalTool


logger = get_logger(__name__)
Expand All @@ -42,7 +42,7 @@
cwd = os.getcwd()
tools = [
Tool(
name=BashTool.name,
name=TerminalTool.name,
),
Tool(name=FileEditorTool.name),
Tool(name=TaskTrackerTool.name),
Expand Down
4 changes: 2 additions & 2 deletions examples/01_standalone_sdk/15_browser_use.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
)
from openhands.sdk.tool import Tool
from openhands.tools.browser_use import BrowserToolSet
from openhands.tools.execute_bash import BashTool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.terminal import TerminalTool


logger = get_logger(__name__)
Expand All @@ -34,7 +34,7 @@
cwd = os.getcwd()
tools = [
Tool(
name=BashTool.name,
name=TerminalTool.name,
),
Tool(name=FileEditorTool.name),
Tool(name=BrowserToolSet.name),
Expand Down
4 changes: 2 additions & 2 deletions examples/01_standalone_sdk/16_llm_security_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
from openhands.sdk.security.confirmation_policy import ConfirmRisky
from openhands.sdk.security.llm_analyzer import LLMSecurityAnalyzer
from openhands.sdk.tool import Tool
from openhands.tools.execute_bash import BashTool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.terminal import TerminalTool


# Clean ^C exit: no stack trace noise
Expand Down Expand Up @@ -106,7 +106,7 @@ def run_until_finished_with_security(
# Tools
tools = [
Tool(
name=BashTool.name,
name=TerminalTool.name,
),
Tool(name=FileEditorTool.name),
]
Expand Down
4 changes: 2 additions & 2 deletions examples/01_standalone_sdk/17_image_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
get_logger,
)
from openhands.sdk.tool.spec import Tool
from openhands.tools.execute_bash import BashTool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.task_tracker import TaskTrackerTool
from openhands.tools.terminal import TerminalTool


logger = get_logger(__name__)
Expand All @@ -46,7 +46,7 @@
llm=llm,
tools=[
Tool(
name=BashTool.name,
name=TerminalTool.name,
),
Tool(name=FileEditorTool.name),
Tool(name=TaskTrackerTool.name),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
Conversation,
)
from openhands.sdk.tool import Tool
from openhands.tools.execute_bash import BashTool
from openhands.tools.file_editor import FileEditorTool
from openhands.tools.terminal import TerminalTool


# Configure LLM
Expand All @@ -71,7 +71,7 @@
cwd = os.getcwd()
tools = [
Tool(
name=BashTool.name,
name=TerminalTool.name,
),
Tool(name=FileEditorTool.name),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
get_logger,
)
from openhands.sdk.tool.spec import Tool
from openhands.tools.execute_bash import BashTool
from openhands.tools.terminal import TerminalTool


logger = get_logger(__name__)
Expand Down Expand Up @@ -47,7 +47,7 @@
llm=llm,
tools=[
Tool(
name=BashTool.name,
name=TerminalTool.name,
),
],
condenser=condenser,
Expand Down
4 changes: 2 additions & 2 deletions examples/01_standalone_sdk/22_anthropic_thinking.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
ThinkingBlock,
)
from openhands.sdk.tool import Tool
from openhands.tools.execute_bash import BashTool
from openhands.tools.terminal import TerminalTool


# Configure LLM for Anthropic Claude with extended thinking
Expand All @@ -31,7 +31,7 @@
)

# Setup agent with bash tool
agent = Agent(llm=llm, tools=[Tool(name=BashTool.name)])
agent = Agent(llm=llm, tools=[Tool(name=TerminalTool.name)])


# Callback to display thinking blocks
Expand Down
Loading
Loading