mini-swe-agent 1.9.0__tar.gz → 1.9.1__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 (57) hide show
  1. {mini_swe_agent-1.9.0/src/mini_swe_agent.egg-info → mini_swe_agent-1.9.1}/PKG-INFO +2 -1
  2. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/pyproject.toml +1 -0
  3. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1/src/mini_swe_agent.egg-info}/PKG-INFO +2 -1
  4. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/mini_swe_agent.egg-info/requires.txt +1 -0
  5. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/__init__.py +13 -2
  6. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/agents/interactive.py +2 -2
  7. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/agents/interactive_textual.py +4 -4
  8. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/environments/docker.py +2 -4
  9. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/environments/singularity.py +2 -4
  10. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/run/extra/swebench.py +2 -2
  11. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/run/extra/swebench_single.py +7 -2
  12. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/run/mini.py +14 -17
  13. mini_swe_agent-1.9.1/src/minisweagent/utils/log.py +36 -0
  14. mini_swe_agent-1.9.0/src/minisweagent/utils/log.py +0 -32
  15. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/LICENSE.md +0 -0
  16. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/README.md +0 -0
  17. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/setup.cfg +0 -0
  18. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/mini_swe_agent.egg-info/SOURCES.txt +0 -0
  19. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/mini_swe_agent.egg-info/dependency_links.txt +0 -0
  20. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/mini_swe_agent.egg-info/entry_points.txt +0 -0
  21. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/mini_swe_agent.egg-info/top_level.txt +0 -0
  22. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/__main__.py +0 -0
  23. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/agents/__init__.py +0 -0
  24. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/agents/default.py +0 -0
  25. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/config/README.md +0 -0
  26. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/config/__init__.py +0 -0
  27. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/config/default.yaml +0 -0
  28. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/config/extra/__init__.py +0 -0
  29. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/config/extra/swebench.yaml +0 -0
  30. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/config/github_issue.yaml +0 -0
  31. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/config/mini.tcss +0 -0
  32. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/config/mini.yaml +0 -0
  33. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/config/mini_no_temp.yaml +0 -0
  34. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/environments/__init__.py +0 -0
  35. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/environments/extra/__init__.py +0 -0
  36. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/environments/extra/swerex_docker.py +0 -0
  37. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/environments/local.py +0 -0
  38. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/models/__init__.py +2 -2
  39. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/models/anthropic.py +0 -0
  40. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/models/litellm_model.py +0 -0
  41. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/models/test_models.py +0 -0
  42. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/models/utils/__init__.py +0 -0
  43. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/models/utils/cache_control.py +0 -0
  44. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/models/utils/key_per_thread.py +0 -0
  45. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/py.typed +0 -0
  46. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/run/__init__.py +0 -0
  47. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/run/extra/__init__.py +0 -0
  48. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/run/extra/config.py +0 -0
  49. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/run/extra/utils/__init__.py +0 -0
  50. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/run/extra/utils/batch_progress.py +0 -0
  51. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/run/github_issue.py +0 -0
  52. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/run/hello_world.py +0 -0
  53. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/run/inspector.py +0 -0
  54. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/run/mini_extra.py +0 -0
  55. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/run/utils/__init__.py +0 -0
  56. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/run/utils/save.py +0 -0
  57. {mini_swe_agent-1.9.0 → mini_swe_agent-1.9.1}/src/minisweagent/utils/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mini-swe-agent
3
- Version: 1.9.0
3
+ Version: 1.9.1
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
@@ -48,6 +48,7 @@ Requires-Dist: typer
48
48
  Requires-Dist: platformdirs
49
49
  Requires-Dist: textual
50
50
  Requires-Dist: prompt_toolkit
51
+ Requires-Dist: openai<=1.99.5
51
52
  Provides-Extra: full
52
53
  Requires-Dist: mini-swe-agent[dev]; extra == "full"
53
54
  Requires-Dist: swe-rex>=1.4.0; extra == "full"
@@ -42,6 +42,7 @@ dependencies = [
42
42
  "platformdirs",
43
43
  "textual",
44
44
  "prompt_toolkit",
45
+ "openai <= 1.99.5", # https://github.com/SWE-agent/mini-swe-agent/issues/446
45
46
  ]
46
47
 
47
48
  [project.optional-dependencies]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mini-swe-agent
3
- Version: 1.9.0
3
+ Version: 1.9.1
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
@@ -48,6 +48,7 @@ Requires-Dist: typer
48
48
  Requires-Dist: platformdirs
49
49
  Requires-Dist: textual
50
50
  Requires-Dist: prompt_toolkit
51
+ Requires-Dist: openai<=1.99.5
51
52
  Provides-Extra: full
52
53
  Requires-Dist: mini-swe-agent[dev]; extra == "full"
53
54
  Requires-Dist: swe-rex>=1.4.0; extra == "full"
@@ -9,6 +9,7 @@ typer
9
9
  platformdirs
10
10
  textual
11
11
  prompt_toolkit
12
+ openai<=1.99.5
12
13
 
13
14
  [dev]
14
15
  datasets
@@ -8,7 +8,7 @@ This file provides:
8
8
  unless you want the static type checking.
9
9
  """
10
10
 
11
- __version__ = "1.9.0"
11
+ __version__ = "1.9.1"
12
12
 
13
13
  import os
14
14
  from pathlib import Path
@@ -18,6 +18,8 @@ import dotenv
18
18
  from platformdirs import user_config_dir
19
19
  from rich.console import Console
20
20
 
21
+ from minisweagent.utils.log import logger
22
+
21
23
  package_dir = Path(__file__).resolve().parent
22
24
 
23
25
  global_config_dir = Path(os.getenv("MSWEA_GLOBAL_CONFIG_DIR") or user_config_dir("mini-swe-agent"))
@@ -68,4 +70,13 @@ class Agent(Protocol):
68
70
  def run(self, task: str, **kwargs) -> tuple[str, str]: ...
69
71
 
70
72
 
71
- __all__ = ["Agent", "Model", "Environment", "package_dir", "__version__", "global_config_file", "global_config_dir"]
73
+ __all__ = [
74
+ "Agent",
75
+ "Model",
76
+ "Environment",
77
+ "package_dir",
78
+ "__version__",
79
+ "global_config_file",
80
+ "global_config_dir",
81
+ "logger",
82
+ ]
@@ -39,9 +39,9 @@ class InteractiveAgent(DefaultAgent):
39
39
  super().__init__(*args, config_class=config_class, **kwargs)
40
40
  self.cost_last_confirmed = 0.0
41
41
 
42
- def add_message(self, role: str, content: str):
42
+ def add_message(self, role: str, content: str, **kwargs):
43
43
  # Extend supermethod to print messages
44
- super().add_message(role, content)
44
+ super().add_message(role, content, **kwargs)
45
45
  if role == "assistant":
46
46
  console.print(
47
47
  f"\n[red][bold]mini-swe-agent[/bold] (step [bold]{self.model.n_calls}[/bold], [bold]${self.model.cost:.2f}[/bold]):[/red]\n",
@@ -44,8 +44,8 @@ class _TextualAgent(DefaultAgent):
44
44
  super().__init__(*args, config_class=TextualAgentConfig, **kwargs)
45
45
  self._current_action_from_human = False
46
46
 
47
- def add_message(self, role: str, content: str):
48
- super().add_message(role, content)
47
+ def add_message(self, role: str, content: str, **kwargs):
48
+ super().add_message(role, content, **kwargs)
49
49
  if self.app.agent_state != "UNINITIALIZED":
50
50
  self.app.call_from_thread(self.app.on_message_added)
51
51
 
@@ -276,8 +276,8 @@ class TextualAgent(App):
276
276
 
277
277
  self._vscroll = VerticalScroll()
278
278
 
279
- def run(self, task: str) -> tuple[str, str]:
280
- threading.Thread(target=lambda: self.agent.run(task), daemon=True).start()
279
+ def run(self, task: str, **kwargs) -> tuple[str, str]:
280
+ threading.Thread(target=lambda: self.agent.run(task, **kwargs), daemon=True).start()
281
281
  super().run()
282
282
  return self.exit_status, self.result
283
283
 
@@ -1,3 +1,4 @@
1
+ import logging
1
2
  import os
2
3
  import shlex
3
4
  import subprocess
@@ -5,8 +6,6 @@ import uuid
5
6
  from dataclasses import asdict, dataclass, field
6
7
  from typing import Any
7
8
 
8
- from minisweagent.utils.log import get_logger
9
-
10
9
 
11
10
  @dataclass
12
11
  class DockerEnvironmentConfig:
@@ -35,7 +34,7 @@ class DockerEnvironment:
35
34
  """This class executes bash commands in a Docker container using direct docker commands.
36
35
  See `DockerEnvironmentConfig` for keyword arguments.
37
36
  """
38
- self.logger = get_logger("minisweagent.environment")
37
+ self.logger = logging.getLogger("minisweagent.environment")
39
38
  self.container_id: str | None = None
40
39
  self.config = config_class(**kwargs)
41
40
  self._start_container()
@@ -97,7 +96,6 @@ class DockerEnvironment:
97
96
  def cleanup(self):
98
97
  """Stop and remove the Docker container."""
99
98
  if getattr(self, "container_id", None) is not None: # if init fails early, container_id might not be set
100
- self.logger.info(f"Stopping container {self.container_id}")
101
99
  cmd = f"(timeout 60 {self.config.executable} stop {self.container_id} || {self.config.executable} rm -f {self.container_id}) >/dev/null 2>&1 &"
102
100
  subprocess.Popen(cmd, shell=True)
103
101
 
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
 
3
+ import logging
3
4
  import os
4
5
  import shutil
5
6
  import subprocess
@@ -9,8 +10,6 @@ from dataclasses import asdict, dataclass, field
9
10
  from pathlib import Path
10
11
  from typing import Any
11
12
 
12
- from minisweagent.utils.log import get_logger
13
-
14
13
 
15
14
  @dataclass
16
15
  class SingularityEnvironmentConfig:
@@ -29,7 +28,7 @@ class SingularityEnvironmentConfig:
29
28
  class SingularityEnvironment:
30
29
  def __init__(self, **kwargs):
31
30
  """Singularity environment. See `SingularityEnvironmentConfig` for kwargs."""
32
- self.logger = get_logger("minisweagent.environment")
31
+ self.logger = logging.getLogger("minisweagent.environment")
33
32
  self.config = SingularityEnvironmentConfig(**kwargs)
34
33
  self.sandbox_dir = Path(tempfile.gettempdir()) / f"minisweagent-{uuid.uuid4().hex[:8]}"
35
34
  subprocess.run(
@@ -71,7 +70,6 @@ class SingularityEnvironment:
71
70
 
72
71
  def cleanup(self):
73
72
  if self.sandbox_dir.exists():
74
- self.logger.info(f"Removing sandbox {self.sandbox_dir}")
75
73
  shutil.rmtree(self.sandbox_dir)
76
74
 
77
75
  def __del__(self):
@@ -24,7 +24,7 @@ from minisweagent.environments import get_environment
24
24
  from minisweagent.models import get_model
25
25
  from minisweagent.run.extra.utils.batch_progress import RunBatchProgressManager
26
26
  from minisweagent.run.utils.save import save_traj
27
- from minisweagent.utils.log import add_file_handlers, logger
27
+ from minisweagent.utils.log import add_file_handler, logger
28
28
 
29
29
  _HELP_TEXT = """Run mini-SWE-agent on SWEBench instances.
30
30
 
@@ -198,7 +198,7 @@ def main(
198
198
  output_path = Path(output)
199
199
  output_path.mkdir(parents=True, exist_ok=True)
200
200
  logger.info(f"Results will be saved to {output_path}")
201
- add_file_handlers(output_path / "minisweagent.log")
201
+ add_file_handler(output_path / "minisweagent.log")
202
202
 
203
203
  dataset_path = DATASET_MAPPING.get(subset, subset)
204
204
  logger.info(f"Loading dataset {dataset_path}, split {split}...")
@@ -1,5 +1,6 @@
1
1
  """Run on a single SWE-Bench instance."""
2
2
 
3
+ import traceback
3
4
  from pathlib import Path
4
5
 
5
6
  import typer
@@ -58,11 +59,15 @@ def main(
58
59
  **({"mode": "yolo"} | config.get("agent", {})),
59
60
  )
60
61
 
61
- exit_status, result = None, None
62
+ exit_status, result, extra_info = None, None, None
62
63
  try:
63
64
  exit_status, result = agent.run(instance["problem_statement"]) # type: ignore[arg-type]
65
+ except Exception as e:
66
+ logger.error(f"Error processing instance {instance_spec}: {e}", exc_info=True)
67
+ exit_status, result = type(e).__name__, str(e)
68
+ extra_info = {"traceback": traceback.format_exc()}
64
69
  finally:
65
- save_traj(agent, output, exit_status=exit_status, result=result) # type: ignore[arg-type]
70
+ save_traj(agent, output, exit_status=exit_status, result=result, extra_info=extra_info) # type: ignore[arg-type]
66
71
 
67
72
 
68
73
  if __name__ == "__main__":
@@ -4,6 +4,7 @@
4
4
  # Read this first: https://mini-swe-agent.com/latest/usage/mini/ (usage)
5
5
 
6
6
  import os
7
+ import traceback
7
8
  from pathlib import Path
8
9
  from typing import Any
9
10
 
@@ -22,6 +23,7 @@ from minisweagent.environments.local import LocalEnvironment
22
23
  from minisweagent.models import get_model
23
24
  from minisweagent.run.extra.config import configure_if_first_time
24
25
  from minisweagent.run.utils.save import save_traj
26
+ from minisweagent.utils.log import logger
25
27
 
26
28
  DEFAULT_CONFIG = Path(os.getenv("MSWEA_MINI_CONFIG_PATH", builtin_config_dir / "mini.yaml"))
27
29
  DEFAULT_OUTPUT = global_config_dir / "last_mini_run.traj.json"
@@ -41,29 +43,19 @@ More information about the usage: [bold green]https://mini-swe-agent.com/latest/
41
43
  """
42
44
 
43
45
 
46
+ # fmt: off
44
47
  @app.command(help=_HELP_TEXT)
45
48
  def main(
46
- visual: bool = typer.Option(
47
- False,
48
- "-v",
49
- "--visual",
50
- help="Toggle (pager-style) UI (Textual) depending on the MSWEA_VISUAL_MODE_DEFAULT environment setting",
51
- ),
52
- model_name: str | None = typer.Option(
53
- None,
54
- "-m",
55
- "--model",
56
- help="Model to use",
57
- ),
49
+ visual: bool = typer.Option(False, "-v", "--visual", help="Toggle (pager-style) UI (Textual) depending on the MSWEA_VISUAL_MODE_DEFAULT environment setting",),
50
+ model_name: str | None = typer.Option( None, "-m", "--model", help="Model to use",),
58
51
  task: str | None = typer.Option(None, "-t", "--task", help="Task/problem statement", show_default=False),
59
52
  yolo: bool = typer.Option(False, "-y", "--yolo", help="Run without confirmation"),
60
53
  cost_limit: float | None = typer.Option(None, "-l", "--cost-limit", help="Cost limit. Set to 0 to disable."),
61
54
  config_spec: Path = typer.Option(DEFAULT_CONFIG, "-c", "--config", help="Path to config file"),
62
55
  output: Path | None = typer.Option(DEFAULT_OUTPUT, "-o", "--output", help="Output trajectory file"),
63
- exit_immediately: bool = typer.Option(
64
- False, "--exit-immediately", help="Exit immediately when the agent wants to finish instead of prompting."
65
- ),
56
+ exit_immediately: bool = typer.Option( False, "--exit-immediately", help="Exit immediately when the agent wants to finish instead of prompting."),
66
57
  ) -> Any:
58
+ # fmt: on
67
59
  configure_if_first_time()
68
60
  config = yaml.safe_load(get_config_path(config_spec).read_text())
69
61
 
@@ -92,13 +84,18 @@ def main(
92
84
  agent_class = InteractiveAgent
93
85
  if visual == (os.getenv("MSWEA_VISUAL_MODE_DEFAULT", "false") == "false"):
94
86
  agent_class = TextualAgent
95
- exit_status, result = None, None
87
+
96
88
  agent = agent_class(model, env, **config.get("agent", {}))
89
+ exit_status, result, extra_info = None, None, None
97
90
  try:
98
91
  exit_status, result = agent.run(task) # type: ignore[arg-type]
92
+ except Exception as e:
93
+ logger.error(f"Error running agent: {e}", exc_info=True)
94
+ exit_status, result = type(e).__name__, str(e)
95
+ extra_info = {"traceback": traceback.format_exc()}
99
96
  finally:
100
97
  if output:
101
- save_traj(agent, output, exit_status=exit_status, result=result) # type: ignore[arg-type]
98
+ save_traj(agent, output, exit_status=exit_status, result=result, extra_info=extra_info) # type: ignore[arg-type]
102
99
  return agent
103
100
 
104
101
 
@@ -0,0 +1,36 @@
1
+ import logging
2
+ from pathlib import Path
3
+
4
+ from rich.logging import RichHandler
5
+
6
+
7
+ def _setup_root_logger() -> None:
8
+ logger = logging.getLogger("minisweagent")
9
+ logger.setLevel(logging.DEBUG)
10
+ _handler = RichHandler(
11
+ show_path=False,
12
+ show_time=False,
13
+ show_level=False,
14
+ markup=True,
15
+ )
16
+ _formatter = logging.Formatter("%(name)s: %(levelname)s: %(message)s")
17
+ _handler.setFormatter(_formatter)
18
+ logger.addHandler(_handler)
19
+
20
+
21
+ def add_file_handler(path: Path | str, level: int = logging.DEBUG, *, print_path: bool = True) -> None:
22
+ logger = logging.getLogger("minisweagent")
23
+ handler = logging.FileHandler(path)
24
+ handler.setLevel(level)
25
+ formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
26
+ handler.setFormatter(formatter)
27
+ logger.addHandler(handler)
28
+ if print_path:
29
+ print(f"Logging to '{path}'")
30
+
31
+
32
+ _setup_root_logger()
33
+ logger = logging.getLogger("minisweagent")
34
+
35
+
36
+ __all__ = ["logger"]
@@ -1,32 +0,0 @@
1
- import logging
2
- from pathlib import Path
3
-
4
- MINI_LOGGERS = {}
5
- _EXTRA_HANDLERS = []
6
-
7
-
8
- def get_logger(name: str) -> logging.Logger:
9
- if name in MINI_LOGGERS:
10
- return MINI_LOGGERS[name]
11
- logger = logging.getLogger(name)
12
- logger.setLevel(logging.DEBUG)
13
- handler = logging.StreamHandler()
14
- formatter = logging.Formatter("%(name)s: %(levelname)s: %(message)s")
15
- handler.setFormatter(formatter)
16
- logger.addHandler(handler)
17
- for handler in _EXTRA_HANDLERS:
18
- logger.addHandler(handler)
19
- MINI_LOGGERS[name] = logger
20
- return logger
21
-
22
-
23
- def add_file_handlers(path: Path):
24
- handler = logging.FileHandler(path)
25
- formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
26
- handler.setFormatter(formatter)
27
- _EXTRA_HANDLERS.append(handler)
28
- for logger in MINI_LOGGERS.values():
29
- logger.addHandler(handler)
30
-
31
-
32
- logger = get_logger("minisweagent")
File without changes
File without changes
@@ -63,10 +63,10 @@ def get_model_name(input_model_name: str | None = None, config: dict | None = No
63
63
  config = {}
64
64
  if input_model_name:
65
65
  return input_model_name
66
- if from_env := os.getenv("MSWEA_MODEL_NAME"):
67
- return from_env
68
66
  if from_config := config.get("model_name"):
69
67
  return from_config
68
+ if from_env := os.getenv("MSWEA_MODEL_NAME"):
69
+ return from_env
70
70
  raise ValueError("No default model set. Please run `mini-extra config setup` to set one.")
71
71
 
72
72