SerenaConfig: Configure agent_interface default for existing users

To ensure backward compatibility, set the default to TOOLS when migrating
existing users' configuration files.
This commit is contained in:
Dominik Jain authored and Dominik Jain committed 2026-09-15 16:28:30 +02:00
1 parent 42ef92b616
commit 750deac10f
2 files changed
+11 -6

No files matched your search

+9 -3
View File
@@ -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
@@ -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).