mini-swe-agent 1.5.0__tar.gz → 1.6.0__tar.gz
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.
- {mini_swe_agent-1.5.0/src/mini_swe_agent.egg-info → mini_swe_agent-1.6.0}/PKG-INFO +4 -2
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/README.md +3 -1
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0/src/mini_swe_agent.egg-info}/PKG-INFO +4 -2
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/mini_swe_agent.egg-info/SOURCES.txt +3 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/__init__.py +1 -1
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/config/README.md +2 -1
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/config/__init__.py +3 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/config/default.yaml +18 -2
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/config/mini.yaml +9 -10
- mini_swe_agent-1.6.0/src/minisweagent/config/mini_no_temp.yaml +160 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/models/litellm_model.py +3 -2
- mini_swe_agent-1.6.0/src/minisweagent/run/extra/utils/__init__.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/run/extra/utils/batch_progress.py +20 -6
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/run/mini.py +2 -1
- mini_swe_agent-1.6.0/src/minisweagent/run/utils/__init__.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/LICENSE.md +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/pyproject.toml +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/setup.cfg +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/mini_swe_agent.egg-info/dependency_links.txt +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/mini_swe_agent.egg-info/entry_points.txt +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/mini_swe_agent.egg-info/requires.txt +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/mini_swe_agent.egg-info/top_level.txt +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/__main__.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/agents/__init__.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/agents/default.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/agents/interactive.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/agents/interactive_textual.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/config/extra/__init__.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/config/extra/swebench.yaml +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/config/github_issue.yaml +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/config/mini.tcss +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/environments/__init__.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/environments/docker.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/environments/extra/__init__.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/environments/extra/swerex_docker.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/environments/local.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/environments/singularity.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/models/__init__.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/models/anthropic.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/models/test_models.py +0 -0
- {mini_swe_agent-1.5.0/src/minisweagent/run/extra → mini_swe_agent-1.6.0/src/minisweagent/models/utils}/__init__.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/models/utils/cache_control.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/models/utils/key_per_thread.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/py.typed +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/run/__init__.py +0 -0
- {mini_swe_agent-1.5.0/src/minisweagent/run/utils → mini_swe_agent-1.6.0/src/minisweagent/run/extra}/__init__.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/run/extra/config.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/run/extra/swebench.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/run/extra/swebench_single.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/run/github_issue.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/run/hello_world.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/run/inspector.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/run/mini_extra.py +0 -0
- {mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/run/utils/save.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mini-swe-agent
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6.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
|
-
|
|
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
|
[](https://mini-swe-agent.com/latest/)
|
|
76
78
|
[](https://join.slack.com/t/swe-bench/shared_invite/zt-36pj9bu5s-o3_yXPZbaH2wVnxnss1EkQ)
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
<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>
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
# The 100 line AI agent that solves GitHub issues & more
|
|
6
|
+
|
|
7
|
+
📣 [Run `mini` with GPT-5 and friends: Read here](https://mini-swe-agent.com/latest/quickstart/#gpt-5)
|
|
6
8
|
|
|
7
9
|
[](https://mini-swe-agent.com/latest/)
|
|
8
10
|
[](https://join.slack.com/t/swe-bench/shared_invite/zt-36pj9bu5s-o3_yXPZbaH2wVnxnss1EkQ)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mini-swe-agent
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6.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
|
-
|
|
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
|
[](https://mini-swe-agent.com/latest/)
|
|
76
78
|
[](https://join.slack.com/t/swe-bench/shared_invite/zt-36pj9bu5s-o3_yXPZbaH2wVnxnss1EkQ)
|
|
@@ -20,6 +20,7 @@ src/minisweagent/config/default.yaml
|
|
|
20
20
|
src/minisweagent/config/github_issue.yaml
|
|
21
21
|
src/minisweagent/config/mini.tcss
|
|
22
22
|
src/minisweagent/config/mini.yaml
|
|
23
|
+
src/minisweagent/config/mini_no_temp.yaml
|
|
23
24
|
src/minisweagent/config/extra/__init__.py
|
|
24
25
|
src/minisweagent/config/extra/swebench.yaml
|
|
25
26
|
src/minisweagent/environments/__init__.py
|
|
@@ -32,6 +33,7 @@ src/minisweagent/models/__init__.py
|
|
|
32
33
|
src/minisweagent/models/anthropic.py
|
|
33
34
|
src/minisweagent/models/litellm_model.py
|
|
34
35
|
src/minisweagent/models/test_models.py
|
|
36
|
+
src/minisweagent/models/utils/__init__.py
|
|
35
37
|
src/minisweagent/models/utils/cache_control.py
|
|
36
38
|
src/minisweagent/models/utils/key_per_thread.py
|
|
37
39
|
src/minisweagent/run/__init__.py
|
|
@@ -44,6 +46,7 @@ src/minisweagent/run/extra/__init__.py
|
|
|
44
46
|
src/minisweagent/run/extra/config.py
|
|
45
47
|
src/minisweagent/run/extra/swebench.py
|
|
46
48
|
src/minisweagent/run/extra/swebench_single.py
|
|
49
|
+
src/minisweagent/run/extra/utils/__init__.py
|
|
47
50
|
src/minisweagent/run/extra/utils/batch_progress.py
|
|
48
51
|
src/minisweagent/run/utils/__init__.py
|
|
49
52
|
src/minisweagent/run/utils/save.py
|
|
@@ -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,
|
|
@@ -23,11 +23,16 @@ agent:
|
|
|
23
23
|
You can execute bash commands and edit files to implement the necessary changes.
|
|
24
24
|
|
|
25
25
|
## Recommended Workflow
|
|
26
|
+
|
|
27
|
+
This workflows should be done step-by-step so that you can iterate on your changes and any possible problems.
|
|
28
|
+
|
|
26
29
|
1. Analyze the codebase by finding and reading relevant files
|
|
27
30
|
2. Create a script to reproduce the issue
|
|
28
31
|
3. Edit the source code to resolve the issue
|
|
29
32
|
4. Verify your fix works by running your script again
|
|
30
33
|
5. Test edge cases to ensure your fix is robust
|
|
34
|
+
6. Submit your changes and finish your work by issuing the following command: `echo MINI_SWE_AGENT_FINAL_OUTPUT`.
|
|
35
|
+
Do not combine it with any other command. <important>After this command, you cannot continue working on this task.</important>
|
|
31
36
|
|
|
32
37
|
## Important Rules
|
|
33
38
|
|
|
@@ -35,8 +40,10 @@ agent:
|
|
|
35
40
|
2. The action must be enclosed in triple backticks
|
|
36
41
|
3. Directory or environment variable changes are not persistent. Every action is executed in a new subshell.
|
|
37
42
|
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
|
-
|
|
39
|
-
|
|
43
|
+
|
|
44
|
+
<system_information>
|
|
45
|
+
{{system}} {{release}} {{version}} {{machine}} {{processor}}
|
|
46
|
+
</system_information>
|
|
40
47
|
|
|
41
48
|
## Formatting your response
|
|
42
49
|
|
|
@@ -64,6 +71,12 @@ agent:
|
|
|
64
71
|
|
|
65
72
|
### Edit files with sed:
|
|
66
73
|
|
|
74
|
+
{%- if system == "Darwin" -%}
|
|
75
|
+
<important>
|
|
76
|
+
You are on MacOS. For all the below examples, you need to use `sed -i ''` instead of `sed -i`.
|
|
77
|
+
</important>
|
|
78
|
+
{%- endif -%}
|
|
79
|
+
|
|
67
80
|
```bash
|
|
68
81
|
# Replace all occurrences
|
|
69
82
|
sed -i 's/old_string/new_string/g' filename.py
|
|
@@ -128,6 +141,9 @@ agent:
|
|
|
128
141
|
<action>
|
|
129
142
|
```
|
|
130
143
|
</response_example>
|
|
144
|
+
|
|
145
|
+
Note: In rare cases, if you need to reference a similar format in your command, you might have
|
|
146
|
+
to proceed in two steps, first writing TRIPLEBACKTICKSBASH, then replacing them with ```bash.
|
|
131
147
|
step_limit: 0.
|
|
132
148
|
cost_limit: 0.
|
|
133
149
|
environment:
|
|
@@ -24,14 +24,15 @@ agent:
|
|
|
24
24
|
|
|
25
25
|
## Recommended Workflow
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
2.
|
|
31
|
-
3.
|
|
32
|
-
4.
|
|
33
|
-
5.
|
|
34
|
-
6.
|
|
27
|
+
This workflows should be done step-by-step so that you can iterate on your changes and any possible problems.
|
|
28
|
+
|
|
29
|
+
1. Analyze the codebase by finding and reading relevant files
|
|
30
|
+
2. Create a script to reproduce the issue
|
|
31
|
+
3. Edit the source code to resolve the issue
|
|
32
|
+
4. Verify your fix works by running your script again
|
|
33
|
+
5. Test edge cases to ensure your fix is robust
|
|
34
|
+
6. Submit your changes and finish your work by issuing the following command: `echo MINI_SWE_AGENT_FINAL_OUTPUT`.
|
|
35
|
+
Do not combine it with any other command. <important>After this command, you cannot continue working on this task.</important>
|
|
35
36
|
|
|
36
37
|
## Important Rules
|
|
37
38
|
|
|
@@ -39,8 +40,6 @@ agent:
|
|
|
39
40
|
2. The action must be enclosed in triple backticks
|
|
40
41
|
3. Directory or environment variable changes are not persistent. Every action is executed in a new subshell.
|
|
41
42
|
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
43
|
|
|
45
44
|
<system_information>
|
|
46
45
|
{{system}} {{release}} {{version}} {{machine}} {{processor}}
|
|
@@ -0,0 +1,160 @@
|
|
|
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
|
+
To finish, issue the following command: `echo MINI_SWE_AGENT_FINAL_OUTPUT`
|
|
20
|
+
without any other command.
|
|
21
|
+
instance_template: |
|
|
22
|
+
Please solve this issue: {{task}}
|
|
23
|
+
|
|
24
|
+
You can execute bash commands and edit files to implement the necessary changes.
|
|
25
|
+
|
|
26
|
+
## Recommended Workflow
|
|
27
|
+
|
|
28
|
+
This workflows should be done step-by-step so that you can iterate on your changes and any possible problems.
|
|
29
|
+
|
|
30
|
+
1. Analyze the codebase by finding and reading relevant files
|
|
31
|
+
2. Create a script to reproduce the issue
|
|
32
|
+
3. Edit the source code to resolve the issue
|
|
33
|
+
4. Verify your fix works by running your script again
|
|
34
|
+
5. Test edge cases to ensure your fix is robust
|
|
35
|
+
6. Submit your changes and finish your work by issuing the following command: `echo MINI_SWE_AGENT_FINAL_OUTPUT`.
|
|
36
|
+
Do not combine it with any other command. <important>After this command, you cannot continue working on this task.</important>
|
|
37
|
+
|
|
38
|
+
## Important Rules
|
|
39
|
+
|
|
40
|
+
1. Every response must contain exactly one action
|
|
41
|
+
2. The action must be enclosed in triple backticks
|
|
42
|
+
3. Directory or environment variable changes are not persistent. Every action is executed in a new subshell.
|
|
43
|
+
However, you can prefix any action with `MY_ENV_VAR=MY_VALUE cd /path/to/working/dir && ...` or write/load environment variables from files
|
|
44
|
+
|
|
45
|
+
<system_information>
|
|
46
|
+
{{system}} {{release}} {{version}} {{machine}} {{processor}}
|
|
47
|
+
</system_information>
|
|
48
|
+
|
|
49
|
+
## Formatting your response
|
|
50
|
+
|
|
51
|
+
Here is an example of a correct response:
|
|
52
|
+
|
|
53
|
+
<example_response>
|
|
54
|
+
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.
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
ls -la
|
|
58
|
+
```
|
|
59
|
+
</example_response>
|
|
60
|
+
|
|
61
|
+
## Useful command examples
|
|
62
|
+
|
|
63
|
+
### Create a new file:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
cat <<'EOF' > newfile.py
|
|
67
|
+
import numpy as np
|
|
68
|
+
hello = "world"
|
|
69
|
+
print(hello)
|
|
70
|
+
EOF
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Edit files with sed:
|
|
74
|
+
|
|
75
|
+
{%- if system == "Darwin" -%}
|
|
76
|
+
<important>
|
|
77
|
+
You are on MacOS. For all the below examples, you need to use `sed -i ''` instead of `sed -i`.
|
|
78
|
+
</important>
|
|
79
|
+
{%- endif -%}
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Replace all occurrences
|
|
83
|
+
sed -i 's/old_string/new_string/g' filename.py
|
|
84
|
+
|
|
85
|
+
# Replace only first occurrence
|
|
86
|
+
sed -i 's/old_string/new_string/' filename.py
|
|
87
|
+
|
|
88
|
+
# Replace first occurrence on line 1
|
|
89
|
+
sed -i '1s/old_string/new_string/' filename.py
|
|
90
|
+
|
|
91
|
+
# Replace all occurrences in lines 1-10
|
|
92
|
+
sed -i '1,10s/old_string/new_string/g' filename.py
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### View file content:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# View specific lines with numbers
|
|
99
|
+
nl -ba filename.py | sed -n '10,20p'
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Any other command you want to run
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
anything
|
|
106
|
+
```
|
|
107
|
+
action_observation_template: |
|
|
108
|
+
<returncode>{{output.returncode}}</returncode>
|
|
109
|
+
{% if output.output | length < 10000 -%}
|
|
110
|
+
<output>
|
|
111
|
+
{{ output.output -}}
|
|
112
|
+
</output>
|
|
113
|
+
{%- else -%}
|
|
114
|
+
<warning>
|
|
115
|
+
The output of your last command was too long.
|
|
116
|
+
Please try a different command that produces less output.
|
|
117
|
+
If you're looking at a file you can try use head, tail or sed to view a smaller number of lines selectively.
|
|
118
|
+
If you're using grep or find and it produced too much output, you can use a more selective search pattern.
|
|
119
|
+
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.
|
|
120
|
+
</warning>
|
|
121
|
+
{%- set elided_chars = output.output | length - 10000 -%}
|
|
122
|
+
<output_head>
|
|
123
|
+
{{ output.output[:5000] }}
|
|
124
|
+
</output_head>
|
|
125
|
+
<elided_chars>
|
|
126
|
+
{{ elided_chars }} characters elided
|
|
127
|
+
</elided_chars>
|
|
128
|
+
<output_tail>
|
|
129
|
+
{{ output.output[-5000:] }}
|
|
130
|
+
</output_tail>
|
|
131
|
+
{%- endif -%}
|
|
132
|
+
format_error_template: |
|
|
133
|
+
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`
|
|
135
|
+
without any other command.
|
|
136
|
+
Else, please format your response exactly as follows:
|
|
137
|
+
|
|
138
|
+
<response_example>
|
|
139
|
+
Here are some thoughts about why you want to perform the action.
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
<action>
|
|
143
|
+
```
|
|
144
|
+
</response_example>
|
|
145
|
+
|
|
146
|
+
Note: In rare cases, if you need to reference a similar format in your command, you might have
|
|
147
|
+
to proceed in two steps, first writing TRIPLEBACKTICKSBASH, then replacing them with ```bash.
|
|
148
|
+
step_limit: 0.
|
|
149
|
+
cost_limit: 3.
|
|
150
|
+
mode: confirm
|
|
151
|
+
environment:
|
|
152
|
+
env:
|
|
153
|
+
PAGER: cat
|
|
154
|
+
MANPAGER: cat
|
|
155
|
+
LESS: -R
|
|
156
|
+
PIP_PROGRESS_BAR: 'off'
|
|
157
|
+
TQDM_DISABLE: '1'
|
|
158
|
+
model:
|
|
159
|
+
model_kwargs:
|
|
160
|
+
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 =
|
|
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
|
|
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
|
{mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/run/extra/utils/batch_progress.py
RENAMED
|
@@ -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
|
|
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,
|
|
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:
|
|
@@ -118,7 +118,8 @@ def main(
|
|
|
118
118
|
model = get_model(model_name, config.get("model", {}))
|
|
119
119
|
env = LocalEnvironment(**config.get("env", {}))
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
# Both visual flag and the MSWEA_VISUAL_MODE_DEFAULT flip the mode, so it's essentially a XOR
|
|
122
|
+
if visual == (os.getenv("MSWEA_VISUAL_MODE_DEFAULT", "false") == "false"):
|
|
122
123
|
return run_textual(model, env, config["agent"], task, output) # type: ignore[arg-type]
|
|
123
124
|
else:
|
|
124
125
|
return run_interactive(model, env, config["agent"], task, output) # type: ignore[arg-type]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/mini_swe_agent.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/agents/interactive_textual.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/environments/extra/__init__.py
RENAMED
|
File without changes
|
{mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/environments/extra/swerex_docker.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/models/utils/cache_control.py
RENAMED
|
File without changes
|
{mini_swe_agent-1.5.0 → mini_swe_agent-1.6.0}/src/minisweagent/models/utils/key_per_thread.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|