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]

Chore: Cleanup pydantic model config

Kilian Lieret4b1c394a9ff2
diff --git a/sweagent/run/run_single.py b/sweagent/run/run_single.py
index 1aeddbd0..8ba4f77b 100644
--- a/sweagent/run/run_single.py
+++ b/sweagent/run/run_single.py
@@ -33,7 +33,7 @@ from pathlib import Path
from typing import Self
import yaml
-from pydantic import BaseModel, Field
+from pydantic import BaseModel, ConfigDict, Field
from pydantic_settings import BaseSettings, SettingsConfigDict
from sweagent.agent.agents import AbstractAgent, AgentConfig, get_agent_from_config
@@ -52,7 +52,7 @@ from sweagent.utils.config import load_environment_variables
from sweagent.utils.log import add_file_handler, get_logger
-class RunSingleActionConfig(BaseModel, cli_implicit_flags=False):
+class RunSingleActionConfig(BaseModel):
"""Run real-life actions (opening PRs, etc.) if we can solve the issue."""
# Open a PR with the patch if we can solve the issue
@@ -61,6 +61,9 @@ class RunSingleActionConfig(BaseModel, cli_implicit_flags=False):
# When working with local repository: Apply patch
apply_patch_locally: bool = False
+ # pydantic config
+ model_config = ConfigDict(extra="forbid")
+
class RunSingleConfig(BaseSettings, cli_implicit_flags=False):
env: EnvironmentConfig = Field(default_factory=EnvironmentConfig, description="Environment options.")