Reify language backends, introducing LanguageBackendRegistry

* Many case differentiations in the agent code were replaced by
  method calls in the newly introduced LanguageBackend abstraction
* The registry allows new backends to be added dynamically
  (via Python packages that implement a specific entrypoint)
This commit is contained in:
Dominik Jain committed 2026-09-18 15:20:10 +02:00
1 parent 3ad4044c69
commit 3b898b671c
27 files changed
+571 -262

No files matched your search

+3 -2
View File
@@ -14,8 +14,9 @@ from pathlib import Path
from pprint import pprint
from serena.agent import SerenaAgent
from serena.config.serena_config import LanguageBackend, ProjectConfig, RegisteredProject, SerenaConfig
from serena.config.serena_config import ProjectConfig, RegisteredProject, SerenaConfig
from serena.constants import REPO_ROOT
from serena.language_backend import BuiltinLanguageBackend
from serena.project import Project
from serena.tools import (
CreateTextFileTool,
@@ -35,7 +36,7 @@ def make_agent() -> SerenaAgent:
"""Create an LSP-backed Serena agent for the Serena repository."""
serena_config = SerenaConfig.from_config_file()
serena_config.web_dashboard = False
serena_config.language_backend = LanguageBackend.LSP
serena_config.set_builtin_language_backend(BuiltinLanguageBackend.LSP)
project = Project(
project_root=str(REPO_PATH),