Improve descriptions of ReplaceSymbolBodyTool and ExecuteShellCommandTool

This commit is contained in:
Dominik Jain authored and Dominik Jain committed 2025-09-30 14:11:43 +02:00
1 parent 69f16bd25b
commit b5f8bcedac
2 files changed
+9 -5

No files matched your search

+4 -1
View File
@@ -22,7 +22,10 @@ class ExecuteShellCommandTool(Tool, ToolMarkerCanEdit):
) -> str:
"""
Execute a shell command and return its output. If there is a memory about suggested commands, read that first.
Never execute unsafe shell commands like `rm -rf /` or similar!
Never execute unsafe shell commands!
IMPORTANT: Do not use this tool to start
* long-running processes (e.g. servers) that are not intended to terminate quickly,
* processes that require user interaction.
:param command: the shell command to execute
:param cwd: the working directory to execute the command in. If None, the project root will be used.
+5 -4
View File
@@ -227,13 +227,14 @@ class ReplaceSymbolBodyTool(Tool, ToolMarkerSymbolicEdit):
Replaces the body of the symbol with the given `name_path`.
The tool shall be used to replace symbol bodies that have been previously retrieved
(e.g. via `find_symbol`), such that it is clear what constitutes the body of the symbol.
(e.g. via `find_symbol`).
IMPORTANT: Do not use this tool if you do not know what exactly constitutes the body of the symbol.
:param name_path: for finding the symbol to replace, same logic as in the `find_symbol` tool.
:param relative_path: the relative path to the file containing the symbol
:param body: the new symbol body. Important: The symbol body is the full definition of a symbol
in the programming language, including e.g. the signature line for functions,
but it does NOT include any preceding comments or imports, in particular.
:param body: the new symbol body. The symbol body is the definition of a symbol
in the programming language, including e.g. the signature line for functions.
IMPORTANT: The body does NOT include any preceding docstrings/comments or imports, in particular.
"""
code_editor = self.create_code_editor()
code_editor.replace_body(