Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Fix(models): Need to initialize logger early

Kilian Lieret7575e812f113
diff --git a/sweagent/agent/models.py b/sweagent/agent/models.py
index 56ad32cd..defaeee7 100644
--- a/sweagent/agent/models.py
+++ b/sweagent/agent/models.py
@@ -221,6 +221,7 @@ def _handle_raise_commands(action: str) -> None:
class HumanModel(AbstractModel):
def __init__(self, config: HumanModelConfig, tools: ToolConfig):
"""Model that allows for human-in-the-loop"""
+ self.logger = get_logger("swea-lm", emoji="🤖")
self.config = config
self.stats = InstanceStats()
@@ -230,7 +231,6 @@ class HumanModel(AbstractModel):
}
self._readline_histfile = REPO_ROOT / ".swe-agent-human-history"
self._load_readline_history()
- self.logger = get_logger("swea-lm", emoji="🤖")
def _load_readline_history(self) -> None:
"""Load autocomplete history from file"""