mini-swe-agent 1.17.2__tar.gz → 1.17.4__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.
Files changed (66) hide show
  1. {mini_swe_agent-1.17.2/src/mini_swe_agent.egg-info → mini_swe_agent-1.17.4}/PKG-INFO +1 -1
  2. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4/src/mini_swe_agent.egg-info}/PKG-INFO +1 -1
  3. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/__init__.py +17 -2
  4. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/agents/default.py +11 -1
  5. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/models/litellm_model.py +1 -0
  6. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/models/litellm_response_api_model.py +4 -2
  7. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/models/openrouter_model.py +1 -0
  8. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/models/portkey_model.py +1 -0
  9. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/models/portkey_response_api_model.py +1 -0
  10. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/models/requesty_model.py +1 -0
  11. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/run/mini.py +1 -1
  12. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/LICENSE.md +0 -0
  13. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/README.md +0 -0
  14. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/pyproject.toml +0 -0
  15. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/setup.cfg +0 -0
  16. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/mini_swe_agent.egg-info/SOURCES.txt +0 -0
  17. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/mini_swe_agent.egg-info/dependency_links.txt +0 -0
  18. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/mini_swe_agent.egg-info/entry_points.txt +0 -0
  19. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/mini_swe_agent.egg-info/requires.txt +0 -0
  20. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/mini_swe_agent.egg-info/top_level.txt +0 -0
  21. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/__main__.py +0 -0
  22. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/agents/__init__.py +0 -0
  23. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/agents/interactive.py +0 -0
  24. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/agents/interactive_textual.py +0 -0
  25. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/config/README.md +0 -0
  26. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/config/__init__.py +0 -0
  27. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/config/default.yaml +0 -0
  28. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/config/extra/__init__.py +0 -0
  29. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/config/extra/swebench.yaml +0 -0
  30. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/config/extra/swebench_roulette.yaml +0 -0
  31. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/config/extra/swebench_xml.yaml +0 -0
  32. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/config/github_issue.yaml +0 -0
  33. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/config/mini.tcss +0 -0
  34. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/config/mini.yaml +0 -0
  35. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/environments/__init__.py +0 -0
  36. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/environments/docker.py +0 -0
  37. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/environments/extra/__init__.py +0 -0
  38. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/environments/extra/bubblewrap.py +0 -0
  39. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/environments/extra/swerex_docker.py +0 -0
  40. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/environments/local.py +0 -0
  41. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/environments/singularity.py +0 -0
  42. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/models/__init__.py +0 -0
  43. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/models/anthropic.py +0 -0
  44. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/models/extra/__init__.py +0 -0
  45. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/models/extra/roulette.py +0 -0
  46. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/models/test_models.py +0 -0
  47. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/models/utils/__init__.py +0 -0
  48. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/models/utils/cache_control.py +0 -0
  49. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/models/utils/key_per_thread.py +0 -0
  50. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/models/utils/openai_utils.py +0 -0
  51. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/py.typed +0 -0
  52. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/run/__init__.py +0 -0
  53. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/run/extra/__init__.py +0 -0
  54. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/run/extra/config.py +0 -0
  55. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/run/extra/swebench.py +0 -0
  56. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/run/extra/swebench_single.py +0 -0
  57. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/run/extra/utils/__init__.py +0 -0
  58. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/run/extra/utils/batch_progress.py +0 -0
  59. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/run/github_issue.py +0 -0
  60. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/run/hello_world.py +0 -0
  61. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/run/inspector.py +0 -0
  62. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/run/mini_extra.py +0 -0
  63. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/run/utils/__init__.py +0 -0
  64. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/run/utils/save.py +0 -0
  65. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/utils/__init__.py +0 -0
  66. {mini_swe_agent-1.17.2 → mini_swe_agent-1.17.4}/src/minisweagent/utils/log.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mini-swe-agent
3
- Version: 1.17.2
3
+ Version: 1.17.4
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mini-swe-agent
3
- Version: 1.17.2
3
+ Version: 1.17.4
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
@@ -8,7 +8,7 @@ This file provides:
8
8
  unless you want the static type checking.
9
9
  """
10
10
 
11
- __version__ = "1.17.2"
11
+ __version__ = "1.17.4"
12
12
 
13
13
  import os
14
14
  from pathlib import Path
@@ -17,6 +17,7 @@ from typing import Any, Protocol
17
17
  import dotenv
18
18
  from platformdirs import user_config_dir
19
19
  from rich.console import Console
20
+ from rich.panel import Panel
20
21
 
21
22
  from minisweagent.utils.log import logger
22
23
 
@@ -27,7 +28,21 @@ global_config_dir.mkdir(parents=True, exist_ok=True)
27
28
  global_config_file = Path(global_config_dir) / ".env"
28
29
 
29
30
  if not os.getenv("MSWEA_SILENT_STARTUP"):
30
- Console().print(
31
+ console = Console()
32
+ console.print(
33
+ Panel(
34
+ "[bold]mini-swe-agent v2.0 is coming soon.[/bold]\n\n"
35
+ "It will be even more flexible, extensible and performant. "
36
+ "However, [bold]breaking changes[/bold] were necessary.\n\n"
37
+ "To stay with the current major version for now, you can pin your dependency: "
38
+ "[bold white]mini-swe-agent~=1.0[/bold white]",
39
+ border_style="bold red",
40
+ title="BREAKING CHANGES AHEAD",
41
+ title_align="left",
42
+ expand=False,
43
+ )
44
+ )
45
+ console.print(
31
46
  f"👋 This is [bold green]mini-swe-agent[/bold green] version [bold green]{__version__}[/bold green].\n"
32
47
  f"Loading global config from [bold green]'{global_config_file}'[/bold green]"
33
48
  )
@@ -20,7 +20,15 @@ class AgentConfig:
20
20
  )
21
21
  timeout_template: str = (
22
22
  "The last command <command>{{action['action']}}</command> timed out and has been killed.\n"
23
- "The output of the command was:\n <output>\n{{output}}\n</output>\n"
23
+ "The output of the command was:\n"
24
+ "{% if output | length < 10000 -%}\n"
25
+ "<output>\n{{output}}\n</output>\n"
26
+ "{%- else -%}\n"
27
+ "<warning>Output was too long and has been truncated.</warning>\n"
28
+ "<output_head>\n{{ output[:5000] }}\n</output_head>\n"
29
+ "<elided_chars>{{ output | length - 10000 }} characters elided</elided_chars>\n"
30
+ "<output_tail>\n{{ output[-5000:] }}\n</output_tail>\n"
31
+ "{%- endif %}\n"
24
32
  "Please try another command and make sure to avoid those requiring interactive input."
25
33
  )
26
34
  format_error_template: str = "Please always provide EXACTLY ONE action in triple backticks."
@@ -127,4 +135,6 @@ class DefaultAgent:
127
135
  """Raises Submitted exception with final output if the agent has finished its task."""
128
136
  lines = output.get("output", "").lstrip().splitlines(keepends=True)
129
137
  if lines and lines[0].strip() in ["MINI_SWE_AGENT_FINAL_OUTPUT", "COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT"]:
138
+ if output.get("returncode", 0) != 0:
139
+ return # Command failed - let agent see error and retry
130
140
  raise Submitted("".join(lines[1:]))
@@ -41,6 +41,7 @@ class LitellmModel:
41
41
  litellm.utils.register_model(json.loads(Path(self.config.litellm_model_registry).read_text()))
42
42
 
43
43
  @retry(
44
+ reraise=True,
44
45
  stop=stop_after_attempt(int(os.getenv("MSWEA_MODEL_RETRY_STOP_AFTER_ATTEMPT", "10"))),
45
46
  wait=wait_exponential(multiplier=1, min=4, max=60),
46
47
  before_sleep=before_sleep_log(logger, logging.WARNING),
@@ -28,6 +28,7 @@ class LitellmResponseAPIModel(LitellmModel):
28
28
  self._previous_response_id: str | None = None
29
29
 
30
30
  @retry(
31
+ reraise=True,
31
32
  stop=stop_after_attempt(10),
32
33
  wait=wait_exponential(multiplier=1, min=4, max=60),
33
34
  before_sleep=before_sleep_log(logger, logging.WARNING),
@@ -45,9 +46,11 @@ class LitellmResponseAPIModel(LitellmModel):
45
46
  )
46
47
  def _query(self, messages: list[dict[str, str]], **kwargs):
47
48
  try:
49
+ # Remove 'timestamp' field added by agent - not supported by OpenAI responses API
50
+ clean_messages = [{"role": msg["role"], "content": msg["content"]} for msg in messages]
48
51
  resp = litellm.responses(
49
52
  model=self.config.model_name,
50
- input=messages if self._previous_response_id is None else messages[-1:],
53
+ input=clean_messages if self._previous_response_id is None else clean_messages[-1:],
51
54
  previous_response_id=self._previous_response_id,
52
55
  **(self.config.model_kwargs | kwargs),
53
56
  )
@@ -59,7 +62,6 @@ class LitellmResponseAPIModel(LitellmModel):
59
62
 
60
63
  def query(self, messages: list[dict[str, str]], **kwargs) -> dict:
61
64
  response = self._query(messages, **kwargs)
62
- print(response)
63
65
  text = coerce_responses_text(response)
64
66
  try:
65
67
  cost = litellm.cost_calculator.completion_cost(response, model=self.config.model_name)
@@ -56,6 +56,7 @@ class OpenRouterModel:
56
56
  self._api_key = os.getenv("OPENROUTER_API_KEY", "")
57
57
 
58
58
  @retry(
59
+ reraise=True,
59
60
  stop=stop_after_attempt(int(os.getenv("MSWEA_MODEL_RETRY_STOP_AFTER_ATTEMPT", "10"))),
60
61
  wait=wait_exponential(multiplier=1, min=4, max=60),
61
62
  before_sleep=before_sleep_log(logger, logging.WARNING),
@@ -74,6 +74,7 @@ class PortkeyModel:
74
74
  self.client = Portkey(**client_kwargs)
75
75
 
76
76
  @retry(
77
+ reraise=True,
77
78
  stop=stop_after_attempt(int(os.getenv("MSWEA_MODEL_RETRY_STOP_AFTER_ATTEMPT", "10"))),
78
79
  wait=wait_exponential(multiplier=1, min=4, max=60),
79
80
  before_sleep=before_sleep_log(logger, logging.WARNING),
@@ -30,6 +30,7 @@ class PortkeyResponseAPIModel(PortkeyModel):
30
30
  self._previous_response_id: str | None = None
31
31
 
32
32
  @retry(
33
+ reraise=True,
33
34
  stop=stop_after_attempt(int(os.getenv("MSWEA_MODEL_RETRY_STOP_AFTER_ATTEMPT", "10"))),
34
35
  wait=wait_exponential(multiplier=1, min=4, max=60),
35
36
  before_sleep=before_sleep_log(logger, logging.WARNING),
@@ -51,6 +51,7 @@ class RequestyModel:
51
51
  self._api_key = os.getenv("REQUESTY_API_KEY", "")
52
52
 
53
53
  @retry(
54
+ reraise=True,
54
55
  stop=stop_after_attempt(10),
55
56
  wait=wait_exponential(multiplier=1, min=4, max=60),
56
57
  before_sleep=before_sleep_log(logger, logging.WARNING),
@@ -84,7 +84,7 @@ def main(
84
84
  if model_class is not None:
85
85
  config.setdefault("model", {})["model_class"] = model_class
86
86
  model = get_model(model_name, config.get("model", {}))
87
- env = LocalEnvironment(**config.get("env", {}))
87
+ env = LocalEnvironment(**config.get("environment", {}))
88
88
 
89
89
  # Both visual flag and the MSWEA_VISUAL_MODE_DEFAULT flip the mode, so it's essentially a XOR
90
90
  agent_class = InteractiveAgent