diff --git a/src/serena/config/serena_config.py b/src/serena/config/serena_config.py index c7809f57..b6c8a65c 100644 --- a/src/serena/config/serena_config.py +++ b/src/serena/config/serena_config.py @@ -992,6 +992,12 @@ class SerenaConfig(SharedConfig, ModeSelectionDefinitionWithBaseModes): # settings with overridden defaults + agent_interface: AgentInterface = AgentInterface.TOOLS + """ + the agent interface to use (unless overridden by the active project's configuration). + Defaults to TOOLS for backward compatibility (as users without this settings will get this default). + The default for new users is defined in the template file. + """ language_backend: LanguageBackend = LanguageBackend.LSP """ the language backend to use for code understanding features @@ -1171,10 +1177,10 @@ class SerenaConfig(SharedConfig, ModeSelectionDefinitionWithBaseModes): instance.language_backend = language_backend # determine agent interface - agent_interface_value = loaded_commented_yaml.get("agent_interface") - agent_interface: AgentInterface | None = None + agent_interface: AgentInterface | None = get_dataclass_default(SerenaConfig, "agent_interface") if "agent_interface" in loaded_commented_yaml: - agent_interface = AgentInterface.from_str(agent_interface_value) if agent_interface_value else None + agent_interface_value = loaded_commented_yaml["agent_interface"] + agent_interface = AgentInterface.from_str(agent_interface_value) else: num_migrations += 1 instance.agent_interface = agent_interface diff --git a/src/serena/resources/serena_config.template.yml b/src/serena/resources/serena_config.template.yml index f7163f2a..ea8e3d17 100644 --- a/src/serena/resources/serena_config.template.yml +++ b/src/serena/resources/serena_config.template.yml @@ -15,9 +15,8 @@ language_backend: LSP # The set of tools is fixed (the REPL tool and the tools required for session management), and the tool # inclusion/exclusion settings do not apply; instead, the operations available in the REPL are configured # via the API inclusion/exclusion settings (excluded_apis etc.). -# Leave empty to use Serena's default (currently "tools"). -# The interface is fixed at startup and can be overridden per project. -agent_interface: +# The interface is fixed at startup; it can be overridden by the project activated at startup. +agent_interface: tools # line ending convention to use when writing source files. # Possible values: "lf" (Unix), "crlf" (Windows), "native" (platform default).