Minor: declare mode-related fields instead of setting them

The fields _active_modes and _active_tools were overwritten directly after having been set, this is no longer the case
This commit is contained in:
Michael Panchenko committed 2026-01-29 12:50:56 +07:00
1 parent 754d7e5108
commit df0c10fa1a
1 file changed
+4 -5
+4 -5
View File
@@ -332,11 +332,6 @@ class SerenaAgent:
self.prompt_factory = SerenaPromptFactory()
self._project_activation_callback = project_activation_callback
# initialize members for modes and tools
self._mode_overrides = modes
self._active_modes = ActiveModes()
self._active_tools: AvailableTools = self._exposed_tools
# activate a project configuration (if provided or if there is only a single project available)
if project is not None:
try:
@@ -345,6 +340,10 @@ class SerenaAgent:
log.error(f"Error activating project '{project}' at startup: {e}", exc_info=e)
# update active modes and active tools (considering the active project, if any)
# declared attributes are set in the call to _update_active_modes_and_tools()
self._mode_overrides = modes
self._active_modes: ActiveModes
self._active_tools: AvailableTools
self._update_active_modes_and_tools()
# start the dashboard (web frontend), registering its log handler