Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Improve chooser config: Append patch

Kilian Lieret8985a53da251
diff --git a/config/default_retry_5_2_0_choo.yaml b/config/default_retry_5_2_0_choo2.yaml
similarity index 97%
rename from config/default_retry_5_2_0_choo.yaml
rename to config/default_retry_5_2_0_choo2.yaml
index 0381c217..388fb63c 100644
--- a/config/default_retry_5_2_0_choo.yaml
+++ b/config/default_retry_5_2_0_choo2.yaml
@@ -160,6 +160,7 @@ review_loop_config:
For example:
Investigation 1 Step 1 action:
+ DISCUSSION
We have found a bug in the code. Let's try to reproduce it.
```
create reproduce.py
@@ -171,7 +172,7 @@ review_loop_config:
After the command, there is a description of the output of the command ("Step {i} output: ").
The most important actions are
- - `open {file}`: This action opens the file {file}. The output of the command shows part of the content of the file.
+ - `open {file}`: This action opens the file {file}. The output of the command shows part of the content of the file.
- `edit {from}:{to}`, followed by the content to replace lines {from} to {to}. This action always affects the currently
opened file. The output of the command is the content of the file after the edit.
- `python {file}`: This action executes the Python script {file}. The output of the command is the output of the script.
@@ -248,6 +249,12 @@ review_loop_config:
{traj1}
+ This is the final patch of investigation 1:
+
+ ```
+ {submission1}
+ ```
+
========================
INPUT 3: Investigation 2
========================
@@ -255,6 +262,13 @@ review_loop_config:
Investigation 2 used {model_stats_api_calls2} API calls to fix the problem. The investigation is as follows:
{traj2}
+
+ This is the final patch of investigation 2:
+
+ ```
+ {submission2}
+ ```
+
traj_only_show_last_n_output: 3
traj_item_template: |
Investigation {i_traj} Step {i_step}:
diff --git a/sweagent/agent/agents.py b/sweagent/agent/agents.py
index 0aeb7519..209aaaa8 100644
--- a/sweagent/agent/agents.py
+++ b/sweagent/agent/agents.py
@@ -959,6 +959,8 @@ class Agent:
observations: list[str | None] = list()
for sub_action in self.split_actions(run_action):
observation, done = self._run_sub_action(sub_action)
+ # If the last sub-action is done, the observation is not
+ # appended.
if done:
break
observations.append(observation)