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]

swe-rex exceptions moved

Kilian Lieret9f4733627ab3
diff --git a/sweagent/agent/agents.py b/sweagent/agent/agents.py
index 1b0f2115..e0e12418 100644
--- a/sweagent/agent/agents.py
+++ b/sweagent/agent/agents.py
@@ -9,7 +9,7 @@ from typing import Any, Self
from pydantic import BaseModel, ConfigDict, Field
from simple_parsing.helpers.fields import field
-from swerex.runtime.abstract import BashIncorrectSyntaxError, SweRexception
+from swerex.exceptions import BashIncorrectSyntaxError, SweRexception
from tenacity import RetryError
from sweagent import __version__, get_agent_commit_hash
diff --git a/sweagent/agent/models.py b/sweagent/agent/models.py
index 0758e38e..1a65053c 100644
--- a/sweagent/agent/models.py
+++ b/sweagent/agent/models.py
@@ -9,7 +9,7 @@ import litellm
import litellm.types.utils
from pydantic import BaseModel as PydanticBaseModel
from pydantic import ConfigDict, Field, SecretStr
-from swerex.runtime.abstract import SweRexception
+from swerex.exceptions import SweRexception
from tenacity import (
Retrying,
retry_if_not_exception_type,
diff --git a/tests/test_agent.py b/tests/test_agent.py
index 1b6fa37a..d1eca447 100644
--- a/tests/test_agent.py
+++ b/tests/test_agent.py
@@ -1,6 +1,7 @@
import pytest
import yaml
-from swerex.runtime.abstract import Action, BashObservation, Observation, SweRexception
+from swerex.exceptions import SweRexception
+from swerex.runtime.abstract import Action, BashObservation, Observation
from swerex.runtime.dummy import DummyRuntime
from sweagent import CONFIG_DIR
diff --git a/tests/test_env.py b/tests/test_env.py
index 3ba13c9f..12841813 100644
--- a/tests/test_env.py
+++ b/tests/test_env.py
@@ -4,7 +4,7 @@ from pathlib import Path
from unittest import mock
import pytest
-from swerex.runtime.abstract import CommandTimeoutError
+from swerex.exceptions import CommandTimeoutError
from sweagent.environment.hooks.abstract import EnvHook