mini-swe-agent 1.5.1__py3-none-any.whl → 1.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mini-swe-agent
3
- Version: 1.5.1
3
+ Version: 1.7.0
4
4
  Summary: Nano SWE Agent - A simple AI software engineering agent
5
5
  Author-email: Kilian Lieret <kilian.lieret@posteo.de>, "Carlos E. Jimenez" <carlosej@princeton.edu>
6
6
  License: MIT License
@@ -70,7 +70,9 @@ Dynamic: license-file
70
70
  <a href="https://mini-swe-agent.com/latest/"><img src="https://github.com/SWE-agent/mini-swe-agent/raw/main/docs/assets/mini-swe-agent-banner.svg" alt="mini-swe-agent banner" style="height: 7em"/></a>
71
71
  </div>
72
72
 
73
- <h1>The 100 line AI agent that solves GitHub issues & more</h1>
73
+ # The 100 line AI agent that solves GitHub issues & more
74
+
75
+ 📣 [Run `mini` with GPT-5 and friends: Read here](https://mini-swe-agent.com/latest/quickstart/#gpt-5)
74
76
 
75
77
  [![Docs](https://img.shields.io/badge/Docs-green?style=for-the-badge&logo=materialformkdocs&logoColor=white)](https://mini-swe-agent.com/latest/)
76
78
  [![Slack](https://img.shields.io/badge/Slack-4A154B?style=for-the-badge&logo=slack&logoColor=white)](https://join.slack.com/t/swe-bench/shared_invite/zt-36pj9bu5s-o3_yXPZbaH2wVnxnss1EkQ)
@@ -1,19 +1,20 @@
1
- mini_swe_agent-1.5.1.dist-info/licenses/LICENSE.md,sha256=D3luWPkdHAe7LBsdD4vzqDAXw6Xewb3G-uczss0uh1s,1094
2
- minisweagent/__init__.py,sha256=_z5QkBGjq4zOO2GWbaJCtjSI02UC6JUb2a_dUGaYlY0,1787
1
+ mini_swe_agent-1.7.0.dist-info/licenses/LICENSE.md,sha256=D3luWPkdHAe7LBsdD4vzqDAXw6Xewb3G-uczss0uh1s,1094
2
+ minisweagent/__init__.py,sha256=6jA1GU4UmTNYzNBCtYP8-yVsB_Qq_VjEMOl4j65qdh4,1787
3
3
  minisweagent/__main__.py,sha256=FIyAOiw--c3FQ2g240FOM1FdL0lk_PxSpixu0pQ7WFo,194
4
4
  minisweagent/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  minisweagent/agents/__init__.py,sha256=cpjJLzg1IGxLM-tZpoMJV9S33ye13XtdBO0x7DU_Lrk,48
6
- minisweagent/agents/default.py,sha256=bqLMtEptn61zc_ptAIQkz_2fMI8hBoVpydVA84mPH8I,5471
6
+ minisweagent/agents/default.py,sha256=yRqsz29kQPi96eT3JNo6vSV3kLSx3vQ-QasdF-GJ9ZI,5524
7
7
  minisweagent/agents/interactive.py,sha256=7HW2cffaV5f66DIjxvtIbL8mo_S5aZSwgNLSmHp6VC0,7450
8
8
  minisweagent/agents/interactive_textual.py,sha256=Ef2GTH2_9ujD95ukVf-hb7X6FCRVgvIdlJZvPvCAd-E,17629
9
- minisweagent/config/README.md,sha256=tPruhnQDhZ8ugc1FNPKk9tVMRltmmIjdYgvHCmN-3Hs,354
10
- minisweagent/config/__init__.py,sha256=UfORdQID1Ek_dduZlybUsIKJjihImkSqNU5tIjpw0hk,694
11
- minisweagent/config/default.yaml,sha256=AGhcIq6X6n5Fs71ufO3B6CtZ4PS877tCxkPkrWR5Ylg,4497
12
- minisweagent/config/github_issue.yaml,sha256=evvu3AJ52tXYSdami9_B8zfazOAE2r2XXkzVmScBoKc,4539
9
+ minisweagent/config/README.md,sha256=ABd9anA4aRWtx7Oh37z36Wv6ARvcxD2w9lPUE24R2mY,435
10
+ minisweagent/config/__init__.py,sha256=0KzHaaIqWgRy2zbwIzhrg6BJPDzOvYi3jb4eBNY4sAU,823
11
+ minisweagent/config/default.yaml,sha256=OHK9-7PkCa9ZzgYykF1zGYC_AWkiAdOrEpDuurF-1Rk,5143
12
+ minisweagent/config/github_issue.yaml,sha256=qbjj3vmdukxz36_EY7e64vhNn1g2-_NrdNx5xgMOUAI,4569
13
13
  minisweagent/config/mini.tcss,sha256=fmAP9cYAp2n7Ps2Dw3e-ZOGEF2E8JcwTgK1LDcis-x4,1141
14
- minisweagent/config/mini.yaml,sha256=WluQAx4AII9MFk3xDSzsJTosNJfgZti02niCYZWYq_A,5346
14
+ minisweagent/config/mini.yaml,sha256=mDfN7KputHf7kOGidJFX5-5CDKg97vxxu2cdYYlPoM8,5159
15
+ minisweagent/config/mini_no_temp.yaml,sha256=n0W-017tBmMx57U9SLt7Fy9WJxI9x2vdTWBWeSngGMc,5204
15
16
  minisweagent/config/extra/__init__.py,sha256=e1MoAlDn_wc9HnXNoncf1P-B4DQ-iRf6n7Q_txjZGRI,52
16
- minisweagent/config/extra/swebench.yaml,sha256=LNpTahpul6HL0HozgAAz-C6kpX3wZA7Tg8uE-ZmgrF4,7577
17
+ minisweagent/config/extra/swebench.yaml,sha256=dXg1Jsr3PMxU4qkypCxh6URtWIR0m7AkjF7P5HA-u6A,7652
17
18
  minisweagent/environments/__init__.py,sha256=g5mKac1YgVOZVKvmiAiuyPSevRYpI69V4vYrbCH3gsI,54
18
19
  minisweagent/environments/docker.py,sha256=VYk7i0T0IgUF_s-N-DqYkHsBWbfgaIMpJZIIdEtetTw,3871
19
20
  minisweagent/environments/local.py,sha256=-2EV3RqZSB8WEjJE7BHLhRjocPMLpoJ3HbM8QB1WXUU,1060
@@ -22,8 +23,9 @@ minisweagent/environments/extra/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
22
23
  minisweagent/environments/extra/swerex_docker.py,sha256=MOhhFdX1sAk_U0g-GOxohfjrldzO4YfrUnHq8qJff7c,1502
23
24
  minisweagent/models/__init__.py,sha256=J4bnvfMByTVG0cL_6p51sm8gdargXhARfbG5c0UZ8Z4,2890
24
25
  minisweagent/models/anthropic.py,sha256=D8nHvvbgzPjla0He8p0O9kaXASPWg1Sai0pHsAj_Yn8,855
25
- minisweagent/models/litellm_model.py,sha256=2-Q7gEoKK-2kbUsfDxrTBxIQasEqw1raE_1Xk28XXUc,2289
26
+ minisweagent/models/litellm_model.py,sha256=fXhVJtNDhu9buB45p7S576r86f_9oLFdvgJnMZ1oJ4M,2384
26
27
  minisweagent/models/test_models.py,sha256=oB3jmZUire5TkVT8ebUCD3jLuLhPIbcTiTqdIix85Yw,1174
28
+ minisweagent/models/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
29
  minisweagent/models/utils/cache_control.py,sha256=mG9cE56HQaUwXfoqvXoH6LcbMV_G1vlEE1aBBpikXYg,1608
28
30
  minisweagent/models/utils/key_per_thread.py,sha256=Vlxt--rapNNYCgIHrMCu1WVAkuiVIhC_awbarkbnkZQ,644
29
31
  minisweagent/run/__init__.py,sha256=WIoYgHVl7iZF2YncrfV3IttupG6P5KogroKHKECka3A,38
@@ -36,11 +38,12 @@ minisweagent/run/extra/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
36
38
  minisweagent/run/extra/config.py,sha256=ezUu8n2-h79cfphWXv-j9LQXfxzkxrF2aPlh7mObF7k,3545
37
39
  minisweagent/run/extra/swebench.py,sha256=m5_PZI4ojkUyCxzkkMtel_vlnYmjziWrXu73yHoZGFs,9688
38
40
  minisweagent/run/extra/swebench_single.py,sha256=L3Kk4G65o3MCPLMEwGNIs77-AFf6Lfc8o1oxrbN-ZWM,1991
39
- minisweagent/run/extra/utils/batch_progress.py,sha256=u__khJ-fipZLxTJu43LamGAtPUCqEZYEi8J7SfH7X6A,6211
41
+ minisweagent/run/extra/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
+ minisweagent/run/extra/utils/batch_progress.py,sha256=xhJ7FmsaTBGz-yh8pzYl4yMoUGjn7GA24eYrP-nHj60,6804
40
43
  minisweagent/run/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
44
  minisweagent/run/utils/save.py,sha256=yI_hSU-GOaB7j8YeHBCc7Fhl4js9AyO9N5SC6p-nnu8,1606
42
- mini_swe_agent-1.5.1.dist-info/METADATA,sha256=vhNmjVsIhc6H04u8X1zDTVkOdl9jd4CtCnG889AW-MU,13684
43
- mini_swe_agent-1.5.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
44
- mini_swe_agent-1.5.1.dist-info/entry_points.txt,sha256=d1_yRbTaGjs1UXHa6JQK0sKDGBIVGm8oeW0k2kfbJgQ,182
45
- mini_swe_agent-1.5.1.dist-info/top_level.txt,sha256=zKF4t8bFpV87fdVABZt2Da-vnb4Vkh_CxkwQx5YT4Ew,13
46
- mini_swe_agent-1.5.1.dist-info/RECORD,,
45
+ mini_swe_agent-1.7.0.dist-info/METADATA,sha256=-YDH48bXpuu7too17B9fCZwT0--Yt6nVt_eJJdoFkbw,13783
46
+ mini_swe_agent-1.7.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
47
+ mini_swe_agent-1.7.0.dist-info/entry_points.txt,sha256=d1_yRbTaGjs1UXHa6JQK0sKDGBIVGm8oeW0k2kfbJgQ,182
48
+ mini_swe_agent-1.7.0.dist-info/top_level.txt,sha256=zKF4t8bFpV87fdVABZt2Da-vnb4Vkh_CxkwQx5YT4Ew,13
49
+ mini_swe_agent-1.7.0.dist-info/RECORD,,
minisweagent/__init__.py CHANGED
@@ -8,7 +8,7 @@ This file provides:
8
8
  unless you want the static type checking.
9
9
  """
10
10
 
11
- __version__ = "1.5.1"
11
+ __version__ = "1.7.0"
12
12
 
13
13
  import os
14
14
  from pathlib import Path
@@ -18,7 +18,7 @@ class AgentConfig:
18
18
  system_template: str = "You are a helpful assistant that can do anything."
19
19
  instance_template: str = (
20
20
  "Your task: {{task}}. Please reply with a single shell command in triple backticks. "
21
- "To finish, the first line of the output of the shell command must be 'MINI_SWE_AGENT_FINAL_OUTPUT'."
21
+ "To finish, the first line of the output of the shell command must be 'COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT'."
22
22
  )
23
23
  timeout_template: str = (
24
24
  "The last command <command>{{action['action']}}</command> timed out and has been killed.\n"
@@ -125,5 +125,5 @@ class DefaultAgent:
125
125
  def has_finished(self, output: dict[str, str]):
126
126
  """Raises Submitted exception with final output if the agent has finished its task."""
127
127
  lines = output.get("output", "").lstrip().splitlines()
128
- if lines and lines[0].strip() == "MINI_SWE_AGENT_FINAL_OUTPUT":
128
+ if lines and lines[0].strip() in ["MINI_SWE_AGENT_FINAL_OUTPUT", "COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT"]:
129
129
  raise Submitted("\n".join(lines[1:]))
@@ -1,9 +1,10 @@
1
1
  # Configs
2
2
 
3
3
  * `mini.yaml` - Default config for `mini`/`agents/interactive.py` or `mini -v`/`agents/interactive_textual.py` agent.
4
+ * `mini_no_temp.yaml` - Same as `mini.yaml` but without the temperature setting
4
5
  * `default.yaml` - Default config for the `default.py` agent.
5
6
  * `github_issue.yaml` - Config for the `run/github_issue.py` entry point.
6
7
 
7
8
  ## Extras
8
9
 
9
- * `extra/swebench.yaml` - Config for the `run/extra/swebench.py` entry point.
10
+ * `extra/swebench.yaml` - Config for the `run/extra/swebench.py` entry point.
@@ -8,6 +8,9 @@ builtin_config_dir = Path(__file__).parent
8
8
 
9
9
  def get_config_path(config_spec: str | Path) -> Path:
10
10
  """Get the path to a config file."""
11
+ config_spec = Path(config_spec)
12
+ if config_spec.suffix != ".yaml":
13
+ config_spec = config_spec.with_suffix(".yaml")
11
14
  candidates = [
12
15
  Path(config_spec),
13
16
  Path(os.getenv("MSWEA_CONFIG_DIR", ".")) / config_spec,
@@ -15,19 +15,22 @@ agent:
15
15
  </format_example>
16
16
 
17
17
  Failure to follow these rules will cause your response to be rejected.
18
- To finish, issue the following command: `echo MINI_SWE_AGENT_FINAL_OUTPUT`
19
- without any other command.
20
18
  instance_template: |
21
19
  Please solve this issue: {{task}}
22
20
 
23
21
  You can execute bash commands and edit files to implement the necessary changes.
24
22
 
25
23
  ## Recommended Workflow
24
+
25
+ This workflows should be done step-by-step so that you can iterate on your changes and any possible problems.
26
+
26
27
  1. Analyze the codebase by finding and reading relevant files
27
28
  2. Create a script to reproduce the issue
28
29
  3. Edit the source code to resolve the issue
29
30
  4. Verify your fix works by running your script again
30
31
  5. Test edge cases to ensure your fix is robust
32
+ 6. Submit your changes and finish your work by issuing the following command: `echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT`.
33
+ Do not combine it with any other command. <important>After this command, you cannot continue working on this task.</important>
31
34
 
32
35
  ## Important Rules
33
36
 
@@ -35,8 +38,10 @@ agent:
35
38
  2. The action must be enclosed in triple backticks
36
39
  3. Directory or environment variable changes are not persistent. Every action is executed in a new subshell.
37
40
  However, you can prefix any action with `MY_ENV_VAR=MY_VALUE cd /path/to/working/dir && ...` or write/load environment variables from files
38
- 4. To finish, issue the following command: `echo MINI_SWE_AGENT_FINAL_OUTPUT`.
39
- Do not combine it with any other command.
41
+
42
+ <system_information>
43
+ {{system}} {{release}} {{version}} {{machine}} {{processor}}
44
+ </system_information>
40
45
 
41
46
  ## Formatting your response
42
47
 
@@ -64,6 +69,12 @@ agent:
64
69
 
65
70
  ### Edit files with sed:
66
71
 
72
+ {%- if system == "Darwin" -%}
73
+ <important>
74
+ You are on MacOS. For all the below examples, you need to use `sed -i ''` instead of `sed -i`.
75
+ </important>
76
+ {%- endif -%}
77
+
67
78
  ```bash
68
79
  # Replace all occurrences
69
80
  sed -i 's/old_string/new_string/g' filename.py
@@ -117,7 +128,7 @@ agent:
117
128
  {%- endif -%}
118
129
  format_error_template: |
119
130
  Please always provide EXACTLY ONE action in triple backticks, found {{actions|length}} actions.
120
- If you want to end the task, please issue the following command: `echo MINI_SWE_AGENT_FINAL_OUTPUT`
131
+ If you want to end the task, please issue the following command: `echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT`
121
132
  without any other command.
122
133
  Else, please format your response exactly as follows:
123
134
 
@@ -128,6 +139,9 @@ agent:
128
139
  <action>
129
140
  ```
130
141
  </response_example>
142
+
143
+ Note: In rare cases, if you need to reference a similar format in your command, you might have
144
+ to proceed in two steps, first writing TRIPLEBACKTICKSBASH, then replacing them with ```bash.
131
145
  step_limit: 0.
132
146
  cost_limit: 0.
133
147
  environment:
@@ -159,15 +159,15 @@ agent:
159
159
  ```
160
160
 
161
161
  ## Submission
162
- When you've completed your changes or can't make further progress
162
+ When you've completed your work (reading, editing, testing), and cannot make further progress
163
163
  issue exactly the following command:
164
164
 
165
165
  ```bash
166
- echo MINI_SWE_AGENT_FINAL_OUTPUT && git add -A && git diff --cached
166
+ echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT && git add -A && git diff --cached
167
167
  ```
168
168
 
169
- This command will submit your changes.
170
- You cannot continue working on this task after submitting.
169
+ This command will submit your work.
170
+ You cannot continue working (reading, editing, testing) in any way on this task after submitting.
171
171
  </instructions>
172
172
  action_observation_template: |
173
173
  <returncode>{{output.returncode}}</returncode>
@@ -225,5 +225,5 @@ environment:
225
225
  model:
226
226
  model_name: "claude-sonnet-4-20250514"
227
227
  model_kwargs:
228
+ drop_params: true
228
229
  temperature: 0.0
229
- drop_params: true
@@ -15,7 +15,7 @@ agent:
15
15
  </format_example>
16
16
 
17
17
  Failure to follow these rules will cause your response to be rejected.
18
- To finish, issue the following command: `echo MINI_SWE_AGENT_FINAL_OUTPUT`
18
+ To finish, issue the following command: `echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT`
19
19
  without any other command.
20
20
  instance_template: |
21
21
  Please solve this issue: {{task}}
@@ -35,7 +35,7 @@ agent:
35
35
  2. The action must be enclosed in triple backticks
36
36
  3. Directory or environment variable changes are not persistent. Every action is executed in a new subshell.
37
37
  However, you can prefix any action with `MY_ENV_VAR=MY_VALUE cd /path/to/working/dir && ...` or write/load environment variables from files
38
- 4. To finish, issue the following command: `echo MINI_SWE_AGENT_FINAL_OUTPUT`.
38
+ 4. To finish, issue the following command: `echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT`.
39
39
  Do not combine it with any other command.
40
40
 
41
41
  ## Formatting your response
@@ -117,7 +117,7 @@ agent:
117
117
  {%- endif -%}
118
118
  format_error_template: |
119
119
  Please always provide EXACTLY ONE action in triple backticks, found {{actions|length}} actions.
120
- If you want to end the task, please issue the following command: `echo MINI_SWE_AGENT_FINAL_OUTPUT`
120
+ If you want to end the task, please issue the following command: `echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT`
121
121
  without any other command.
122
122
  Else, please format your response exactly as follows:
123
123
 
@@ -15,8 +15,6 @@ agent:
15
15
  </format_example>
16
16
 
17
17
  Failure to follow these rules will cause your response to be rejected.
18
- To finish, issue the following command: `echo MINI_SWE_AGENT_FINAL_OUTPUT`
19
- without any other command.
20
18
  instance_template: |
21
19
  Please solve this issue: {{task}}
22
20
 
@@ -24,14 +22,15 @@ agent:
24
22
 
25
23
  ## Recommended Workflow
26
24
 
27
- 1. If present, you might want to take a look at the following files that set additional guidelines
28
- for your work: CLAUDE.md, .github/copilot-instructions.md. Use a find command to locate all of them at once.
29
- If files corresponding to multiple AI systems are present, it's enough to read the ones for one of them.
30
- 2. Analyze the codebase by finding and reading relevant files.
31
- 3. Create a script to reproduce the issue
32
- 4. Edit the source code to resolve the issue
33
- 5. Verify your fix works by running your script again
34
- 6. Test edge cases to ensure your fix is robust
25
+ This workflows should be done step-by-step so that you can iterate on your changes and any possible problems.
26
+
27
+ 1. Analyze the codebase by finding and reading relevant files
28
+ 2. Create a script to reproduce the issue
29
+ 3. Edit the source code to resolve the issue
30
+ 4. Verify your fix works by running your script again
31
+ 5. Test edge cases to ensure your fix is robust
32
+ 6. Submit your changes and finish your work by issuing the following command: `echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT`.
33
+ Do not combine it with any other command. <important>After this command, you cannot continue working on this task.</important>
35
34
 
36
35
  ## Important Rules
37
36
 
@@ -39,8 +38,6 @@ agent:
39
38
  2. The action must be enclosed in triple backticks
40
39
  3. Directory or environment variable changes are not persistent. Every action is executed in a new subshell.
41
40
  However, you can prefix any action with `MY_ENV_VAR=MY_VALUE cd /path/to/working/dir && ...` or write/load environment variables from files
42
- 4. To finish, issue the following command: `echo MINI_SWE_AGENT_FINAL_OUTPUT`.
43
- Do not combine it with any other command.
44
41
 
45
42
  <system_information>
46
43
  {{system}} {{release}} {{version}} {{machine}} {{processor}}
@@ -131,7 +128,7 @@ agent:
131
128
  {%- endif -%}
132
129
  format_error_template: |
133
130
  Please always provide EXACTLY ONE action in triple backticks, found {{actions|length}} actions.
134
- If you want to end the task, please issue the following command: `echo MINI_SWE_AGENT_FINAL_OUTPUT`
131
+ If you want to end the task, please issue the following command: `echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT`
135
132
  without any other command.
136
133
  Else, please format your response exactly as follows:
137
134
 
@@ -0,0 +1,158 @@
1
+ # Identical config file to mini.yaml, but without temperature=0.0
2
+ agent:
3
+ system_template: |
4
+ You are a helpful assistant that can interact with a computer.
5
+
6
+ Your response must contain exactly ONE bash code block with ONE command (or commands connected with && or ||).
7
+ Include a THOUGHT section before your command where you explain your reasoning process.
8
+ Format your response as shown in <format_example>.
9
+
10
+ <format_example>
11
+ Your reasoning and analysis here. Explain why you want to perform the action.
12
+
13
+ ```bash
14
+ your_command_here
15
+ ```
16
+ </format_example>
17
+
18
+ Failure to follow these rules will cause your response to be rejected.
19
+ instance_template: |
20
+ Please solve this issue: {{task}}
21
+
22
+ You can execute bash commands and edit files to implement the necessary changes.
23
+
24
+ ## Recommended Workflow
25
+
26
+ This workflows should be done step-by-step so that you can iterate on your changes and any possible problems.
27
+
28
+ 1. Analyze the codebase by finding and reading relevant files
29
+ 2. Create a script to reproduce the issue
30
+ 3. Edit the source code to resolve the issue
31
+ 4. Verify your fix works by running your script again
32
+ 5. Test edge cases to ensure your fix is robust
33
+ 6. Submit your changes and finish your work by issuing the following command: `echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT`.
34
+ Do not combine it with any other command. <important>After this command, you cannot continue working on this task.</important>
35
+
36
+ ## Important Rules
37
+
38
+ 1. Every response must contain exactly one action
39
+ 2. The action must be enclosed in triple backticks
40
+ 3. Directory or environment variable changes are not persistent. Every action is executed in a new subshell.
41
+ However, you can prefix any action with `MY_ENV_VAR=MY_VALUE cd /path/to/working/dir && ...` or write/load environment variables from files
42
+
43
+ <system_information>
44
+ {{system}} {{release}} {{version}} {{machine}} {{processor}}
45
+ </system_information>
46
+
47
+ ## Formatting your response
48
+
49
+ Here is an example of a correct response:
50
+
51
+ <example_response>
52
+ THOUGHT: I need to understand the structure of the repository first. Let me check what files are in the current directory to get a better understanding of the codebase.
53
+
54
+ ```bash
55
+ ls -la
56
+ ```
57
+ </example_response>
58
+
59
+ ## Useful command examples
60
+
61
+ ### Create a new file:
62
+
63
+ ```bash
64
+ cat <<'EOF' > newfile.py
65
+ import numpy as np
66
+ hello = "world"
67
+ print(hello)
68
+ EOF
69
+ ```
70
+
71
+ ### Edit files with sed:
72
+
73
+ {%- if system == "Darwin" -%}
74
+ <important>
75
+ You are on MacOS. For all the below examples, you need to use `sed -i ''` instead of `sed -i`.
76
+ </important>
77
+ {%- endif -%}
78
+
79
+ ```bash
80
+ # Replace all occurrences
81
+ sed -i 's/old_string/new_string/g' filename.py
82
+
83
+ # Replace only first occurrence
84
+ sed -i 's/old_string/new_string/' filename.py
85
+
86
+ # Replace first occurrence on line 1
87
+ sed -i '1s/old_string/new_string/' filename.py
88
+
89
+ # Replace all occurrences in lines 1-10
90
+ sed -i '1,10s/old_string/new_string/g' filename.py
91
+ ```
92
+
93
+ ### View file content:
94
+
95
+ ```bash
96
+ # View specific lines with numbers
97
+ nl -ba filename.py | sed -n '10,20p'
98
+ ```
99
+
100
+ ### Any other command you want to run
101
+
102
+ ```bash
103
+ anything
104
+ ```
105
+ action_observation_template: |
106
+ <returncode>{{output.returncode}}</returncode>
107
+ {% if output.output | length < 10000 -%}
108
+ <output>
109
+ {{ output.output -}}
110
+ </output>
111
+ {%- else -%}
112
+ <warning>
113
+ The output of your last command was too long.
114
+ Please try a different command that produces less output.
115
+ If you're looking at a file you can try use head, tail or sed to view a smaller number of lines selectively.
116
+ If you're using grep or find and it produced too much output, you can use a more selective search pattern.
117
+ If you really need to see something from the full command's output, you can redirect output to a file and then search in that file.
118
+ </warning>
119
+ {%- set elided_chars = output.output | length - 10000 -%}
120
+ <output_head>
121
+ {{ output.output[:5000] }}
122
+ </output_head>
123
+ <elided_chars>
124
+ {{ elided_chars }} characters elided
125
+ </elided_chars>
126
+ <output_tail>
127
+ {{ output.output[-5000:] }}
128
+ </output_tail>
129
+ {%- endif -%}
130
+ format_error_template: |
131
+ Please always provide EXACTLY ONE action in triple backticks, found {{actions|length}} actions.
132
+ If you want to end the task, please issue the following command: `echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT`
133
+ without any other command.
134
+ Else, please format your response exactly as follows:
135
+
136
+ <response_example>
137
+ Here are some thoughts about why you want to perform the action.
138
+
139
+ ```bash
140
+ <action>
141
+ ```
142
+ </response_example>
143
+
144
+ Note: In rare cases, if you need to reference a similar format in your command, you might have
145
+ to proceed in two steps, first writing TRIPLEBACKTICKSBASH, then replacing them with ```bash.
146
+ step_limit: 0.
147
+ cost_limit: 3.
148
+ mode: confirm
149
+ environment:
150
+ env:
151
+ PAGER: cat
152
+ MANPAGER: cat
153
+ LESS: -R
154
+ PIP_PROGRESS_BAR: 'off'
155
+ TQDM_DISABLE: '1'
156
+ model:
157
+ model_kwargs:
158
+ drop_params: true
@@ -1,5 +1,6 @@
1
1
  import json
2
2
  import logging
3
+ import os
3
4
  from dataclasses import dataclass, field
4
5
  from pathlib import Path
5
6
  from typing import Any
@@ -22,7 +23,7 @@ logger = logging.getLogger("litellm_model")
22
23
  class LitellmModelConfig:
23
24
  model_name: str
24
25
  model_kwargs: dict[str, Any] = field(default_factory=dict)
25
- litellm_model_registry: Path | None = None
26
+ litellm_model_registry: Path | str | None = os.getenv("LITELLM_MODEL_REGISTRY_PATH")
26
27
 
27
28
 
28
29
  class LitellmModel:
@@ -30,7 +31,7 @@ class LitellmModel:
30
31
  self.config = LitellmModelConfig(**kwargs)
31
32
  self.cost = 0.0
32
33
  self.n_calls = 0
33
- if self.config.litellm_model_registry is not None:
34
+ if self.config.litellm_model_registry and Path(self.config.litellm_model_registry).is_file():
34
35
  litellm.utils.register_model(json.loads(Path(self.config.litellm_model_registry).read_text()))
35
36
 
36
37
  @retry(
File without changes
File without changes
@@ -3,6 +3,8 @@ It's identical to the one used in swe-agent.
3
3
  """
4
4
 
5
5
  import collections
6
+ import time
7
+ from datetime import timedelta
6
8
  from pathlib import Path
7
9
  from threading import Lock
8
10
 
@@ -17,7 +19,6 @@ from rich.progress import (
17
19
  TaskProgressColumn,
18
20
  TextColumn,
19
21
  TimeElapsedColumn,
20
- TimeRemainingColumn,
21
22
  )
22
23
  from rich.table import Table
23
24
 
@@ -49,6 +50,8 @@ class RunBatchProgressManager:
49
50
  """We need to map instance ID to the task ID that is used by the rich progress bar."""
50
51
 
51
52
  self._lock = Lock()
53
+ self._start_time = time.time()
54
+ self._total_instances = num_instances
52
55
 
53
56
  self._instances_by_exit_status = collections.defaultdict(list)
54
57
  self._main_progress_bar = Progress(
@@ -58,8 +61,7 @@ class RunBatchProgressManager:
58
61
  MofNCompleteColumn(),
59
62
  TaskProgressColumn(),
60
63
  TimeElapsedColumn(),
61
- TextColumn("[cyan]eta:[/cyan]"),
62
- TimeRemainingColumn(),
64
+ TextColumn("[cyan]{task.fields[eta]}[/cyan]"),
63
65
  # Wait 5 min before estimating speed
64
66
  speed_estimate_period=60 * 5,
65
67
  )
@@ -74,7 +76,7 @@ class RunBatchProgressManager:
74
76
  """
75
77
 
76
78
  self._main_task_id = self._main_progress_bar.add_task(
77
- "[cyan]Overall Progress", total=num_instances, total_cost="0.00"
79
+ "[cyan]Overall Progress", total=num_instances, total_cost="0.00", eta=""
78
80
  )
79
81
 
80
82
  self.render_group = Group(Table(), self._task_progress_bar, self._main_progress_bar)
@@ -84,6 +86,16 @@ class RunBatchProgressManager:
84
86
  def n_completed(self) -> int:
85
87
  return sum(len(instances) for instances in self._instances_by_exit_status.values())
86
88
 
89
+ def _get_eta_text(self) -> str:
90
+ """Calculate estimated time remaining based on current progress."""
91
+ try:
92
+ estimated_remaining = (
93
+ (time.time() - self._start_time) / self.n_completed * (self._total_instances - self.n_completed)
94
+ )
95
+ return f"eta: {timedelta(seconds=int(estimated_remaining))}"
96
+ except ZeroDivisionError:
97
+ return ""
98
+
87
99
  def update_exit_status_table(self):
88
100
  # We cannot update the existing table, so we need to create a new one and
89
101
  # assign it back to the render group.
@@ -105,7 +117,9 @@ class RunBatchProgressManager:
105
117
  def _update_total_costs(self) -> None:
106
118
  with self._lock:
107
119
  self._main_progress_bar.update(
108
- self._main_task_id, total_cost=f"{minisweagent.models.GLOBAL_MODEL_STATS.cost:.2f}"
120
+ self._main_task_id,
121
+ total_cost=f"{minisweagent.models.GLOBAL_MODEL_STATS.cost:.2f}",
122
+ eta=self._get_eta_text(),
109
123
  )
110
124
 
111
125
  def update_instance_status(self, instance_id: str, message: str):
@@ -135,7 +149,7 @@ class RunBatchProgressManager:
135
149
  self._task_progress_bar.remove_task(self._spinner_tasks[instance_id])
136
150
  except KeyError:
137
151
  pass
138
- self._main_progress_bar.update(TaskID(0), advance=1)
152
+ self._main_progress_bar.update(TaskID(0), advance=1, eta=self._get_eta_text())
139
153
  self.update_exit_status_table()
140
154
  self._update_total_costs()
141
155
  if self._yaml_report_path is not None: