mini-swe-agent 1.1.2__py3-none-any.whl → 1.2.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.
- {mini_swe_agent-1.1.2.dist-info → mini_swe_agent-1.2.0.dist-info}/METADATA +34 -36
- {mini_swe_agent-1.1.2.dist-info → mini_swe_agent-1.2.0.dist-info}/RECORD +10 -10
- minisweagent/__init__.py +1 -1
- minisweagent/agents/interactive.py +11 -8
- minisweagent/config/mini.yaml +3 -1
- minisweagent/run/mini.py +5 -0
- {mini_swe_agent-1.1.2.dist-info → mini_swe_agent-1.2.0.dist-info}/WHEEL +0 -0
- {mini_swe_agent-1.1.2.dist-info → mini_swe_agent-1.2.0.dist-info}/entry_points.txt +0 -0
- {mini_swe_agent-1.1.2.dist-info → mini_swe_agent-1.2.0.dist-info}/licenses/LICENSE.md +0 -0
- {mini_swe_agent-1.1.2.dist-info → mini_swe_agent-1.2.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mini-swe-agent
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.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
|
|
@@ -76,14 +76,14 @@ Dynamic: license-file
|
|
|
76
76
|
[](https://join.slack.com/t/swe-bench/shared_invite/zt-36pj9bu5s-o3_yXPZbaH2wVnxnss1EkQ)
|
|
77
77
|
[](https://pypi.org/project/mini-swe-agent/)
|
|
78
78
|
|
|
79
|
-
In 2024, [SWE-bench](https://github.com/swe-bench/SWE-bench) & [SWE-agent](https://github.com/swe-agent/swe-agent) helped kickstart the
|
|
79
|
+
In 2024, [SWE-bench](https://github.com/swe-bench/SWE-bench) & [SWE-agent](https://github.com/swe-agent/swe-agent) helped kickstart the coding agent revolution.
|
|
80
80
|
|
|
81
81
|
We now ask: **What if SWE-agent was 100x smaller, and still worked nearly as well?**
|
|
82
82
|
|
|
83
83
|
`mini` is for
|
|
84
84
|
|
|
85
85
|
- **Researchers** who want to **benchmark, fine-tune or RL** without assumptions, bloat, or surprises
|
|
86
|
-
- **
|
|
86
|
+
- **Developers** who like their tools like their scripts: **short, sharp, and readable**
|
|
87
87
|
- **Engineers** who want something **trivial to sandbox & to deploy anywhere**
|
|
88
88
|
|
|
89
89
|
Here's some details:
|
|
@@ -91,8 +91,8 @@ Here's some details:
|
|
|
91
91
|
- **Minimal**: Just [100 lines of python](https://github.com/SWE-agent/mini-swe-agent/blob/main/src/minisweagent/agents/default.py) (+100 total for [env](https://github.com/SWE-agent/mini-swe-agent/blob/main/src/minisweagent/environments/local.py),
|
|
92
92
|
[model](https://github.com/SWE-agent/mini-swe-agent/blob/main/src/minisweagent/models/litellm_model.py), [script](https://github.com/SWE-agent/mini-swe-agent/blob/main/src/minisweagent/run/hello_world.py)) — no fancy dependencies!
|
|
93
93
|
- **Powerful:** Resolves 65% of GitHub issues in the [SWE-bench verified benchmark](https://www.swebench.com/) (with Claude Sonnet 4).
|
|
94
|
-
- **
|
|
95
|
-
- **
|
|
94
|
+
- **Convenient:** Comes with UIs that turn this into your daily dev swiss army knife!
|
|
95
|
+
- **Deployable:** In addition to local envs, you can use **docker**, **podman**, **singularity**, **apptainer**, and more
|
|
96
96
|
- **Tested:** [](https://codecov.io/gh/SWE-agent/mini-swe-agent)
|
|
97
97
|
- **Cutting edge:** Built by the Princeton & Stanford team behind [SWE-bench](https://swebench.com) and [SWE-agent](https://swe-agent.com).
|
|
98
98
|
|
|
@@ -104,14 +104,15 @@ Here's some details:
|
|
|
104
104
|
However, one year later, as LMs have become more capable, a lot of this is not needed at all to build a useful agent!
|
|
105
105
|
In fact, mini-SWE-agent
|
|
106
106
|
|
|
107
|
-
- Does not have any tools other than bash — it doesn't even use the tool-calling interface of the LMs.
|
|
108
|
-
This means that you can run it with literally any model. When running in sandboxed environments you also don't need to
|
|
107
|
+
- **Does not have any tools other than bash** — it doesn't even use the tool-calling interface of the LMs.
|
|
108
|
+
This means that you can run it with literally any model. When running in sandboxed environments you also don't need to take care
|
|
109
109
|
of installing a single package — all it needs is bash.
|
|
110
|
-
- Has a completely linear history — every step of the agent just appends to the messages and that's it.
|
|
110
|
+
- **Has a completely linear history** — every step of the agent just appends to the messages and that's it.
|
|
111
111
|
So there's no difference between the trajectory and the messages that you pass on to the LM.
|
|
112
|
-
|
|
112
|
+
Great for debugging & fine-tuning.
|
|
113
|
+
- **Executes actions with `subprocess.run`** — every action is completely independent (as opposed to keeping a stateful shell session running).
|
|
113
114
|
This makes it trivial to execute the actions in sandboxes (literally just switch out `subprocess.run` with `docker exec`) and to
|
|
114
|
-
scale up effortlessly.
|
|
115
|
+
scale up effortlessly. Seriously, this is [a big deal](https://mini-swe-agent.com/latest/faq/#why-no-shell-session), trust me.
|
|
115
116
|
|
|
116
117
|
This makes it perfect as a baseline system and for a system that puts the language model (rather than
|
|
117
118
|
the agent scaffold) in the middle of our attention.
|
|
@@ -121,41 +122,42 @@ the agent scaffold) in the middle of our attention.
|
|
|
121
122
|
<details>
|
|
122
123
|
<summary>More motivation (as a tool)</summary>
|
|
123
124
|
|
|
124
|
-
Some agents are overfitted research artifacts.
|
|
125
|
-
Others are UI-heavy tools, highly optimized for a specific user experience.
|
|
126
|
-
Both variants are hard to understand.
|
|
125
|
+
Some agents are overfitted research artifacts. Others are UI-heavy frontend monsters.
|
|
127
126
|
|
|
128
|
-
`mini`
|
|
127
|
+
`mini` wants to be a hackable tool, not a black box.
|
|
129
128
|
|
|
130
129
|
- **Simple** enough to understand at a glance
|
|
131
130
|
- **Convenient** enough to use in daily workflows
|
|
132
131
|
- **Flexible** to extend
|
|
133
132
|
|
|
134
|
-
|
|
133
|
+
Unlike other agents (including our own [swe-agent](https://swe-agent.com/latest/)), it is radically simpler, because it:
|
|
135
134
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
-
|
|
141
|
-
|
|
135
|
+
- **Does not have any tools other than bash** — it doesn't even use the tool-calling interface of the LMs.
|
|
136
|
+
Instead of implementing custom tools for every specific thing the agent might want to do, the focus is fully on the LM utilizing the shell to its full potential.
|
|
137
|
+
Want it to do something specific like opening a PR?
|
|
138
|
+
Just tell the LM to figure it out rather than spending time to implement it in the agent.
|
|
139
|
+
- **Executes actions with `subprocess.run`** — every action is completely independent (as opposed to keeping a stateful shell session running).
|
|
140
|
+
This is [a big deal](https://mini-swe-agent.com/latest/faq/#why-no-shell-session) for the stability of the agent, trust me.
|
|
141
|
+
- **Has a completely linear history** — every step of the agent just appends to the messages that are passed to the LM in the next step and that's it.
|
|
142
|
+
This is great for debugging and understanding what the LM is prompted with.
|
|
142
143
|
|
|
143
144
|
</details>
|
|
144
145
|
|
|
145
146
|
<details>
|
|
146
147
|
<summary>Should I use SWE-agent or mini-SWE-agent?</summary>
|
|
147
148
|
|
|
148
|
-
You should use
|
|
149
|
-
|
|
150
|
-
- You need specific tools or want to experiment with different tools
|
|
151
|
-
- You want to experiment with different history processors
|
|
152
|
-
- You want very powerful yaml configuration without touching code
|
|
153
|
-
|
|
154
|
-
You should use [`mini-swe-agent`](https://mini-swe-agent.com/latest/) if
|
|
149
|
+
You should use `mini-swe-agent` if
|
|
155
150
|
|
|
156
151
|
- You want a quick command line tool that works locally
|
|
157
152
|
- You want an agent with a very simple control flow
|
|
158
153
|
- You want even faster, simpler & more stable sandboxing & benchmark evaluations
|
|
154
|
+
- You are doing FT or RL and don't want to overfit to a specific agent scaffold
|
|
155
|
+
|
|
156
|
+
You should use `swe-agent` if
|
|
157
|
+
|
|
158
|
+
- You need specific tools or want to experiment with different tools
|
|
159
|
+
- You want to experiment with different history processors
|
|
160
|
+
- You want very powerful yaml configuration without touching code
|
|
159
161
|
|
|
160
162
|
What you get with both
|
|
161
163
|
|
|
@@ -240,7 +242,7 @@ agent.run("Write a sudoku game")
|
|
|
240
242
|
|
|
241
243
|
## Let's get started!
|
|
242
244
|
|
|
243
|
-
Install + run in virtual environment
|
|
245
|
+
Option 1: Install + run in virtual environment
|
|
244
246
|
|
|
245
247
|
```bash
|
|
246
248
|
pip install uv && uvx mini-swe-agent [-v]
|
|
@@ -248,13 +250,13 @@ pip install uv && uvx mini-swe-agent [-v]
|
|
|
248
250
|
pip install pipx && pipx ensurepath && pipx run mini-swe-agent [-v]
|
|
249
251
|
```
|
|
250
252
|
|
|
251
|
-
|
|
253
|
+
Option 2: Install in current environment
|
|
252
254
|
|
|
253
255
|
```bash
|
|
254
256
|
pip install mini-swe-agent && mini [-v]
|
|
255
257
|
```
|
|
256
258
|
|
|
257
|
-
|
|
259
|
+
Option 3: Install from source
|
|
258
260
|
|
|
259
261
|
```bash
|
|
260
262
|
git clone https://github.com/SWE-agent/mini-swe-agent.git
|
|
@@ -274,10 +276,7 @@ Read more in our [documentation](https://mini-swe-agent.com/latest/):
|
|
|
274
276
|
|
|
275
277
|
## Bottom line
|
|
276
278
|
|
|
277
|
-
If you found this work helpful, please consider citing
|
|
278
|
-
|
|
279
|
-
<details>
|
|
280
|
-
<summary> SWE-agent citation</summary>
|
|
279
|
+
If you found this work helpful, please consider citing the [SWE-agent paper](https://arxiv.org/abs/2405.15793) in your work:
|
|
281
280
|
|
|
282
281
|
```bibtex
|
|
283
282
|
@inproceedings{yang2024sweagent,
|
|
@@ -288,7 +287,6 @@ If you found this work helpful, please consider citing
|
|
|
288
287
|
url={https://arxiv.org/abs/2405.15793}
|
|
289
288
|
}
|
|
290
289
|
```
|
|
291
|
-
</details>
|
|
292
290
|
|
|
293
291
|
More agentic AI:
|
|
294
292
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
mini_swe_agent-1.
|
|
2
|
-
minisweagent/__init__.py,sha256=
|
|
1
|
+
mini_swe_agent-1.2.0.dist-info/licenses/LICENSE.md,sha256=D3luWPkdHAe7LBsdD4vzqDAXw6Xewb3G-uczss0uh1s,1094
|
|
2
|
+
minisweagent/__init__.py,sha256=O834rP05yuUp1YEVIdVhl0wEGk2r43BSKUTGg7iACJU,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
6
|
minisweagent/agents/default.py,sha256=6TZUfKch6e_7m05BXmjqUjV-k068s6ldg7T6zJBbQW8,5438
|
|
7
|
-
minisweagent/agents/interactive.py,sha256=
|
|
7
|
+
minisweagent/agents/interactive.py,sha256=_DCBabdwdIR4gAojT_TaQW2MSFtmBq997mwmiDGYdRA,7327
|
|
8
8
|
minisweagent/agents/interactive_textual.py,sha256=zzNsq1OkEmrBFVK3t1dxnrE7W7xU7Vc-WN47bxZcDIk,12657
|
|
9
9
|
minisweagent/config/README.md,sha256=tPruhnQDhZ8ugc1FNPKk9tVMRltmmIjdYgvHCmN-3Hs,354
|
|
10
10
|
minisweagent/config/__init__.py,sha256=UfORdQID1Ek_dduZlybUsIKJjihImkSqNU5tIjpw0hk,694
|
|
11
11
|
minisweagent/config/default.yaml,sha256=AGhcIq6X6n5Fs71ufO3B6CtZ4PS877tCxkPkrWR5Ylg,4497
|
|
12
12
|
minisweagent/config/github_issue.yaml,sha256=evvu3AJ52tXYSdami9_B8zfazOAE2r2XXkzVmScBoKc,4539
|
|
13
13
|
minisweagent/config/mini.tcss,sha256=ThSOtS6JpXxqEYGX69TLy6gPZzuijngsNLI6SjnEJLY,1821
|
|
14
|
-
minisweagent/config/mini.yaml,sha256=
|
|
14
|
+
minisweagent/config/mini.yaml,sha256=U-mTAgnrT2mn9_VxKSnLlq26Einxq0grqiY3esTtmGg,4983
|
|
15
15
|
minisweagent/config/extra/__init__.py,sha256=e1MoAlDn_wc9HnXNoncf1P-B4DQ-iRf6n7Q_txjZGRI,52
|
|
16
16
|
minisweagent/config/extra/swebench.yaml,sha256=LNpTahpul6HL0HozgAAz-C6kpX3wZA7Tg8uE-ZmgrF4,7577
|
|
17
17
|
minisweagent/environments/__init__.py,sha256=g5mKac1YgVOZVKvmiAiuyPSevRYpI69V4vYrbCH3gsI,54
|
|
@@ -30,7 +30,7 @@ minisweagent/run/__init__.py,sha256=WIoYgHVl7iZF2YncrfV3IttupG6P5KogroKHKECka3A,
|
|
|
30
30
|
minisweagent/run/github_issue.py,sha256=GWOkGM09jOYV93p6xIM_kKWmC1yP_d5lprafWlqoBN0,2748
|
|
31
31
|
minisweagent/run/hello_world.py,sha256=erLnEwNmPFLxq3-8zyv66Vy1kIqMqQf97vISX7LrQXg,959
|
|
32
32
|
minisweagent/run/inspector.py,sha256=QnY3oYzm-yq3w9Jzs112Lco2Rg84vSocAWrQRVz_1lc,7127
|
|
33
|
-
minisweagent/run/mini.py,sha256=
|
|
33
|
+
minisweagent/run/mini.py,sha256=9EzTUT1cra6sHkqUTGu5oqx9Esgt_XOSGW9cxFyXLd8,4339
|
|
34
34
|
minisweagent/run/mini_extra.py,sha256=ecA1PnTWElpO60G9RktvVLtUOf3bZ_ESmnSttS6izhQ,1465
|
|
35
35
|
minisweagent/run/extra/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
36
|
minisweagent/run/extra/config.py,sha256=paMHfplhKsqNmzhCmozxhXWHvBzBCUlwUWD8N7ytCPc,3277
|
|
@@ -39,8 +39,8 @@ minisweagent/run/extra/swebench_single.py,sha256=L3Kk4G65o3MCPLMEwGNIs77-AFf6Lfc
|
|
|
39
39
|
minisweagent/run/extra/utils/batch_progress.py,sha256=u__khJ-fipZLxTJu43LamGAtPUCqEZYEi8J7SfH7X6A,6211
|
|
40
40
|
minisweagent/run/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
41
|
minisweagent/run/utils/save.py,sha256=3_kuutw-uAGIhEoDawA3_FPeSz1vWuCWpJl80j5u7_s,893
|
|
42
|
-
mini_swe_agent-1.
|
|
43
|
-
mini_swe_agent-1.
|
|
44
|
-
mini_swe_agent-1.
|
|
45
|
-
mini_swe_agent-1.
|
|
46
|
-
mini_swe_agent-1.
|
|
42
|
+
mini_swe_agent-1.2.0.dist-info/METADATA,sha256=4JI2AGHnBGJhAtkSFhmTBwH7-2QO0ymepR2g8TQGaAA,13459
|
|
43
|
+
mini_swe_agent-1.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
44
|
+
mini_swe_agent-1.2.0.dist-info/entry_points.txt,sha256=d1_yRbTaGjs1UXHa6JQK0sKDGBIVGm8oeW0k2kfbJgQ,182
|
|
45
|
+
mini_swe_agent-1.2.0.dist-info/top_level.txt,sha256=zKF4t8bFpV87fdVABZt2Da-vnb4Vkh_CxkwQx5YT4Ew,13
|
|
46
|
+
mini_swe_agent-1.2.0.dist-info/RECORD,,
|
minisweagent/__init__.py
CHANGED
|
@@ -28,6 +28,8 @@ class InteractiveAgentConfig(AgentConfig):
|
|
|
28
28
|
"""Whether to confirm actions."""
|
|
29
29
|
whitelist_actions: list[str] = field(default_factory=list)
|
|
30
30
|
"""Never confirm actions that match these regular expressions."""
|
|
31
|
+
confirm_exit: bool = True
|
|
32
|
+
"""If the agent wants to finish, do we ask for confirmation from user?"""
|
|
31
33
|
|
|
32
34
|
|
|
33
35
|
class InteractiveAgent(DefaultAgent):
|
|
@@ -137,12 +139,13 @@ class InteractiveAgent(DefaultAgent):
|
|
|
137
139
|
try:
|
|
138
140
|
return super().has_finished(output)
|
|
139
141
|
except Submitted as e:
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
142
|
+
if self.config.confirm_exit:
|
|
143
|
+
console.print(
|
|
144
|
+
"[bold green]Agent wants to finish.[/bold green] "
|
|
145
|
+
"[green]Type a comment to give it a new task or press enter to quit.\n"
|
|
146
|
+
"[bold yellow]>[/bold yellow] ",
|
|
147
|
+
end="",
|
|
148
|
+
)
|
|
149
|
+
if new_task := self._prompt_and_handle_special("").strip():
|
|
150
|
+
raise NonTerminatingException(f"The user added a new task: {new_task}")
|
|
148
151
|
raise e
|
minisweagent/config/mini.yaml
CHANGED
|
@@ -23,7 +23,9 @@ agent:
|
|
|
23
23
|
You can execute bash commands and edit files to implement the necessary changes.
|
|
24
24
|
|
|
25
25
|
## Recommended Workflow
|
|
26
|
-
1. Analyze the codebase by finding and reading relevant files
|
|
26
|
+
1. Analyze the codebase by finding and reading relevant files.
|
|
27
|
+
If present, you might want to take a look at the following files that set additional guidelines
|
|
28
|
+
for your work: CLAUDE.md, .cursor/rules/<relevant rules>
|
|
27
29
|
2. Create a script to reproduce the issue
|
|
28
30
|
3. Edit the source code to resolve the issue
|
|
29
31
|
4. Verify your fix works by running your script again
|
minisweagent/run/mini.py
CHANGED
|
@@ -82,6 +82,9 @@ def main(
|
|
|
82
82
|
cost_limit: float | None = typer.Option(None, "-l", "--cost-limit", help="Cost limit. Set to 0 to disable."),
|
|
83
83
|
config_spec: Path = typer.Option(DEFAULT_CONFIG, "-c", "--config", help="Path to config file"),
|
|
84
84
|
output: Path | None = typer.Option(None, "-o", "--output", help="Output file"),
|
|
85
|
+
exit_immediately: bool = typer.Option(
|
|
86
|
+
False, "--exit-immediately", help="Exit immediately when the agent wants to finish instead of prompting."
|
|
87
|
+
),
|
|
85
88
|
) -> Any:
|
|
86
89
|
configure_if_first_time()
|
|
87
90
|
config = yaml.safe_load(get_config_path(config_spec).read_text())
|
|
@@ -102,6 +105,8 @@ def main(
|
|
|
102
105
|
config["agent"]["mode"] = "confirm" if not yolo else "yolo"
|
|
103
106
|
if cost_limit:
|
|
104
107
|
config["agent"]["cost_limit"] = cost_limit
|
|
108
|
+
if not visual and exit_immediately:
|
|
109
|
+
config["agent"]["confirm_exit"] = False
|
|
105
110
|
model = get_model(model_name, config.get("model", {}))
|
|
106
111
|
env = LocalEnvironment(**config.get("env", {}))
|
|
107
112
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|