mini-swe-agent 1.1.1__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.1.dist-info → mini_swe_agent-1.2.0.dist-info}/METADATA +60 -44
- {mini_swe_agent-1.1.1.dist-info → mini_swe_agent-1.2.0.dist-info}/RECORD +11 -11
- minisweagent/__init__.py +1 -1
- minisweagent/agents/interactive.py +11 -8
- minisweagent/config/mini.yaml +3 -1
- minisweagent/run/extra/config.py +3 -0
- minisweagent/run/mini.py +7 -5
- {mini_swe_agent-1.1.1.dist-info → mini_swe_agent-1.2.0.dist-info}/WHEEL +0 -0
- {mini_swe_agent-1.1.1.dist-info → mini_swe_agent-1.2.0.dist-info}/entry_points.txt +0 -0
- {mini_swe_agent-1.1.1.dist-info → mini_swe_agent-1.2.0.dist-info}/licenses/LICENSE.md +0 -0
- {mini_swe_agent-1.1.1.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
|
|
@@ -32,9 +32,9 @@ Classifier: Development Status :: 3 - Alpha
|
|
|
32
32
|
Classifier: Operating System :: OS Independent
|
|
33
33
|
Classifier: Intended Audience :: Developers
|
|
34
34
|
Classifier: License :: OSI Approved :: MIT License
|
|
35
|
-
Classifier: Programming Language :: Python :: 3.
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
36
36
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
37
|
-
Requires-Python: >=3.
|
|
37
|
+
Requires-Python: >=3.10
|
|
38
38
|
Description-Content-Type: text/markdown
|
|
39
39
|
License-File: LICENSE.md
|
|
40
40
|
Requires-Dist: pyyaml
|
|
@@ -67,8 +67,8 @@ Requires-Dist: mkdocs-glightbox; extra == "dev"
|
|
|
67
67
|
Dynamic: license-file
|
|
68
68
|
|
|
69
69
|
<div align="center">
|
|
70
|
-
|
|
71
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
|
+
</div>
|
|
72
72
|
|
|
73
73
|
<h1>The 100 line AI agent that solves GitHub issues & more</h1>
|
|
74
74
|
|
|
@@ -76,27 +76,25 @@ 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
|
-
|
|
80
|
-
|
|
81
|
-
In 2024, [SWE-bench](https://github.com/swe-bench/SWE-bench) & [SWE-agent](https://github.com/swe-agent/swe-agent) helped kickstart the agentic AI for software revolution.
|
|
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.
|
|
82
80
|
|
|
83
81
|
We now ask: **What if SWE-agent was 100x smaller, and still worked nearly as well?**
|
|
84
82
|
|
|
85
83
|
`mini` is for
|
|
86
84
|
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
85
|
+
- **Researchers** who want to **benchmark, fine-tune or RL** without assumptions, bloat, or surprises
|
|
86
|
+
- **Developers** who like their tools like their scripts: **short, sharp, and readable**
|
|
87
|
+
- **Engineers** who want something **trivial to sandbox & to deploy anywhere**
|
|
90
88
|
|
|
91
89
|
Here's some details:
|
|
92
90
|
|
|
93
|
-
-
|
|
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),
|
|
94
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!
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
93
|
+
- **Powerful:** Resolves 65% of GitHub issues in the [SWE-bench verified benchmark](https://www.swebench.com/) (with Claude Sonnet 4).
|
|
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
|
+
- **Tested:** [](https://codecov.io/gh/SWE-agent/mini-swe-agent)
|
|
97
|
+
- **Cutting edge:** Built by the Princeton & Stanford team behind [SWE-bench](https://swebench.com) and [SWE-agent](https://swe-agent.com).
|
|
100
98
|
|
|
101
99
|
<details>
|
|
102
100
|
|
|
@@ -106,14 +104,15 @@ Here's some details:
|
|
|
106
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!
|
|
107
105
|
In fact, mini-SWE-agent
|
|
108
106
|
|
|
109
|
-
- Does not have any tools other than bash — it doesn't even use the tool-calling interface of the LMs.
|
|
110
|
-
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
|
|
111
109
|
of installing a single package — all it needs is bash.
|
|
112
|
-
- 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.
|
|
113
111
|
So there's no difference between the trajectory and the messages that you pass on to the LM.
|
|
114
|
-
|
|
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).
|
|
115
114
|
This makes it trivial to execute the actions in sandboxes (literally just switch out `subprocess.run` with `docker exec`) and to
|
|
116
|
-
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.
|
|
117
116
|
|
|
118
117
|
This makes it perfect as a baseline system and for a system that puts the language model (rather than
|
|
119
118
|
the agent scaffold) in the middle of our attention.
|
|
@@ -123,41 +122,42 @@ the agent scaffold) in the middle of our attention.
|
|
|
123
122
|
<details>
|
|
124
123
|
<summary>More motivation (as a tool)</summary>
|
|
125
124
|
|
|
126
|
-
Some agents are overfitted research artifacts.
|
|
127
|
-
Others are UI-heavy tools, highly optimized for a specific user experience.
|
|
128
|
-
Both variants are hard to understand.
|
|
125
|
+
Some agents are overfitted research artifacts. Others are UI-heavy frontend monsters.
|
|
129
126
|
|
|
130
|
-
`mini`
|
|
127
|
+
`mini` wants to be a hackable tool, not a black box.
|
|
131
128
|
|
|
132
129
|
- **Simple** enough to understand at a glance
|
|
133
130
|
- **Convenient** enough to use in daily workflows
|
|
134
131
|
- **Flexible** to extend
|
|
135
132
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
Unlike other agents (including our own [swe-agent](https://swe-agent.com/latest/)),
|
|
139
|
-
it is radically simpler, because it
|
|
133
|
+
Unlike other agents (including our own [swe-agent](https://swe-agent.com/latest/)), it is radically simpler, because it:
|
|
140
134
|
|
|
141
|
-
- Does not have any tools other than bash — it doesn't even use the tool-calling interface of the LMs.
|
|
142
|
-
|
|
143
|
-
|
|
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.
|
|
144
143
|
|
|
145
144
|
</details>
|
|
146
145
|
|
|
147
146
|
<details>
|
|
148
147
|
<summary>Should I use SWE-agent or mini-SWE-agent?</summary>
|
|
149
148
|
|
|
150
|
-
You should use
|
|
151
|
-
|
|
152
|
-
- You need specific tools or want to experiment with different tools
|
|
153
|
-
- You want to experiment with different history processors
|
|
154
|
-
- You want very powerful yaml configuration without touching code
|
|
155
|
-
|
|
156
|
-
You should use [`mini-swe-agent`](https://mini-swe-agent.com/latest/) if
|
|
149
|
+
You should use `mini-swe-agent` if
|
|
157
150
|
|
|
158
151
|
- You want a quick command line tool that works locally
|
|
159
152
|
- You want an agent with a very simple control flow
|
|
160
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
|
|
161
161
|
|
|
162
162
|
What you get with both
|
|
163
163
|
|
|
@@ -240,21 +240,23 @@ agent.run("Write a sudoku game")
|
|
|
240
240
|
</tr>
|
|
241
241
|
</table>
|
|
242
242
|
|
|
243
|
-
##
|
|
243
|
+
## Let's get started!
|
|
244
244
|
|
|
245
|
-
Install + run in virtual environment
|
|
245
|
+
Option 1: Install + run in virtual environment
|
|
246
246
|
|
|
247
247
|
```bash
|
|
248
|
+
pip install uv && uvx mini-swe-agent [-v]
|
|
249
|
+
# or
|
|
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
|
|
@@ -272,7 +274,21 @@ Read more in our [documentation](https://mini-swe-agent.com/latest/):
|
|
|
272
274
|
* [FAQ](https://mini-swe-agent.com/latest/faq/)
|
|
273
275
|
* [Contribute!](https://mini-swe-agent.com/latest/contributing/)
|
|
274
276
|
|
|
275
|
-
##
|
|
277
|
+
## Bottom line
|
|
278
|
+
|
|
279
|
+
If you found this work helpful, please consider citing the [SWE-agent paper](https://arxiv.org/abs/2405.15793) in your work:
|
|
280
|
+
|
|
281
|
+
```bibtex
|
|
282
|
+
@inproceedings{yang2024sweagent,
|
|
283
|
+
title={{SWE}-agent: Agent-Computer Interfaces Enable Automated Software Engineering},
|
|
284
|
+
author={John Yang and Carlos E Jimenez and Alexander Wettig and Kilian Lieret and Shunyu Yao and Karthik R Narasimhan and Ofir Press},
|
|
285
|
+
booktitle={The Thirty-eighth Annual Conference on Neural Information Processing Systems},
|
|
286
|
+
year={2024},
|
|
287
|
+
url={https://arxiv.org/abs/2405.15793}
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
More agentic AI:
|
|
276
292
|
|
|
277
293
|
<div align="center">
|
|
278
294
|
<a href="https://github.com/SWE-agent/SWE-agent"><img src="https://github.com/SWE-agent/mini-swe-agent/raw/main/docs/assets/sweagent_logo_text_below.svg" alt="SWE-agent" height="120px"></a>
|
|
@@ -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,17 +30,17 @@ 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
|
-
minisweagent/run/extra/config.py,sha256=
|
|
36
|
+
minisweagent/run/extra/config.py,sha256=paMHfplhKsqNmzhCmozxhXWHvBzBCUlwUWD8N7ytCPc,3277
|
|
37
37
|
minisweagent/run/extra/swebench.py,sha256=x50nFj4tdXkdoad6TkK7tP8CSgf-WkrY0IdSMe8_oX0,9564
|
|
38
38
|
minisweagent/run/extra/swebench_single.py,sha256=L3Kk4G65o3MCPLMEwGNIs77-AFf6Lfc8o1oxrbN-ZWM,1991
|
|
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/extra/config.py
CHANGED
|
@@ -58,6 +58,9 @@ def setup():
|
|
|
58
58
|
).strip()
|
|
59
59
|
if default_model:
|
|
60
60
|
set_key(global_config_file, "MSWEA_MODEL_NAME", default_model)
|
|
61
|
+
console.print(
|
|
62
|
+
"[bold yellow]If you already have your API keys set as environment variables, you can ignore the next question.[/bold yellow]"
|
|
63
|
+
)
|
|
61
64
|
key_name = prompt("Enter your API key name (e.g., ANTHROPIC_API_KEY): ").strip()
|
|
62
65
|
key_value = None
|
|
63
66
|
if key_name:
|
minisweagent/run/mini.py
CHANGED
|
@@ -48,8 +48,6 @@ def run_interactive(model: Model, env: Environment, agent_config: dict, task: st
|
|
|
48
48
|
exit_status, result = None, None
|
|
49
49
|
try:
|
|
50
50
|
exit_status, result = agent.run(task)
|
|
51
|
-
except KeyboardInterrupt:
|
|
52
|
-
console.print("\n[bold red]KeyboardInterrupt -- goodbye[/bold red]")
|
|
53
51
|
finally:
|
|
54
52
|
if output:
|
|
55
53
|
save_traj(agent, output, exit_status=exit_status, result=result)
|
|
@@ -65,10 +63,9 @@ def run_textual(model: Model, env: Environment, agent_config: dict, task: str, o
|
|
|
65
63
|
)
|
|
66
64
|
try:
|
|
67
65
|
agent_app.run()
|
|
68
|
-
except KeyboardInterrupt:
|
|
69
|
-
typer.echo("\nKeyboardInterrupt -- goodbye")
|
|
70
66
|
finally:
|
|
71
|
-
|
|
67
|
+
if output:
|
|
68
|
+
save_traj(agent_app.agent, output, exit_status=agent_app.exit_status, result=agent_app.result)
|
|
72
69
|
|
|
73
70
|
|
|
74
71
|
@app.command(help=__doc__)
|
|
@@ -85,6 +82,9 @@ def main(
|
|
|
85
82
|
cost_limit: float | None = typer.Option(None, "-l", "--cost-limit", help="Cost limit. Set to 0 to disable."),
|
|
86
83
|
config_spec: Path = typer.Option(DEFAULT_CONFIG, "-c", "--config", help="Path to config file"),
|
|
87
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
|
+
),
|
|
88
88
|
) -> Any:
|
|
89
89
|
configure_if_first_time()
|
|
90
90
|
config = yaml.safe_load(get_config_path(config_spec).read_text())
|
|
@@ -105,6 +105,8 @@ def main(
|
|
|
105
105
|
config["agent"]["mode"] = "confirm" if not yolo else "yolo"
|
|
106
106
|
if cost_limit:
|
|
107
107
|
config["agent"]["cost_limit"] = cost_limit
|
|
108
|
+
if not visual and exit_immediately:
|
|
109
|
+
config["agent"]["confirm_exit"] = False
|
|
108
110
|
model = get_model(model_name, config.get("model", {}))
|
|
109
111
|
env = LocalEnvironment(**config.get("env", {}))
|
|
110
112
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|