Skip to content

Commit 5e93f74

Browse files
SmartManojxingyaowwopenhands-agent
authored
Rename execute_bash to terminal & rename BashTool to TerminalTool (#1033)
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev> Co-authored-by: openhands <openhands@all-hands.dev>
1 parent 89b63b4 commit 5e93f74

File tree

95 files changed

+419
-411
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+419
-411
lines changed

.github/prompts/update-documentation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Review these key files for accuracy:
3636

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

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

6161
### 4. Verification Steps
6262

examples/01_standalone_sdk/01_hello_world.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import os
22

33
from openhands.sdk import LLM, Agent, Conversation, Tool
4-
from openhands.tools.execute_bash import BashTool
54
from openhands.tools.file_editor import FileEditorTool
65
from openhands.tools.task_tracker import TaskTrackerTool
6+
from openhands.tools.terminal import TerminalTool
77

88

99
llm = LLM(
@@ -14,7 +14,7 @@
1414
agent = Agent(
1515
llm=llm,
1616
tools=[
17-
Tool(name=BashTool.name),
17+
Tool(name=TerminalTool.name),
1818
Tool(name=FileEditorTool.name),
1919
Tool(name=TaskTrackerTool.name),
2020
],

examples/01_standalone_sdk/02_custom_tools.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
ToolExecutor,
2525
register_tool,
2626
)
27-
from openhands.tools.execute_bash import (
27+
from openhands.tools.file_editor import FileEditorTool
28+
from openhands.tools.terminal import (
2829
BashExecutor,
29-
BashTool,
3030
ExecuteBashAction,
31+
TerminalTool,
3132
)
32-
from openhands.tools.file_editor import FileEditorTool
3333

3434

3535
logger = get_logger(__name__)
@@ -168,11 +168,11 @@ def create(
168168

169169

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

173173
bash_executor = BashExecutor(working_dir=conv_state.workspace.working_dir)
174-
# bash_tool = execute_bash_tool.set_executor(executor=bash_executor)
175-
bash_tool = BashTool.create(conv_state, executor=bash_executor)[0]
174+
# bash_tool = terminal_tool.set_executor(executor=bash_executor)
175+
bash_tool = TerminalTool.create(conv_state, executor=bash_executor)[0]
176176

177177
# Use the GrepTool.create() method with shared bash_executor
178178
grep_tool = GrepTool.create(conv_state, bash_executor=bash_executor)[0]

examples/01_standalone_sdk/03_activate_skill.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
Skill,
1717
)
1818
from openhands.sdk.tool import Tool
19-
from openhands.tools.execute_bash import BashTool
2019
from openhands.tools.file_editor import FileEditorTool
20+
from openhands.tools.terminal import TerminalTool
2121

2222

2323
logger = get_logger(__name__)
@@ -38,7 +38,7 @@
3838
cwd = os.getcwd()
3939
tools = [
4040
Tool(
41-
name=BashTool.name,
41+
name=TerminalTool.name,
4242
),
4343
Tool(name=FileEditorTool.name),
4444
]

examples/01_standalone_sdk/05_use_llm_registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
get_logger,
1515
)
1616
from openhands.sdk.tool import Tool
17-
from openhands.tools.execute_bash import BashTool
17+
from openhands.tools.terminal import TerminalTool
1818

1919

2020
logger = get_logger(__name__)
@@ -42,7 +42,7 @@
4242

4343
# Tools
4444
cwd = os.getcwd()
45-
tools = [Tool(name=BashTool.name)]
45+
tools = [Tool(name=TerminalTool.name)]
4646

4747
# Agent
4848
agent = Agent(llm=llm, tools=tools)

examples/01_standalone_sdk/06_interactive_terminal_w_reasoning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
get_logger,
1212
)
1313
from openhands.sdk.tool import Tool
14-
from openhands.tools.execute_bash import BashTool
14+
from openhands.tools.terminal import TerminalTool
1515

1616

1717
logger = get_logger(__name__)
@@ -32,7 +32,7 @@
3232
cwd = os.getcwd()
3333
tools = [
3434
Tool(
35-
name=BashTool.name,
35+
name=TerminalTool.name,
3636
params={"no_change_timeout_seconds": 3},
3737
)
3838
]

examples/01_standalone_sdk/07_mcp_integration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
)
1313
from openhands.sdk.security.llm_analyzer import LLMSecurityAnalyzer
1414
from openhands.sdk.tool import Tool
15-
from openhands.tools.execute_bash import BashTool
1615
from openhands.tools.file_editor import FileEditorTool
16+
from openhands.tools.terminal import TerminalTool
1717

1818

1919
logger = get_logger(__name__)
@@ -32,7 +32,7 @@
3232

3333
cwd = os.getcwd()
3434
tools = [
35-
Tool(name=BashTool.name),
35+
Tool(name=TerminalTool.name),
3636
Tool(name=FileEditorTool.name),
3737
]
3838

examples/01_standalone_sdk/08_mcp_with_oauth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
get_logger,
1212
)
1313
from openhands.sdk.tool import Tool
14-
from openhands.tools.execute_bash import BashTool
1514
from openhands.tools.file_editor import FileEditorTool
15+
from openhands.tools.terminal import TerminalTool
1616

1717

1818
logger = get_logger(__name__)
@@ -32,7 +32,7 @@
3232
cwd = os.getcwd()
3333
tools = [
3434
Tool(
35-
name=BashTool.name,
35+
name=TerminalTool.name,
3636
),
3737
Tool(name=FileEditorTool.name),
3838
]

examples/01_standalone_sdk/09_pause_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
Conversation,
1111
)
1212
from openhands.sdk.tool import Tool
13-
from openhands.tools.execute_bash import BashTool
1413
from openhands.tools.file_editor import FileEditorTool
14+
from openhands.tools.terminal import TerminalTool
1515

1616

1717
# Configure LLM
@@ -29,7 +29,7 @@
2929
# Tools
3030
tools = [
3131
Tool(
32-
name=BashTool.name,
32+
name=TerminalTool.name,
3333
),
3434
Tool(name=FileEditorTool.name),
3535
]

examples/01_standalone_sdk/10_persistence.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
get_logger,
1313
)
1414
from openhands.sdk.tool import Tool
15-
from openhands.tools.execute_bash import BashTool
1615
from openhands.tools.file_editor import FileEditorTool
16+
from openhands.tools.terminal import TerminalTool
1717

1818

1919
logger = get_logger(__name__)
@@ -33,7 +33,7 @@
3333
# Tools
3434
cwd = os.getcwd()
3535
tools = [
36-
Tool(name=BashTool.name),
36+
Tool(name=TerminalTool.name),
3737
Tool(name=FileEditorTool.name),
3838
]
3939

0 commit comments

Comments
 (0)