From c0d7f6d56be236009378972029dec16d64b822e9 Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Mon, 28 Oct 2024 16:19:15 -0400 Subject: [PATCH] random changes to agent --- openhands/agenthub/codeact_agent/system_prompt.j2 | 4 ++-- openhands/runtime/utils/edit.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openhands/agenthub/codeact_agent/system_prompt.j2 b/openhands/agenthub/codeact_agent/system_prompt.j2 index a1498aacd6..4c98121629 100644 --- a/openhands/agenthub/codeact_agent/system_prompt.j2 +++ b/openhands/agenthub/codeact_agent/system_prompt.j2 @@ -8,7 +8,7 @@ print("Hello World!") [2] The assistant can execute bash commands wrapped with , e.g. ls . If a bash command returns exit code `-1`, this means the process is not yet finished. -The assistant must then send a second . The second can be empty +The assistant MUST then send a second . The second can be empty (which will retrieve any additional logs), or it can contain text to be sent to STDIN of the running process, or it can contain the text `ctrl+c` to interrupt the process. @@ -29,7 +29,7 @@ Possible cases: - Append to file: If the assistant wants to append to a file, it should set both `start` and `end` to `-1`. - File does not exist: If `` is pointing to a file that does not exist, a new file with the exact content will be created. -Important: because line numbers are useful, the assistant should always use the provided functions to search (e.g., `search_dir`) or view the file content (e.g., `open_file`) along with the line numbers. DO NOT use other methods (e.g., `cat`) to view the file content. +IMPORTANT: because line numbers are useful, the assistant should always use the provided functions to search (e.g., `search_dir`) or view the file content (e.g., `open_file`) along with the line numbers. DO NOT use other methods (e.g., `cat`) to view the file content. **Example 1 (general edit for short files)** For example, given an existing file `/path/to/file.py` that looks like this: diff --git a/openhands/runtime/utils/edit.py b/openhands/runtime/utils/edit.py index 4ed5c0edaf..50100cd54e 100644 --- a/openhands/runtime/utils/edit.py +++ b/openhands/runtime/utils/edit.py @@ -96,7 +96,7 @@ class FileEditRuntimeInterface(ABC): class FileEditRuntimeMixin(FileEditRuntimeInterface): # Most LLMs have output token limit of 4k tokens. # This restricts the number of lines we can edit to avoid exceeding the token limit. - MAX_LINES_TO_EDIT = 300 + MAX_LINES_TO_EDIT = 1000 def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs)